/* =============================================================================
   FOOX BRICKS — Components Stylesheet
   Load order: fonts.css → pico.min.css → pico-custom.css → layout.css → components.css

   This file contains all class-specific component and page-section styles:
   shared UI components (badges, swatches, qty stepper, cart count, product cards,
   buttons) and page-level section styles (homepage hero, category grid, bestsellers,
   CTA banner, section headers).

   Brand tokens are defined in pico-custom.css.
   Structural layout (header, footer, catalog grid) lives in layout.css.
   ============================================================================= */

/* =============================================================================
   PRODUCT GRID & CARDS — generic catalog version
   Used on catalog pages. The homepage overrides grid-template-columns below.
   ============================================================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-6);
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition:
    box-shadow var(--transition-base),
    outline-color var(--transition-base);
  outline: var(--pico-border-width) solid transparent;
  overflow: hidden;
}

.product-card:hover {
  box-shadow: var(--shadow-card-hover);
  outline-color: var(--pico-primary-border);
  cursor: pointer;
}


.product-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.product-card-image {
  aspect-ratio: 1 / 1;
  background: var(--color-gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
}

.product-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.product-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(1.125 * var(--pico-spacing));
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--color-black);
  margin: 0;
}

.product-card-part {
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  margin-bottom: var(--space-2);
}

.product-card-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-black);
}

.product-card-price del {
  font-size: var(--text-sm);
  color: var(--color-gray-400);
  font-weight: 400;
  margin-right: var(--space-1);
}

.product-card-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-gray-100);
}

/* =============================================================================
   COLOR SWATCHES
   Clickable colour picker chips on product detail pages.
   ============================================================================= */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.color-swatch {
  width: var(--space-6);
  height: var(--space-6);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition-fast);
  display: block;
}

.color-swatch:hover,
.color-swatch.selected {
  border-color: var(--color-yellow);
}

/* =============================================================================
   QTY STEPPER
   Inline quantity input with − and + buttons.
   ============================================================================= */
.qty-stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--pico-muted-border-color);
  height: var(--space-10);
  width: fit-content;
  overflow: hidden;
}

.qty-stepper button {
  width: var(--space-10);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: var(--text-lg);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pico-color);
  transition: background var(--transition-fast);
  padding: 0;
  outline-offset: -2px;
}

.qty-stepper button:hover {
  background: var(--pico-form-element-selected-background-color);
}

.qty-stepper input {
  width: var(--space-12);
  text-align: center;
  border: none;
  border-left: 1px solid var(--pico-muted-border-color);
  border-right: 1px solid var(--pico-muted-border-color);
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-base);
  background: transparent;
  padding: 0;
  margin: 0;
  box-shadow: none;
  appearance: textfield;
}

.qty-stepper input:focus {
  box-shadow: none;
  outline: none;
}

.qty-stepper input::-webkit-inner-spin-button,
.qty-stepper input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

/* =============================================================================
   CART COUNT BADGE
   Coral dot overlaid on the cart icon showing item count.
   ============================================================================= */
.cart-count {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: var(--space-4);
  height: var(--space-4);
  background: var(--color-coral);
  color: var(--color-white);
  font-size: var(--text-2xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}


/* =============================================================================
   HOMEPAGE — HERO
   Overrides the base .hero rule from layout.css with homepage-specific values,
   then defines all hero sub-elements (eyebrow, title, stud grid, stats strip).
   ============================================================================= */
.hero {
  background: var(--color-black);
  color: var(--color-white);
  padding-block: 0;
  min-height: auto;
  display: block;
}


.hero-inner {
  padding: var(--space-20) var(--space-8) var(--space-12);
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.hero-content {
  flex: 1;
  min-width: 0;
}

.hero-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-yellow);
  margin-bottom: var(--space-2);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-6xl);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--color-white);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-5);
  margin-top: var(--space-3);
}

.hero-sub {
  font-size: var(--text-base);
  color: var(--color-gray-400);
  line-height: 1.6;
  max-width: calc(25 * var(--pico-spacing));
  margin-bottom: var(--space-8);
  margin-top: 0;
}

.hero-ctas {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* Stud grid — --space-16 (4 × --pico-spacing) per cell */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, var(--space-16));
  grid-template-rows: repeat(5, var(--space-16));
  grid-auto-rows: 0;
  overflow: hidden;
  gap: var(--space-1);
  flex-shrink: 0;
}

@media (min-width: 1280px) {
  .hero-grid { grid-template-columns: repeat(7, var(--space-16)); }
}

@media (min-width: 1536px) {
  .hero-grid { grid-template-columns: repeat(9, var(--space-16)); }
}

.hero-stud {
  width: var(--space-16);
  height: var(--space-16);
}

@keyframes heroConstruct {
  0%,
  5% {
    opacity: 0;
    transform: scale(0);
  }

  15%,
  70% {
    opacity: 1;
    transform: scale(1);
  }

  80% {
    opacity: 1;
    transform: scale(1);
  }

  95%,
  100% {
    opacity: 0;
    transform: scale(0);
  }
}

.hero-stud-construct {
  animation: heroConstruct 5s cubic-bezier(0.4, 1.6, 0.4, 1) infinite;
  opacity: 0;
}

/* Dark stats bar — inside the hero section */
.hero-stats {
  background: var(--color-black-soft);
  border-top: 1px solid var(--color-black-muted);
}

.hero-stats-inner {
  padding: 0 var(--space-8);
  display: flex;
  justify-content: center;
}

.hero-stat {
  padding: var(--space-4) var(--space-12);
  border-right: 1px solid var(--color-black-muted);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.hero-stat:last-child {
  border-right: none;
}

.hero-stat-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--color-yellow);
  text-transform: uppercase;
}

.hero-stat-label {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Small screens: the stud grid is decoration, so it goes; the stats stack. */
@media (max-width: 767px) {
  .hero-inner {
    padding: var(--space-12) var(--space-4) var(--space-10);
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-ctas {
    flex-wrap: wrap;
  }

  .hero-grid {
    display: none;
  }

  .hero-stats-inner {
    flex-direction: column;
    padding-inline: var(--space-4);
  }

  .hero-stat {
    padding-inline: 0;
    border-right: none;
    border-bottom: 1px solid var(--color-black-muted);
  }

  .hero-stat:last-child {
    border-bottom: none;
  }
}

/* =============================================================================
   HOMEPAGE — SECTION LAYOUT
   Header row (title + "view all" link) shared by featured and bestseller sections.
   ============================================================================= */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-2xl);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--color-black);
}

.section-link {
  font-size: var(--text-sm);
  color: var(--color-gray-400);
  text-decoration: underline;
  cursor: pointer;
  background: transparent;
  border: none;
}

.section-link:hover {
  color: var(--color-black);
}

/* =============================================================================
   HOMEPAGE — CATEGORIES
   6-column coloured category card grid.
   ============================================================================= */
.section-categories {
  padding-block: var(--space-12);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-1);
}

.cat-card {
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  min-height: calc(6.25 * var(--pico-spacing));
  cursor: pointer;
  transition: filter var(--transition-fast);
  text-decoration: none;
}

.cat-card:hover {
  filter: brightness(0.9);
  text-decoration: none;
}

@media (max-width: 991px) {
  .cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cat-count {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: calc(1.75 * var(--pico-spacing));
  line-height: 1;
}

.cat-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--space-1);
}

.cat-accent-bar {
  width: var(--space-6);
  height: 3px;
  margin-top: var(--space-2);
}

/* =============================================================================
   HOMEPAGE — BESTSELLERS SECTION
   White background section with a responsive product grid:
   4 columns by default, 6 columns at 1280px+ (mirrors hero stud breakpoints).
   ============================================================================= */
.section-bestsellers {
  background: var(--color-white);
  padding-block: var(--space-12);
}

.section-bestsellers .product-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

/* Cap at 2 rows: hide items 9+ at 4 columns */
.section-bestsellers .product-grid > *:nth-child(n+9) {
  display: none;
}

@media (min-width: 1280px) {
  .section-bestsellers .product-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  /* Cap at 2 rows: show up to 10 at 5 columns */
  .section-bestsellers .product-grid > *:nth-child(n+9) {
    display: block;
  }

  .section-bestsellers .product-grid > *:nth-child(n+11) {
    display: none;
  }
}

/* Smaller screens: 3 columns, then 2 on phones; still capped at 2 rows. */
@media (max-width: 991px) {
  .section-bestsellers .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section-bestsellers .product-grid > *:nth-child(n+7) {
    display: none;
  }
}

@media (max-width: 575px) {
  .section-bestsellers .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .section-bestsellers .product-grid > *:nth-child(n+5) {
    display: none;
  }
}

/* =============================================================================
   HOMEPAGE — CTA BANNER
   Full-width yellow call-to-action strip between content sections.
   ============================================================================= */
.cta-banner {
  background: var(--color-yellow);
  border-bottom: 1px solid var(--color-black-soft);
}

.cta-banner-inner {
  padding: var(--space-10) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.cta-banner h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: calc(2.25 * var(--pico-spacing));
  color: var(--color-black);
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.cta-banner p {
  font-size: var(--text-sm);
  color: var(--color-black-muted);
  margin: 0;
}

/* =============================================================================
   PRODUCT CARD — shared detail elements
   Image area, stud placeholder grid, badge position, body, price row, and
   add-to-cart button. Used on both the homepage and catalog pages.
   ============================================================================= */
.product-card-img-area {
  height: calc(10 * var(--pico-spacing));
  background: var(--color-gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--color-gray-100);
  overflow: hidden;
  /* Pull flush to all three card edges, cancelling Pico's article padding */
  margin: calc(-1 * var(--pico-block-spacing-vertical))
          calc(-1 * var(--pico-block-spacing-horizontal))
          var(--pico-block-spacing-vertical);
}

.product-card-img-area img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  /* BrickLink PNGs have a white background; multiply blends white away against the light card bg */
  mix-blend-mode: multiply;
}

/* 18px is the LEGO stud dimension, intentional */
.product-card-stud-grid {
  display: grid;
  grid-template-columns: repeat(4, 18px);
  grid-template-rows: repeat(3, 18px);
  gap: var(--space-1);
}

.product-card-stud {
  width: 18px;
  height: 18px;
}

.product-card-badge-pos {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
}

.product-card-part-num {
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-xs);
  color: var(--color-gray-400);
}

.product-card-condition {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin-top: var(--space-1);
}

.product-card-colors {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--space-1);
}

.product-card-color-dot {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--color-black) 12%, transparent);
}

.product-card-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.product-card-price-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: calc(1.375 * var(--pico-spacing));
  color: var(--color-black);
}

.product-card-price-label {
  font-size: var(--text-2xs);
  color: var(--color-gray-300);
  font-weight: 400;
  letter-spacing: 0.02em;
  align-self: flex-end;
  padding-bottom: 3px;
}

.product-card-old-price {
  font-size: var(--text-xs);
  color: var(--color-gray-300);
  text-decoration: line-through;
}

.product-card-add-btn {
  margin-top: auto;
  font-size: var(--text-sm);
  background: var(--color-black);
  color: var(--color-white);
  border: 0px;
  width: 100%;
}

.product-card:hover .product-card-add-btn {
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
  border-color: var(--pico-primary-border);
}

/* =============================================================================
   CATALOG PAGE
   Page header (title + sort controls), filter panel, product area, empty state.
   ============================================================================= */

/* Breadcrumb — shared between catalog and product detail */
.catalog-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-gray-400);
}

.catalog-breadcrumb li + li::before {
  content: "/";
  color: var(--color-gray-200);
  margin-right: var(--space-2);
}

.catalog-breadcrumb a {
  color: var(--color-gray-400);
  text-decoration: none;
}

.catalog-breadcrumb a:hover {
  color: var(--color-black);
  text-decoration: underline;
}

.catalog-body {
  padding-block: var(--space-8);
}

.catalog-page-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-8);
}

.catalog-page-title {
  margin: 0;
  font-size: var(--text-3xl);
  line-height: 1;
}

.catalog-page-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.catalog-result-count {
  font-size: var(--text-sm);
  color: var(--color-gray-400);
  white-space: nowrap;
}

.catalog-page-controls select {
  margin: 0;
  width: auto;
  min-width: 12rem;
}

/* Filter panel — subcomponents (base layout rules live in layout.css) */

.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-gray-100);
}

.filter-panel-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-base);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-clear-link {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  text-decoration: underline;
}

.filter-clear-link:hover {
  color: var(--color-black);
}

.filter-section-body {
  padding-block: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
}

.filter-section-body label {
  font-size: var(--text-sm);
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

/* Color swatches */

.filter-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.filter-color-swatch {
  display: block;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.filter-color-swatch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.filter-color-swatch span {
  display: block;
  width: 22px;
  height: 22px;
  border: 1px solid var(--color-gray-100);
  transition: outline var(--transition-fast);
  outline: 1px solid transparent;
  outline-offset: 1px;
}

.filter-color-swatch input:checked + span {
  outline-color: var(--color-yellow);
  border-color: var(--color-yellow);
}

/* Price range */

.filter-price-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.dual-range {
  position: relative;
  height: 1.5rem;
  --min-pct: 0%;
  --max-pct: 100%;
}

.dual-range::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 2px;
  pointer-events: none;
  background: linear-gradient(
    to right,
    var(--color-gray-200) 0%,
    var(--color-gray-200) var(--min-pct),
    var(--color-yellow) var(--min-pct),
    var(--color-yellow) var(--max-pct),
    var(--color-gray-200) var(--max-pct),
    var(--color-gray-200) 100%
  );
}

.dual-range input[type="range"] {
  position: absolute;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 4px;
}

.dual-range input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
  height: 4px;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: all;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-yellow);
  border: 2px solid var(--color-black);
  cursor: pointer;
  margin-top: -7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dual-range input[type="range"]::-moz-range-track {
  background: transparent;
  height: 4px;
  border: none;
}

.dual-range input[type="range"]::-moz-range-thumb {
  pointer-events: all;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-yellow);
  border: 2px solid var(--color-black);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.filter-price-range {
  display: flex;
  justify-content: space-between;
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  margin-top: var(--space-1);
}

/* Product area */

.catalog-product-area {
  padding: var(--space-5);
}

.catalog-product-area .product-grid {
  /* clamp(20%, 170px, 50%) on the min track size:
     20% → at least 5 columns fit (5 × 20% = 100%)
     50% → at most 2 columns fit (2 × 50% = 100%) */
  grid-template-columns: repeat(auto-fill, minmax(clamp(20%, 170px, 50%), 1fr));
  gap: var(--space-3);
}

/* Empty state */

.catalog-empty-state {
  text-align: center;
  padding: var(--space-20) var(--space-8);
  color: var(--color-gray-400);
}

.catalog-empty-grid {
  display: inline-grid;
  grid-template-columns: repeat(3, var(--space-10));
  grid-template-rows: repeat(3, var(--space-10));
  gap: var(--space-1);
  margin-bottom: var(--space-6);
}

.catalog-empty-stud {
  background: var(--color-gray-100);
}

.catalog-empty-grid > *:nth-child(even) {
  background: var(--color-gray-200);
}

.catalog-empty-state p {
  margin-bottom: var(--space-4);
}

/* =============================================================================
   PRODUCT DETAIL PAGE
   Surface card layout: image + geschiedenis (left) / info + specs (right).
   Related items in a separate card below.
   ============================================================================= */

.product-detail {
  padding-block: var(--space-6);
}

/* Main white surface card — all spacing from Pico <article> */
.product-detail-card {
  position: relative;
  overflow: hidden;
}

.product-detail-watermark {
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 360px;
  height: 360px;
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  align-items: start;
}

/* Image panel */
.product-detail-image-panel {
  display: flex;
  flex-direction: column;
}

.product-detail-main-image {
  height: calc(26.25 * var(--pico-spacing)); /* 420px */
  background: var(--color-gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-detail-main-image img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-detail-stud-grid {
  display: grid;
  grid-template-columns: repeat(4, 44px);
  grid-template-rows: repeat(2, 44px);
  gap: 8px;
}

.product-detail-stud {
  width: 44px;
  height: 44px;
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.22);
  transition: background var(--transition-base);
}

.product-detail-img-color-label {
  position: absolute;
  top: var(--space-3);
  left: var(--space-4);
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-xs);
  color: var(--color-gray-300);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.product-detail-part-tag {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-xs);
  color: var(--color-gray-300);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Section header (Geschiedenis, Specificaties) */
.product-detail-section-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.product-detail-section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: calc(1.125 * var(--pico-spacing));
  color: var(--color-black);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-detail-section-meta {
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-2xs);
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Reusable small mono label */
.product-detail-mono-label {
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-2xs);
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Geschiedenis section */
.product-detail-history {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-gray-100);
}

.product-detail-history-text {
  font-size: var(--text-sm);
  color: var(--color-black-muted);
  line-height: 1.65;
  margin-bottom: 0;
}

/* Production timeline */
.product-detail-timeline-section {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-gray-50);
}

.product-detail-timeline-section > .product-detail-mono-label {
  margin-bottom: var(--space-3);
}

.product-detail-timeline {
  position: relative;
  height: 18px;
  margin-bottom: var(--space-3);
}

.product-detail-timeline-track {
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 2px;
  background: var(--color-black);
  transform: translateY(-50%);
}

.product-detail-timeline-tick {
  position: absolute;
  top: 50%;
  width: 1px;
  height: 10px;
  background: var(--color-gray-500);
  transform: translate(-50%, -50%);
}

.product-detail-timeline-dot {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.product-detail-timeline-dot--start {
  left: 0;
  background: var(--color-black);
}

.product-detail-timeline-dot--end {
  right: 0;
  background: var(--color-yellow);
  border: 2px solid var(--color-black);
}

.product-detail-timeline-dates {
  position: relative;
  height: 14px;
}

.product-detail-timeline-dates > span {
  position: absolute;
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-xs);
  color: var(--color-black);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.product-detail-timeline-dates > span:first-child { left: 0; }

.product-detail-timeline-dates > span:last-child { right: 0; }

.product-detail-timeline-decade {
  position: absolute;
  transform: translateX(-50%);
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-2xs);
  color: var(--color-gray-400);
  letter-spacing: 0.06em;
  font-weight: 400 !important;
}

/* Colors-ever-appeared grid */
.product-detail-colors-ever {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-gray-50);
}

.product-detail-colors-ever-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.product-detail-colors-ever-count {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.product-detail-colors-ever-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: calc(1.625 * var(--pico-spacing));
  color: var(--color-black);
  line-height: 1;
}

.product-detail-colors-ever-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.product-detail-colors-ever-cell {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.product-detail-colors-ever-cell--ghost {
  background: var(--color-gray-50);
}

.product-detail-colors-ever-footer {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-2xs);
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Info panel */
.product-detail-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-4xl);
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: var(--space-2) 0 var(--space-1);
}

.product-detail-price {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-3xl);
  color: var(--color-black);
  line-height: 1;
  margin-bottom: 0;
}

/* The price before a running sale, struck through beside the price (#567). */
.product-detail-old-price {
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-gray-300);
  margin-right: var(--space-2);
}

.product-detail-per-unit {
  font-family: var(--pico-font-family);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-gray-400);
}

.product-detail-bulk-note {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  margin-top: var(--space-2);
  margin-bottom: 0;
}

.product-detail-section {
  margin-top: var(--space-5);
}

.product-detail-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gray-400);
  margin-bottom: var(--space-3);
  font-family: var(--pico-font-family);
}

.product-detail-color-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.product-detail-color-swatch {
  width: 28px;
  height: 28px;
  cursor: pointer;
  border: 1px solid transparent;
  padding: 0;
  transition: outline var(--transition-fast);
  outline: 1px solid transparent;
  outline-offset: 1px;
}

.product-detail-color-swatch.selected {
  border-color: var(--color-yellow);
  outline-color: var(--color-yellow);
}

.product-detail-color-swatch:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.product-detail-condition-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.product-detail-condition-btn {
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid var(--color-gray-200);
  background: var(--color-white);
  color: var(--color-gray-500);
  cursor: pointer;
  margin: 0;
  width: auto;
  line-height: 1.6;
}

.product-detail-condition-btn.selected {
  border-color: var(--color-yellow);
  color: var(--color-black);
  background: var(--color-white);
}

.product-detail-cart-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.product-detail-cart-row .qty-stepper {
  height: calc(3 * var(--pico-spacing));
}

.product-detail-cart-row .qty-stepper button {
  width: calc(3 * var(--pico-spacing));
  height: 100%;
}

.product-detail-add-btn {
  flex: 1;
  margin: 0;
  height: calc(3 * var(--pico-spacing));
}

.product-detail-add-btn:disabled {
  background: var(--color-gray-200) !important;
  color: var(--color-gray-400) !important;
  border-color: var(--color-gray-200) !important;
  cursor: not-allowed;
}

/* Specs section */
.product-detail-specs-section {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-gray-100);
}

.product-detail-spec-table {
  margin: 0;
}

.product-detail-spec-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-gray-50);
  gap: var(--space-8);
}

.product-detail-spec-row dt {
  font-size: var(--text-sm);
  color: var(--color-gray-400);
  font-weight: 400;
}

.product-detail-spec-row dd {
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-sm);
  color: var(--color-black);
  font-weight: 500;
  margin: 0;
  text-align: right;
}

/* Related items card */
.product-detail-related-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-100);
  margin-top: var(--space-6);
}

.product-detail-related-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.product-detail-related-hdr h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: calc(1.625 * var(--pico-spacing));
  color: var(--color-black);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0;
}

.product-detail-related-hdr a {
  font-size: var(--text-sm);
  color: var(--color-gray-400);
  text-decoration: underline;
}

.product-detail-related-hdr a:hover {
  color: var(--color-black);
}

.product-detail-related-grid {
  grid-template-columns: repeat(auto-fill, minmax(clamp(20%, 170px, 50%), 1fr));
  gap: var(--space-4);
}

/* =============================================================================
   ERROR PAGE
   Full-bleed dark layout for 404 and 500 responses.
   ============================================================================= */

/* Overrides the default container on <main> — applied via block main_attrs */
.error-page {
  background: var(--color-black);
  position: relative;
}


.error-layout {
  position: relative;
  z-index: 1;
  padding: var(--space-20) var(--space-8) var(--space-24);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

/* -- Copy column -- */

.error-eyebrow {
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-yellow);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.error-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  flex-shrink: 0;
}

.error-dot--yellow { background: var(--color-yellow); }

.error-dot--coral {
  background: var(--color-coral);
  animation: errorPulse 1.4s ease-in-out infinite;
}

@keyframes errorPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.error-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: calc(9 * var(--pico-spacing));
  line-height: 0.9;
  text-transform: uppercase;
  color: var(--color-white);
  letter-spacing: -0.025em;
  margin-top: var(--space-3);
  margin-bottom: var(--space-6);
}

.error-body {
  font-size: var(--text-lg);
  color: var(--color-gray-300);
  line-height: 1.55;
  max-width: 28rem;
  margin-bottom: var(--space-8) !important;
}

.error-ctas {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
}

.error-ctas [role="button"],
.error-ctas button {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-base);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-block: var(--space-4);
  padding-inline: var(--space-8);
  margin-bottom: 0;
  white-space: nowrap;
}


.error-incident {
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  margin-top: var(--space-4);
}

/* -- Visual column -- */

.error-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 404 — broken stud grid */

.error-stud-wrap {
  position: relative;
  padding-top: 2rem; /* room for the label above the grid */
}

.error-stud-grid {
  display: grid;
  grid-template-columns: repeat(5, 64px);
  grid-template-rows: repeat(5, 64px);
  gap: 8px;
}

.error-stud {
  width: 64px;
  height: 64px;
}

.error-stud--dark   { background: var(--color-black-soft); }
.error-stud--yellow { background: var(--color-yellow); }
.error-stud--coral  { background: var(--color-coral); }

.error-stud--empty {
  background: transparent;
  border: 1px dashed var(--color-gray-600);
}

/* Tumbled pieces scattered outside the grid */
.error-tumbled {
  position: absolute;
  box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

.error-tumbled--yellow {
  width: 64px;
  height: 64px;
  background: var(--color-yellow);
  right: -82px;
  bottom: -24px;
  transform: rotate(14deg);
}

.error-tumbled--coral {
  width: 44px;
  height: 44px;
  background: var(--color-coral);
  right: -118px;
  bottom: 22px;
  transform: rotate(-22deg);
}

.error-visual-code {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  letter-spacing: 0.2em;
  white-space: nowrap;
}

/* 500 — collapsed brick pile */

.error-bricks-wrap {
  position: relative;
  padding-top: 2rem;
}

.error-bricks {
  position: relative;
  width: 360px;
  height: 380px;
}

.error-brick {
  position: absolute;
  left: var(--bx);
  top: var(--by);
  width: var(--bw);
  height: var(--bh);
  background: var(--bc);
  transform: rotate(var(--br));
  box-shadow: 0 8px 18px rgba(0,0,0,0.4);
}

/* Smaller screens: copy above the picture; on phones the picture (decoration,
   wider than the screen with its tumbled pieces) goes. */
@media (max-width: 991px) {
  .error-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 575px) {
  .error-layout {
    padding: var(--space-12) var(--space-4) var(--space-16);
  }

  .error-title {
    font-size: var(--text-5xl);
  }

  .error-visual {
    display: none;
  }
}

/* =============================================================================
   BADGES
   Small label chips used on product cards and throughout the site.
   ============================================================================= */
.badge {
  display: inline-block;
  font-family: var(--pico-font-family);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-2);
  line-height: 1.4;
}

/* Label badges */

.badge--new {
  background: var(--color-black);
  color: var(--color-yellow);
}

.badge--sale {
  background: var(--color-coral);
  color: var(--color-white);
}

.badge--featured {
  background: var(--color-black);
  color: var(--color-yellow);
}

.badge--rare {
  background: transparent;
  color: var(--color-black);
  border: 1px solid var(--color-black);
}

.badge--limited {
  background: transparent;
  color: var(--color-coral);
  border: 1px solid var(--color-coral);
}

/* Stock badges */

.badge--in-stock {
  background: var(--color-success);
  color: var(--color-white);
}

.badge--low-stock {
  background: var(--color-yellow);
  color: var(--color-black);
}

.badge--out-stock {
  background: var(--color-coral);
  color: var(--color-white);
}

.badge--pre-order {
  background: var(--color-black);
  color: var(--color-yellow);
}

/* Condition badges */

.badge--condition-new {
  background: var(--color-success);
  color: var(--color-white);
}

.badge--condition-used {
  background: var(--color-gray-100);
  color: var(--color-gray-600);
}

/* =============================================================================
   CATALOG PAGINATION
   Three-region bar: range label | numbered controls | page/total
   ============================================================================= */

.foox-pag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-top: 1px solid var(--color-gray-100);
  background: var(--color-white);
  /* Break out of catalog-product-area's inline padding so the border spans full column width */
  margin-inline: calc(-1 * var(--space-5));
  margin-top: var(--space-5);
}

.foox-pag__side {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--color-gray-400);
  white-space: nowrap;
}

.foox-pag__strong {
  color: var(--color-black);
  font-weight: 600;
}

.foox-pag__nums {
  display: flex;
  gap: 4px;
  align-items: center;
}

.foox-pag__cell {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-black);
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 150ms ease;
}

.foox-pag__cell:hover:not(.foox-pag__cell--active):not(.foox-pag__nav--disabled):not(.foox-pag__elide) {
  border-color: var(--color-black);
  color: var(--color-black);
  text-decoration: none;
}

.foox-pag__cell--active {
  background: #ffcc00;
  color: var(--color-black);
  border-color: var(--color-black);
  font-weight: 700;
  cursor: default;
}

.foox-pag__nav {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 12px;
}

.foox-pag__nav--disabled {
  color: var(--color-gray-200);
  cursor: not-allowed;
}

.foox-pag__elide {
  color: var(--color-gray-400);
  min-width: 22px;
  cursor: default;
}

@media (max-width: 560px) {
  .foox-pag__side {
    display: none;
  }
}
/* =============================================================================
   FLASH MESSAGES & ACCOUNT PAGES (#502)
   ============================================================================= */

.flash-messages {
  padding-top: var(--space-4);
}

.flash {
  margin-bottom: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--color-info);
  background: var(--pico-card-background-color);
}

.flash-success { border-left-color: var(--color-success); }
.flash-error { border-left-color: var(--color-error); }
.flash-dev { border-left-color: var(--color-yellow); font-family: var(--pico-font-family-monospace); }

.icon-btn.is-logged-in {
  color: var(--color-yellow);
}

.account-narrow {
  max-width: 32rem;
  margin-inline: auto;
}

.account-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.account-actions form {
  margin: 0;
}

.account-actions button {
  margin: 0;
}

.address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--space-4);
}

.address-grid article {
  margin: 0;
}

.address-grid address {
  font-style: normal;
  margin-bottom: var(--space-3);
}

.address-defaults {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.address-default {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0 var(--space-2);
  background: var(--color-yellow);
  color: var(--color-black);
}

.form-error {
  display: block;
  color: var(--color-error);
}

/* =============================================================================
   CART & CHECKOUT (#503)
   Cart, checkout and the confirmation share the page head (title + steps), a
   two-column layout (content + sticky summary) and the summary's rows.
   ============================================================================= */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* djLint keeps whitespace inside the empty region, so :empty never matches. */
#cart-feedback:not(:has(*)) {
  display: none;
}

#cart-heading:focus {
  outline: none;
}

/* Pico points --pico-color at the (yellow) link colour inside every <a>; links
   that should read as text use --checkout-text, taken outside the link. */
.checkout-head,
.checkout-layout,
.auth-form {
  --checkout-text: var(--pico-color);
}

/* ----- Page head: title (+ back link) left, steps right ----- */
.checkout-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  padding-top: var(--space-8);
  margin-bottom: var(--space-6);
}

.checkout-head h1 {
  font-size: var(--text-3xl);
  line-height: 1;
  margin: 0;
}

.checkout-back {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--pico-muted-color);
  text-decoration-color: currentColor;
}

/* ----- Steps: the current one is wide and yellow, done ones are filled ----- */
.checkout-steps {
  display: flex;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-shrink: 0;
}

.checkout-steps li,
.checkout-steps li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.checkout-steps li {
  width: var(--space-10);
  height: var(--space-10);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  border: 1px solid var(--pico-muted-border-color);
  color: var(--pico-muted-color);
  font-family: var(--font-display);
  transition: width 250ms ease, background-color 200ms ease, color 200ms ease;
}

.checkout-steps li > a {
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.checkout-step-mark {
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-sm);
}

/* Only the current step shows its label; the others keep it for screen readers. */
.checkout-steps li:not([aria-current]) .checkout-step-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.checkout-steps li[aria-current="step"] {
  width: calc(13 * var(--pico-spacing));
  background: var(--color-yellow);
  border-color: var(--color-yellow);
  color: var(--color-black);
}

.checkout-steps li[aria-current="step"] .checkout-step-label {
  font-weight: 800;
  font-size: var(--text-base);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.checkout-steps li.is-done {
  background: var(--pico-color);
  border-color: var(--pico-color);
  color: var(--pico-background-color);
}

.checkout-steps li.is-done:hover {
  filter: brightness(0.9);
}

/* ----- Two columns: content + summary (stacked on small screens) ----- */
.checkout-layout {
  --checkout-summary-width: calc(24 * var(--pico-spacing));
  display: grid;
  gap: var(--space-6);
  align-items: start;
  padding-bottom: var(--space-16);
}

@media (min-width: 992px) {
  .checkout-layout {
    grid-template-columns: minmax(0, 1fr) var(--checkout-summary-width);
  }

  .checkout-summary {
    position: sticky;
    /* Below the sticky site header (top bar + nav) */
    top: calc(var(--header-height) + var(--space-16));
  }
}

/* ----- Cards: white surface with a thin border ----- */
.cart-lines,
.cart-empty,
.checkout-card,
.checkout-summary,
.checkout-info,
.checkout-upsell {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-card-border-color);
}

.checkout-card h2,
.checkout-summary h2,
.checkout-upsell h2 {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.1;
  margin: 0 0 var(--space-4);
}

/* Heading with something on its right (login link, piece count) */
.checkout-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.checkout-section-head h2 {
  margin: 0;
}

.checkout-section-head p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--pico-muted-color);
}

/* ----- Form labels: small caps above the field ----- */
.checkout-card label:not(:has([role="switch"])),
.auth-form label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pico-muted-color);
}

.checkout-card label small,
.auth-form label small {
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

/* ----- Cart lines ----- */
.cart-lines {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-lines > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin: 0;
  padding: var(--space-4) var(--space-5);
  list-style: none;
  border-bottom: 1px solid var(--pico-card-border-color);
}

.cart-lines > li:last-child {
  border-bottom: none;
}

.cart-thumb,
.summary-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--color-white);
  border: 1px solid var(--pico-card-border-color);
}

.cart-thumb {
  width: calc(4.5 * var(--pico-spacing));
  height: calc(4.5 * var(--pico-spacing));
}

.cart-thumb img,
.summary-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cart-line-info {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.cart-line-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--checkout-text);
  text-decoration: none;
}

a.cart-line-name:hover {
  text-decoration: underline;
}

.cart-line-info .part-number {
  font-size: var(--text-xs);
}

.cart-line-info small {
  color: var(--pico-muted-color);
}

.cart-line-info .badge {
  align-self: flex-start;
}

.cart-line-unavailable .cart-thumb,
.cart-line-unavailable .cart-line-info,
.cart-qty-static {
  opacity: 0.6;
}

.cart-qty-static {
  font-family: var(--pico-font-family-monospace);
}

.cart-qty-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
}

.cart-qty-form .qty-stepper input {
  height: 100%;
}

.cart-qty-form small {
  font-size: var(--text-xs);
  color: var(--pico-muted-color);
}

.cart-line-total {
  min-width: calc(4.5 * var(--pico-spacing));
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  text-align: right;
  white-space: nowrap;
}

.cart-remove-form {
  margin: 0;
}

.cart-remove {
  width: var(--space-8);
  height: var(--space-8);
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--pico-muted-color);
  font-family: var(--pico-font-family);
  font-size: var(--text-xl);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.cart-remove:hover,
.cart-remove:focus-visible {
  background: transparent;
  color: var(--color-coral);
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-16);
  padding: var(--space-16) var(--space-8);
  text-align: center;
}

.cart-empty p {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  text-transform: uppercase;
  color: var(--pico-muted-color);
}

/* ----- Summary (cart, checkout, confirmation) ----- */
.checkout-summary {
  padding: var(--space-5) var(--space-6);
}

.checkout-summary .checkout-section-head {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--pico-card-border-color);
}

.summary-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.summary-items li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  list-style: none;
}

.summary-thumb {
  position: relative;
  width: var(--space-10);
  height: var(--space-10);
}

.summary-qty {
  position: absolute;
  top: calc(-1 * var(--space-2));
  right: calc(-1 * var(--space-2));
  padding: 0 var(--space-1);
  background: var(--color-black);
  color: var(--color-yellow);
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-2xs);
  line-height: 1.6;
}

.summary-item-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.summary-item-name strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.summary-item-name .part-number {
  font-size: var(--text-2xs);
}

.summary-item-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  white-space: nowrap;
}

.summary-rows,
.summary-total {
  margin: 0;
}

/* Shipping method choice (#566): one row per method, price on the right. */
.shipping-options {
  margin: 0 0 var(--space-3);
  padding: 0;
  border: 0;
}

.shipping-options legend {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
}

.shipping-options label {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.shipping-option-name {
  flex: 1;
  min-width: 0;
}

.shipping-option-name small {
  display: block;
  color: var(--pico-muted-color);
}

.shipping-option-price {
  white-space: nowrap;
}

.summary-rows > div,
.summary-total > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
}

.summary-rows > div {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.summary-rows dt,
.summary-rows dd,
.summary-total dt,
.summary-total dd {
  margin: 0;
}

.summary-rows dt {
  font-weight: 400;
}

.summary-rows dd {
  text-align: right;
}

.summary-rows small {
  color: var(--pico-muted-color);
}

.summary-free {
  color: var(--color-success);
  font-weight: 700;
  text-transform: uppercase;
}

.summary-free-shipping {
  margin: 0 0 var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--color-black-soft);
  color: var(--color-yellow);
  font-size: var(--text-xs);
}

.summary-total {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--pico-card-border-color);
}

.summary-total dt,
.summary-total dd {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-xl);
  text-transform: uppercase;
}

.summary-vat {
  margin: 0;
  text-align: right;
  font-size: var(--text-xs);
  color: var(--pico-muted-color);
}

.checkout-summary [type="submit"],
.checkout-summary [role="button"] {
  width: 100%;
  margin: var(--space-4) 0 0;
}

.summary-note {
  margin: var(--space-3) 0 0;
}

.summary-note small {
  color: var(--pico-muted-color);
}

.summary-continue {
  margin: var(--space-3) 0 0;
  text-align: center;
  font-size: var(--text-sm);
}

.summary-continue a,
.checkout-section-head p a {
  color: var(--checkout-text);
  text-decoration-color: currentColor;
}

/* ----- Checkout form: one card, a section per part ----- */
.checkout-card > section {
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--pico-card-border-color);
}

.checkout-card > section:last-child {
  border-bottom: none;
}

.checkout-logged-in::before {
  content: "";
  display: inline-block;
  width: var(--space-2);
  height: var(--space-2);
  margin-right: var(--space-2);
  background: var(--color-success);
}

@media (max-width: 575px) {
  .checkout-card > section {
    padding: var(--space-5) var(--space-4);
  }

  .cart-lines > li {
    padding: var(--space-4);
  }
}

/* ----- Confirmation ----- */
.checkout-done {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.checkout-hero {
  padding: var(--space-8) var(--space-8) var(--space-6);
  background: var(--color-black);
  border: 1px solid var(--color-black-soft);
  color: var(--color-gray-300);
}

.checkout-eyebrow {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-yellow);
}

.checkout-hero h2 {
  margin: 0 0 var(--space-4);
  font-size: var(--text-4xl);
  font-weight: 900;
  line-height: 0.95;
  color: var(--color-white);
}

.checkout-hero p:last-child {
  max-width: 37rem;
  margin: 0;
  line-height: 1.6;
}

.checkout-order-number {
  font-family: var(--pico-font-family-monospace);
  color: var(--color-yellow);
}

.checkout-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-6);
  padding: var(--space-6) var(--space-8);
}

.checkout-info h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--pico-font-family);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--pico-muted-color);
}

.checkout-info-big {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-2xl);
  line-height: 1.1;
  text-transform: uppercase;
}

.checkout-info address {
  margin: 0;
  font-style: normal;
  line-height: 1.6;
}

.checkout-upsell {
  padding: var(--space-5) var(--space-8) var(--space-6);
  border-color: var(--color-yellow);
}

.checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
}

/* =============================================================================
   LOG IN, REGISTER, PASSWORD PAGES (account/_auth.html)
   Dark brand panel next to the form; stacked on small screens.
   ============================================================================= */
.auth-shell {
  display: grid;
  max-width: calc(74 * var(--pico-spacing));
  margin: var(--space-12) auto var(--space-16);
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-card-border-color);
}

@media (min-width: 768px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    min-height: calc(43 * var(--pico-spacing));
  }
}

.auth-brand {
  display: flex;
  flex-direction: column;
  padding: var(--space-12) var(--space-10);
  background: var(--color-black);
  color: var(--color-gray-300);
}

.auth-brand hgroup {
  margin: 0;
}

.auth-brand .auth-eyebrow {
  margin-bottom: var(--space-4);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-yellow);
}

.auth-brand h1 {
  margin: 0 0 var(--space-5);
  font-size: var(--text-6xl);
  line-height: 0.92;
  color: var(--color-white);
}

.auth-brand .auth-lead {
  max-width: 23rem;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-gray-300);
}

.auth-perks {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: var(--space-10) 0 0;
  padding: 0;
  list-style: none;
}

.auth-perks li {
  position: relative;
  margin: 0;
  padding-left: var(--space-6);
  list-style: none;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-gray-400);
}

.auth-perks li::before {
  content: "";
  position: absolute;
  top: 0.4em;
  left: 0;
  width: var(--space-3);
  height: var(--space-3);
  background: var(--color-yellow);
}

.auth-perks strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-white);
}

/* 18px is the LEGO stud dimension, intentional */
.auth-studs {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-10);
}

.auth-studs span {
  width: 18px;
  height: 18px;
  background: var(--color-black-soft);
}

.auth-studs span:nth-child(3n + 1) {
  background: var(--color-yellow);
}

.auth-studs span:nth-child(3) {
  background: var(--color-coral);
}

.auth-form {
  display: flex;
  flex-direction: column;
  padding: var(--space-10) var(--space-12) var(--space-12);
}

.auth-tabs {
  display: flex;
  justify-content: flex-start;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--pico-card-border-color);
}

.auth-tabs a {
  margin-bottom: -1px;
  padding: var(--space-3) var(--space-1);
  border-bottom: 3px solid transparent;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--pico-muted-color);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.auth-tabs a:hover,
.auth-tabs a[aria-current="page"] {
  color: var(--checkout-text);
}

.auth-tabs a[aria-current="page"] {
  border-bottom-color: var(--color-yellow);
}

.auth-form-title {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--pico-card-border-color);
  font-size: var(--text-xl);
  letter-spacing: 0.02em;
}

.auth-form [type="submit"],
.auth-form > [role="button"] {
  width: 100%;
}

.auth-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-4);
  background: var(--color-black);
  color: var(--color-gray-300);
  font-size: var(--text-sm);
}

.auth-notice strong {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-yellow);
}

.auth-or {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-2) 0 var(--space-4);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pico-muted-color);
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--pico-card-border-color);
}

.auth-footnote {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--pico-muted-color);
}

@media (max-width: 767px) {
  .auth-shell {
    margin-top: var(--space-6);
  }

  .auth-brand {
    padding: var(--space-8) var(--space-6);
  }

  .auth-brand h1 {
    font-size: var(--text-4xl);
  }

  .auth-form {
    padding: var(--space-6);
  }
}

/* ----- Fields: a link under the field, password show/hide, strength ----- */
.field-aside {
  display: block;
  text-align: end;
}

.field-aside a {
  font-size: var(--text-xs);
}

.field-aside a,
.auth-footnote a {
  color: var(--pico-muted-color);
  text-decoration-color: currentColor;
}

.password-toggle {
  flex: 0 0 auto;
  padding-inline: var(--space-4);
  background: var(--pico-form-element-background-color);
  border: var(--pico-border-width) solid var(--pico-form-element-border-color);
  border-left: none;
  color: var(--pico-muted-color);
  font-family: var(--pico-font-family);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.password-toggle:hover {
  color: var(--pico-color);
}

.password-meter {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: calc(-0.5 * var(--pico-spacing)) 0 var(--pico-spacing);
}

.password-meter[hidden] {
  display: none;
}

.password-meter-bars {
  display: flex;
  gap: 3px;
}

.password-meter-bars span {
  width: var(--space-8);
  height: var(--space-2);
  background: var(--pico-card-border-color);
  transition: background-color var(--transition-fast);
}

.password-meter small {
  margin: 0;
  font-family: var(--pico-font-family-monospace);
  font-size: var(--text-xs);
  color: var(--pico-muted-color);
}

.password-meter[data-score="1"] .password-meter-bars span:nth-child(-n + 1) {
  background: var(--color-coral);
}

.password-meter[data-score="2"] .password-meter-bars span:nth-child(-n + 2) {
  background: var(--color-yellow);
}

.password-meter[data-score="3"] .password-meter-bars span:nth-child(-n + 3),
.password-meter[data-score="4"] .password-meter-bars span {
  background: var(--color-success);
}
