/* Storefront layout. Colours, type and radii come from theme.css tokens only. */

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--b-font);
  color: var(--b-text);
  background: var(--b-bg);
  line-height: 1.5;
}

a { color: var(--b-color-primary); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--b-bg); padding: 0.5rem 1rem; }

/* Visible focus for everything keyboard-reachable (WCAG 2.4.7). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--b-border-focus);
  outline-offset: 2px;
  box-shadow: var(--b-focus-ring);
}

.emblem { fill: var(--b-color-primary-light); stroke: var(--b-color-primary); stroke-width: 2; }

/* Header */
.site-header { border-bottom: 1px solid var(--b-border); background: var(--b-bg); }
.site-header__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.primary-nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.primary-nav a { color: var(--b-text); text-decoration: none; font-weight: 700; }
.primary-nav a:hover { color: var(--b-color-primary); }
.primary-nav__item--active > a { color: var(--b-color-primary); text-decoration: underline; text-underline-offset: 0.3em; }
.site-header__tools { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.site-header__icon { color: var(--b-text); text-decoration: none; }
/* Phone drawer (FEATURE-004 D14). On desktop the toggle and the panel's own box are gone, so nav, tools and cart are
   items of the header row as before. The cart used to sit inside the tools; to keep it wrapping with them, the tools
   reserve 7rem and the cart pulls itself back into it, 1rem after the tools as before. A line break counts the row's
   1.5rem gap, so the cart only never wraps alone while the reserve is at least its width plus 1rem — up to a
   five-character badge, since it counts metres ("12,25", FEATURE-001 D31). */
.nav-drawer__toggle { display: none; }
.nav-drawer__panel { display: contents; }
.site-header__tools { margin-right: 7rem; }
.site-header__cart { margin-left: calc(-7rem - 0.5rem); white-space: nowrap; }
.search-box { display: flex; gap: 0.25rem; }
.search-box input {
  font: inherit;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--b-border);
  border-radius: var(--b-radius-full);
}
.search-box button {
  font: inherit;
  border: 0;
  border-radius: var(--b-radius-full);
  padding: 0.35rem 0.9rem;
  background: var(--b-color-primary);
  color: var(--b-text-inverse);
  cursor: pointer;
}

/* Main */
main { max-width: 1240px; margin: 0 auto; padding: 2rem 1rem; }
.home-empty,
.error-page {
  background: var(--b-bg-tertiary);
  border-radius: var(--b-radius-lg);
  padding: 3rem 2rem;
  text-align: center;
}

/* CMS blocks — a CMS page's content and a category's landing content */
.cms-blocks { line-height: 1.6; }
.cms-blocks__image { margin: 1.5rem 0; }
.cms-blocks__image img { max-width: 100%; height: auto; border-radius: var(--b-radius-lg); }
.cms-blocks__image figcaption { color: var(--b-text-muted); font-size: 0.9em; }
.cms-blocks__quote { border-left: 4px solid var(--b-border); margin: 1.5rem 0; padding-left: 1rem; }
.cms-blocks__quote footer { color: var(--b-text-muted); }
.cms-blocks table { border-collapse: collapse; }
.cms-blocks th, .cms-blocks td { border: 1px solid var(--b-border); padding: 0.35rem 0.6rem; }

/* CMS page */
.cms-page { max-width: 760px; margin: 0 auto; }

/* Footer */
.site-footer { border-top: 1px solid var(--b-border); padding: 2rem 1rem; text-align: center; }
.footer-cms-links { display: flex; justify-content: center; align-items: center; gap: 3rem; }
.footer-cms-links ul { list-style: none; margin: 0; padding: 0; text-align: left; }
.footer-cms-links a { color: var(--b-text); text-decoration: none; }
.payment-logos,
.site-footer__copyright { color: var(--b-text-muted); }
.site-footer__seller { margin-bottom: 0; font-size: 0.875rem; }
/* A legal statement, so it keeps AA contrast inside the muted copyright line. */
.site-footer__vat { color: var(--b-text-secondary); }

/* Phone (FEATURE-004 D14). 720px is also PHONE_QUERY in client/src/islands/nav-drawer.ts. The panel opens under the
   header row (4.5rem + its 1px border), so the ☰ that closes it stays visible without JavaScript. */
@media (max-width: 720px) {
  .site-header__inner { height: 4.5rem; flex-wrap: nowrap; gap: 0.75rem; padding-block: 0; }
  .nav-drawer__toggle { display: block; }
  .nav-drawer__toggle summary {
    display: flex;
    padding: 0.5rem;
    border-radius: var(--b-radius-lg);
    color: var(--b-text);
    list-style: none;
    cursor: pointer;
  }
  .nav-drawer__toggle summary::-webkit-details-marker { display: none; }
  .nav-drawer__toggle[open] summary { background: var(--b-bg-tertiary); color: var(--b-color-primary); }
  .nav-drawer__icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .nav-drawer__toggle[open]::before {
    content: "";
    position: fixed;
    inset: calc(4.5rem + 1px) 0 0 0;
    background: var(--b-overlay-medium);
    z-index: var(--b-z-drawer-backdrop);
  }
  .nav-drawer__panel { display: none; }
  .nav-drawer__toggle[open] ~ .nav-drawer__panel {
    position: fixed;
    top: calc(4.5rem + 1px);
    bottom: 0;
    left: 0;
    z-index: var(--b-z-drawer);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: min(85vw, var(--b-drawer-width-sm));
    padding: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--b-bg);
    box-shadow: var(--b-shadow-lg);
  }
  .nav-drawer__panel:focus { outline: none; }
  body:has(.nav-drawer__toggle[open]) { overflow: hidden; }
  .nav-drawer__panel .primary-nav ul { flex-direction: column; gap: 0; }
  .nav-drawer__panel .primary-nav a { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--b-border); }
  .site-header__tools { margin: 0; flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .site-header__tools .site-header__icon { display: block; padding: 0.5rem 0; }
  .search-box input { flex: 1; min-width: 0; }
  .site-header__cart { margin-left: auto; }

  .footer-cms-links { flex-direction: column; gap: 1.5rem; }
  .emblem--footer { order: -1; }
  .footer-cms-links ul { display: flex; flex-direction: column; gap: 0.6rem; text-align: center; }
  .footer-cms-links a { display: inline-block; padding: 0.2rem 0; }
  .site-footer a,
  .site-footer p { overflow-wrap: anywhere; }
}
@media (max-width: 720px) and (prefers-reduced-motion: no-preference) {
  .nav-drawer__toggle[open] ~ .nav-drawer__panel { transition: translate var(--b-transition-slow); }
  @starting-style { .nav-drawer__toggle[open] ~ .nav-drawer__panel { translate: -100% 0; } }
}

/* Product card */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--b-bg);
  border-radius: var(--b-radius-lg);
  text-align: center;
}
.product-card__link { display: flex; flex-direction: column; gap: 0.75rem; color: var(--b-text); text-decoration: none; border-radius: var(--b-radius-lg); }
a.product-card__link:hover .product-card__name { color: var(--b-color-primary); }
.product-card__media {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--b-radius-lg);
  background: var(--b-bg-tertiary);
}
.product-card__image { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card__placeholder { display: block; width: 100%; height: 100%; }
.product-card__name { margin: 0; font-size: 1rem; font-weight: 700; }
.product-card--out-of-stock .product-card__media { opacity: 0.55; }
.product-card__stock { margin: 0; color: var(--b-text-secondary); font-size: 0.9em; }
.badge-new {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.2rem 0.7rem;
  border-radius: var(--b-radius-full);
  background: var(--b-color-primary);
  color: var(--b-text-inverse);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Price display */
.price-display { margin: 0; color: var(--b-text); font-weight: 700; }
.price-display__tax { margin-left: 0.35em; color: var(--b-text-secondary); font-size: 0.85em; font-weight: 400; }
.price-display--missing { color: var(--b-text-secondary); font-weight: 400; }

/* Breadcrumbs — FEATURE-001 D27. The separator is drawn, so a screen reader reads only the steps. */
.breadcrumbs { margin-bottom: 1rem; font-size: 0.9rem; color: var(--b-text-secondary); }
.breadcrumbs__items { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; list-style: none; margin: 0; padding: 0; }
.breadcrumbs__item { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; overflow-wrap: anywhere; }
.breadcrumbs__item + .breadcrumbs__item::before {
  content: "";
  flex: none;
  width: 0.4em;
  height: 0.4em;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.breadcrumbs a { color: var(--b-text); text-decoration: none; }
.breadcrumbs a:hover { color: var(--b-color-primary); text-decoration: underline; }

/* Category page */
.category-page { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }
.category-header { margin-bottom: 2rem; }
.category-header__title { margin: 0; font-size: 2rem; }
.category-header__description { margin: 0.75rem 0 0; max-width: 760px; line-height: 1.6; }
.category-page__landing { max-width: 760px; margin: 0 0 2rem; }

/* Product grid — 4 / 3 / 2 columns, so 12, 24 and 48 cards always fill their last row. */
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.product-grid--empty { display: block; color: var(--b-text-secondary); }
@media (max-width: 960px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; } }

/* Subcategory list — FEATURE-001 D26: the branch as a tree beside the products; on a phone only the current category's
   own subcategories, as pills (the path items dissolve with display: contents). A top category without subcategories
   has no list and keeps the grid above. */
.category-page__body--with-subcategories { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2rem; align-items: start; }
.category-page__body--with-subcategories .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.subcategory-list { padding-right: 1.5rem; border-right: 1px solid var(--b-border); }
.subcategory-list__title { margin: 0 0 0.75rem; font-size: 1rem; color: var(--b-text-secondary); font-weight: 400; }
.subcategory-list__tree,
.subcategory-list__children { list-style: none; margin: 0; padding: 0; }
.subcategory-list__children { margin-left: 0.5rem; padding-left: 0.5rem; border-left: 1px solid var(--b-bg-tertiary); }
.subcategory-list__link {
  display: block;
  padding: 0.35rem 0.6rem;
  border-left: 3px solid transparent;
  color: var(--b-text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.subcategory-list__item--top > .subcategory-list__link { padding-left: 0; font-weight: 700; }
.subcategory-list__link:hover { color: var(--b-color-primary); }
.subcategory-list__link[aria-current] { border-left-color: var(--b-color-primary); background: var(--b-bg-secondary); color: var(--b-color-primary-hover); font-weight: 700; }
@media (max-width: 960px) {
  .category-page__body--with-subcategories { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .subcategory-list { padding-right: 0; border-right: 0; }
  .subcategory-list--no-own { display: none; }
  .subcategory-list__item { display: none; }
  .subcategory-list__tree,
  .subcategory-list__item--open,
  .subcategory-list__item--open > .subcategory-list__children { display: contents; }
  .subcategory-list__item--open > .subcategory-list__link { display: none; }
  .subcategory-list__item--current > .subcategory-list__children {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .subcategory-list__item--current > .subcategory-list__children > .subcategory-list__item { display: block; }
  .subcategory-list__item--current > .subcategory-list__children .subcategory-list__link {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--b-border);
    border-radius: var(--b-radius-full);
    font-weight: 400;
  }
  .subcategory-list__item--current > .subcategory-list__children .subcategory-list__link:hover { border-color: var(--b-color-primary); }
}
@media (max-width: 640px) { .category-page__body--with-subcategories .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; }
.pagination__pages { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.pagination__page,
.pagination__step,
.pagination__size {
  display: inline-block;
  min-width: 2.5rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--b-border);
  border-radius: var(--b-radius-full);
  color: var(--b-text);
  text-align: center;
  text-decoration: none;
}
.pagination__page:hover,
.pagination__step:hover,
.pagination__size:hover { border-color: var(--b-color-primary); color: var(--b-color-primary); }
.pagination__page[aria-current],
.pagination__size[aria-current] { background: var(--b-color-primary); border-color: var(--b-color-primary); color: var(--b-text-inverse); }
.pagination__gap { padding: 0 0.25rem; color: var(--b-text-secondary); }
.pagination__sizes { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0; }
.pagination__sizes-label { margin-right: 0.25rem; color: var(--b-text-secondary); }

/* Cart page (P06, TASK-006 / TASK-019 / TASK-021): the lines full width, each on a lavender band; the coupon on the left
   and the totals on the right under them; then the actions. */
.cart-page { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.cart-page h1 { font-size: 1.75rem; margin: 0 0 1.5rem; }
.cart-page__error { color: var(--b-color-danger); font-weight: 600; }
.cart-page__cart { display: block; }
.cart-page__cart[aria-busy="true"] { opacity: 0.6; pointer-events: none; }
.cart-page__lines { display: flex; flex-direction: column; align-items: flex-end; gap: 1rem; }
.cart-page__recalculate,
.coupon-field__applied button {
  font: inherit; cursor: pointer; padding: 0.4rem 1.25rem; border-radius: var(--b-radius-full);
  border: 1px solid var(--ffs-slate); background: var(--b-bg); color: var(--ffs-slate);
}
.cart-page__recalculate:hover, .coupon-field__applied button:hover { background: var(--ffs-lavender-soft); }
.cart-page__summary {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: start;
  margin-top: 2rem; padding-bottom: 2rem; border-bottom: 2px solid var(--ffs-periwinkle);
}
.cart-page__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.cart-page__back {
  display: inline-block; min-width: 18rem; padding: 0.9rem 2rem; border-radius: var(--b-radius-full); text-align: center;
  background: var(--ffs-periwinkle); color: var(--b-text); font-weight: 700; text-decoration: none;
}
/* Dark text: white on periwinkle is about 2.6:1, under WCAG AA (CLAUDE.md § Accessibility bar). */
.cart-page__back:hover { background: var(--ffs-lavender); }
@media (max-width: 800px) { .cart-page__summary { grid-template-columns: minmax(0, 1fr); } .cart-page__back { min-width: 0; width: 100%; } }

.cart-lines { width: 100%; border-collapse: separate; border-spacing: 0 0.5rem; }
.cart-lines th { font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; color: var(--b-text); padding: 0 1rem; text-align: center; }
.cart-lines th:first-child { text-align: left; }
.cart-lines td { background: var(--ffs-lavender); padding: 1.25rem 1rem; text-align: center; vertical-align: middle; }
.cart-lines td:first-child { border-radius: var(--b-radius) 0 0 var(--b-radius); text-align: left; }
.cart-lines td:last-child { border-radius: 0 var(--b-radius) var(--b-radius) 0; }
.cart-lines__name { font-weight: 700; text-transform: uppercase; font-size: 0.9rem; }
.cart-lines__item { display: flex; align-items: center; gap: 1rem; }
.cart-lines__thumb { flex: none; width: 4rem; height: 4rem; object-fit: cover; border-radius: var(--b-radius); }
.cart-lines__variant { display: block; margin-top: 0.25rem; font-weight: 400; text-transform: none; font-size: 0.85rem; }
.cart-lines__code { white-space: nowrap; }
.cart-lines__code-label { display: none; }
.cart-lines__unit-price, .cart-lines__total { white-space: nowrap; font-weight: 700; }
.cart-lines__quantity-input {
  width: 5rem; padding: 0.6rem 0.5rem; border: 0; border-radius: var(--b-radius-full); background: var(--b-bg);
  font: inherit; font-weight: 700; text-align: center;
}
.cart-lines__remove { width: 3rem; }
.cart-lines__remove-button { background: none; border: 0; padding: 0.5rem; cursor: pointer; color: var(--ffs-slate); line-height: 0; border-radius: var(--b-radius-full); }
.cart-lines__remove-button:hover { color: var(--ffs-slate-dark); }
.cart-lines--compact td { padding: 0.75rem 1rem; }
.cart-lines__edit { margin: 0.5rem 0 0; }
/* A phone: each line is a card — name across the top, then quantity, total and remove. */
@media (max-width: 640px) {
  .cart-lines thead { display: none; }
  .cart-lines--full, .cart-lines--full tbody { display: block; }
  .cart-lines--full tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; background: var(--ffs-lavender); border-radius: var(--b-radius); margin-bottom: 0.5rem; }
  .cart-lines--full td { background: none; border-radius: 0; padding: 0.75rem; }
  .cart-lines--full .cart-lines__name { grid-column: 1 / -1; padding-bottom: 0; }
  .cart-lines--full .cart-lines__code { grid-column: 1 / -1; padding-bottom: 0; text-align: left; }
  .cart-lines--full .cart-lines__code:empty { display: none; }
  .cart-lines--full .cart-lines__code-label { display: inline; margin-right: 0.5rem; }
  .cart-lines--full .cart-lines__unit-price { display: none; }
  .cart-lines--full .cart-lines__quantity { text-align: left; }
}

.coupon-field__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; max-width: 24rem; }
.coupon-field__form label { grid-column: 1 / -1; margin-bottom: 0.5rem; color: var(--ffs-slate); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.coupon-field__form input {
  min-width: 0; padding: 0.6rem 1rem; font: inherit; border: 2px solid var(--ffs-slate); border-right: 0;
  border-radius: var(--b-radius-full) 0 0 var(--b-radius-full);
}
.coupon-field__form button {
  font: inherit; cursor: pointer; padding: 0.6rem 1.5rem; border: 0; color: var(--b-text-inverse); background: var(--ffs-slate);
  border-radius: 0 var(--b-radius-full) var(--b-radius-full) 0;
}
.coupon-field__form button:hover { background: var(--ffs-slate-dark); }
.coupon-field__applied { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.coupon-field__code { margin: 0; font-weight: 700; color: var(--ffs-slate); }
.coupon-field__error { color: var(--b-color-danger); margin: 0.5rem 0 0; }

.order-totals { margin: 0; }
.order-totals__row { display: flex; justify-content: space-between; gap: 1rem; font-size: 1.125rem; }
.order-totals__row dd { margin: 0; white-space: nowrap; }
.order-totals__row[data-total="discount"] { color: var(--ffs-slate); }
.order-totals__row--total { font-weight: 700; margin-top: 1.25rem; }
.order-totals__row--included { font-size: 0.875rem; color: var(--b-text-secondary); }
.order-totals__vat-note { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--b-text-secondary); text-align: right; }
.checkout-accepted__vat-note { font-size: 0.875rem; color: var(--b-text-secondary); }

/* hidden must win over the display the rules above give these elements. */
.cart-page [hidden] { display: none !important; }

/* Checkout (P07–P10, TASK-007 / TASK-016 / TASK-017 / TASK-018): the stepper across the top, then the step's form on the
   left and the side summary on the right; one column on a phone. */
.checkout-stepper { margin: 0 0 2rem; }
.checkout-stepper__steps { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; list-style: none; margin: 0; padding: 0; }
.checkout-stepper__item { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--b-text-muted); text-decoration: none; }
.checkout-stepper__number {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--b-radius-full);
  border: 2px solid var(--ffs-grey-light); font-weight: 700;
}
a.checkout-stepper__item { color: var(--ffs-slate); }
a.checkout-stepper__item:hover { text-decoration: underline; }
.checkout-stepper__step--done .checkout-stepper__number { border-color: var(--ffs-slate); }
.checkout-stepper__step--current .checkout-stepper__item { color: var(--b-text); font-weight: 700; }
.checkout-stepper__step--current .checkout-stepper__number { background: var(--ffs-slate); border-color: var(--ffs-slate); color: var(--b-text-inverse); }

.checkout-page { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.checkout-page h1 { font-size: 1.75rem; margin: 0 0 1.5rem; }
.checkout-page__error { color: var(--b-color-danger); font-weight: 600; }
.checkout-page [hidden] { display: none !important; }
.checkout-page__body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem 4rem; align-items: start; }
.checkout-page__form { display: flex; flex-direction: column; gap: 1.5rem; }
.checkout-page__field { display: flex; flex-direction: column; gap: 0.5rem; }
.checkout-page__label, .shipping-method-list__legend, .payment-method-list__legend, .address-form__legend {
  color: var(--ffs-slate); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
}
.checkout-page__select, .address-form__input, .phone-input__prefix {
  font: inherit; padding: 0.6rem 1rem; border: 2px solid var(--ffs-slate); border-radius: var(--b-radius-full); background: var(--b-bg);
}
.checkout-page__select { max-width: 24rem; }
.checkout-page__select:focus-visible, .address-form__input:focus-visible, .phone-input__prefix:focus-visible { outline: none; box-shadow: var(--b-focus-ring); }
.checkout-page__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1rem; }
.checkout-page__back, .checkout-page__next, .checkout-page__refresh, .cart-page__continue {
  display: inline-block; padding: 0.9rem 2rem; border-radius: var(--b-radius-full); text-align: center; font: inherit;
  font-weight: 700; text-decoration: none; cursor: pointer;
}
/* Dark text on periwinkle: white on it is about 2.6:1, under WCAG AA (CLAUDE.md § Accessibility bar). */
.checkout-page__back { background: var(--ffs-periwinkle); color: var(--b-text); border: 0; }
.checkout-page__back:hover { background: var(--ffs-lavender); }
.checkout-page__refresh { background: var(--b-bg); color: var(--ffs-slate); border: 1px solid var(--ffs-slate); }
.checkout-page__refresh:hover { background: var(--ffs-lavender-soft); }
.checkout-page__next, .cart-page__continue { background: var(--ffs-slate); color: var(--b-text-inverse); border: 0; margin-left: auto; }
.checkout-page__next:hover, .cart-page__continue:hover { background: var(--ffs-slate-dark); }
.checkout-page__place { text-transform: uppercase; letter-spacing: 0.02em; }
/* TASK-017: the order is on its way — a second click does nothing (ffs-place-order-button). */
ffs-place-order-button { display: contents; }
.checkout-page__place[aria-disabled="true"] { cursor: progress; opacity: 0.75; }
.checkout-page__place[aria-disabled="true"]:hover { background: var(--ffs-slate); }
@media (max-width: 900px) {
  .checkout-page__body { grid-template-columns: minmax(0, 1fr); }
  .checkout-page__back, .checkout-page__next, .checkout-page__refresh { width: 100%; margin-left: 0; }
}

.shipping-method-list, .payment-method-list, .address-form__group { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.shipping-method-list__legend, .payment-method-list__legend, .address-form__legend { margin-bottom: 0.75rem; padding: 0; }
.shipping-method-list__option, .payment-method-list__option {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.25rem 1rem;
  padding: 1rem 1.25rem; border-radius: var(--b-radius); background: var(--ffs-lavender); cursor: pointer;
}
.shipping-method-list__option:has(input:checked), .payment-method-list__option:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ffs-slate); }
.shipping-method-list__option:has(input:focus-visible), .payment-method-list__option:has(input:focus-visible) { box-shadow: var(--b-focus-ring); }
.shipping-method-list__name, .payment-method-list__name { font-weight: 700; }
.shipping-method-list__price, .payment-method-list__price { font-weight: 700; white-space: nowrap; }
.shipping-method-list__description, .payment-method-list__description, .shipping-method-list__threshold {
  grid-column: 2 / -1; color: var(--b-text-secondary); font-size: 0.9rem;
}
.payment-method-list__none { margin: 0; color: var(--b-color-danger); }

.address-form { display: flex; flex-direction: column; gap: 2rem; }
.address-form__field { display: flex; flex-direction: column; gap: 0.35rem; }
.address-form__label { font-weight: 600; }
.address-form__input[aria-invalid="true"] { border-color: var(--b-color-danger); }
.address-form__error { margin: 0; color: var(--b-color-danger); font-size: 0.9rem; }
.address-form__note { border-radius: var(--b-radius); resize: vertical; }
.address-form__country { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; }
.address-form__check { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
/* The billing fields belong to the checkbox: hidden while it is unticked, with no script (the server ignores them then). */
.address-form__billing:has(#billingDiffers:not(:checked)) .address-form__billing-fields { display: none; }
.address-form__billing-fields { display: flex; flex-direction: column; gap: 0.5rem; }
.phone-input__row { display: flex; gap: 0.5rem; }
.phone-input__number { flex: 1; min-width: 0; }
.phone-input__hint { margin: 0; color: var(--b-text-secondary); font-size: 0.9rem; }

.checkout-summary-aside { padding: 1.5rem; border-radius: var(--b-radius); background: var(--ffs-lavender-soft); }
.checkout-summary-aside__title { font-size: 1.25rem; margin: 0 0 1rem; }
.checkout-summary-aside .order-totals { margin-top: 1.5rem; }
.checkout-summary-aside .order-totals__row:not(.order-totals__row--included) { font-size: 1rem; }
.checkout-summary-aside[aria-busy="true"] .order-totals { opacity: 0.6; }
.checkout-summary-aside__note { margin: 1rem 0 0; color: var(--b-text-secondary); font-size: 0.9rem; }

.order-review { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem; }
.order-review__block { padding: 1.25rem; border-radius: var(--b-radius); background: var(--ffs-lavender); }
.order-review__title { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ffs-slate); margin: 0 0 0.75rem; }
.order-review__address { font-style: normal; margin-bottom: 0.75rem; }
.order-review__list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.25rem 1rem; margin: 0 0 0.75rem; }
.order-review__list dd { margin: 0; overflow-wrap: anywhere; }
.order-review__note { white-space: pre-line; }
.order-review__edit { color: var(--ffs-slate); font-weight: 600; }

.checkout-accepted__number { font-size: 1.25rem; font-weight: 700; }

/* Product page (P04, TASK-005): the gallery left, the buy box right; description and specification in a lavender band
   under them (D21, no tabs). */
.product-page { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.product-page__top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; align-items: start; margin-top: 1rem; }
@media (max-width: 800px) { .product-page__top { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }

.product-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.product-gallery__image { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--b-radius); background: var(--ffs-lavender); }
.product-gallery__image--main { grid-column: 1 / -1; aspect-ratio: 3 / 4; border-radius: var(--b-radius-lg); }

.buy-box { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
.buy-box[aria-busy="true"] .buy-box__add { opacity: 0.6; }
.buy-box__title { font-size: 1.75rem; margin: 0; }
.buy-box__line-price {
  margin: 0; padding: 0.25rem 3rem; border-radius: var(--b-radius-full); background: var(--ffs-lavender);
  font-size: 2.25rem; font-weight: 700; line-height: 1.3;
}
.buy-box .price-display { margin: 0; font-size: 0.95rem; }
.buy-box__teaser { margin: 0.5rem 0 0; max-width: 34rem; }
.buy-box__stock { margin: 0; font-weight: 700; color: var(--ffs-slate); }
.buy-box__stock--outofstock, .buy-box__stock--outofstockorderable { color: var(--b-text); }
.buy-box__form { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.buy-box__count {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 1rem; border-radius: var(--b-radius-full); background: var(--ffs-lavender);
}
.buy-box__count-label { font-size: 0.85rem; }
.buy-box__count-input {
  width: 4.5rem; padding: 0.4rem; border: 0; border-radius: var(--b-radius-full); background: var(--b-bg);
  font: inherit; font-weight: 700; text-align: center;
}
/* One width for every length a count can make ("= 10 000 m") and for none (an invalid count), so the pill never resizes
   and the add button never moves. */
.buy-box__length { font-weight: 700; white-space: nowrap; display: inline-block; min-width: 10ch; text-align: left; font-variant-numeric: tabular-nums; }
.buy-box__add {
  font: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer;
  padding: 0.75rem 2.5rem; border: 0; border-radius: var(--b-radius-full); background: var(--ffs-slate); color: var(--b-text-inverse);
}
.buy-box__add:hover { background: var(--ffs-slate-dark); }
.buy-box__add:disabled { background: var(--ffs-grey-light); color: var(--b-text); cursor: not-allowed; }
.buy-box__status { margin: 0; }
.buy-box__status--error { color: var(--b-color-danger); font-weight: 600; }

.variant-swatches__label { margin: 0.5rem 0; font-weight: 700; text-transform: uppercase; font-size: 0.85rem; }
/* P04: colour tiles, four to a row, each a link to the colour's address. A colour with neither image nor colour shows
   its name instead, in a tile that grows to fit it. */
.variant-swatches__items {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; max-width: calc(4 * 3.5rem + 3 * 0.6rem);
  list-style: none; margin: 0 auto; padding: 0;
}
.variant-swatches__item {
  position: relative; display: flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem;
  border: 2px solid var(--ffs-lavender); border-radius: var(--b-radius-lg); overflow: hidden;
  color: var(--b-text); text-decoration: none;
}
.variant-swatches__item--text { width: auto; min-width: 3.5rem; height: auto; min-height: 3.5rem; padding: 0 0.5rem; }
.variant-swatches__item:hover { border-color: var(--ffs-periwinkle); }
.variant-swatches__item[aria-current="true"] { border-color: var(--ffs-slate); font-weight: 700; }
.variant-swatches__tile { position: absolute; inset: 2px; border-radius: var(--b-radius); background: var(--swatch-colour, var(--ffs-lavender)); overflow: hidden; }
.variant-swatches__tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.variant-swatches__name { font-size: 0.75rem; text-align: center; overflow-wrap: anywhere; padding: 0.15rem; }
.variant-swatches__item--unavailable .variant-swatches__tile, .variant-swatches__item--unavailable .variant-swatches__name { opacity: 0.55; }
.variant-swatches__item--unavailable::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, transparent 46%, var(--b-bg) 46% 48.5%, var(--ffs-slate) 48.5% 51.5%, var(--b-bg) 51.5% 54%, transparent 54%);
}
.fabric-length-hint { margin: 0; font-size: 0.9rem; max-width: 34rem; }

.product-page__more { margin-top: 3rem; padding: 2rem; border-radius: var(--b-radius-lg); background: var(--ffs-lavender); display: grid; gap: 2rem; }
.product-page__more h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
.product-page__description p { margin: 0 0 0.75rem; max-width: 46rem; }
.product-details__list { margin: 0; display: grid; gap: 0.35rem; }
.product-details__row { display: flex; gap: 0.5rem; }
.product-details__row dt { font-weight: 700; }
.product-details__row dd { margin: 0; }

/* hidden must win over the display the rules above give these elements. */
.product-page [hidden] { display: none !important; }

/* Home (P00). Server-rendered scrollers until b-carousel (TASK-010) adds arrows, dots and autoplay. */
.hero-carousel { margin: -2rem -1rem 2rem; }
.hero-carousel__track, .product-carousel__track, .category-tiles__track {
  display: grid; grid-auto-flow: column; overflow-x: auto; scroll-snap-type: x mandatory;
  list-style: none; margin: 0; padding: 0;
}
.hero-carousel__track { grid-auto-columns: 100%; }
.hero-carousel__track:focus-visible, .product-carousel__track:focus-visible, .category-tiles__track:focus-visible { outline: none; box-shadow: var(--b-focus-ring); }
.hero-carousel__slide { position: relative; scroll-snap-align: start; aspect-ratio: 16 / 6; min-height: 16rem; background: var(--ffs-lavender); display: grid; align-items: end; }
.hero-carousel__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-carousel__text {
  position: relative; margin: 0 0 2.5rem 2.5rem; max-width: 36rem; padding: 1.25rem 1.5rem; border-radius: var(--b-radius);
  background: color-mix(in srgb, var(--ffs-slate-dark) 82%, transparent); color: var(--ffs-white);
}
.hero-carousel__title { margin: 0; font-size: 2rem; text-transform: uppercase; letter-spacing: 0.04em; }
.hero-carousel__subtitle { margin: 0.5rem 0 0; }
.hero-carousel__link {
  display: inline-block; margin-top: 1rem; padding: 0.6rem 1.5rem; border-radius: var(--b-radius-full);
  background: var(--ffs-white); color: var(--ffs-ink); font-weight: 700; text-decoration: none;
}
.hero-carousel__link:hover { background: var(--ffs-lavender); }
@media (max-width: 640px) {
  .hero-carousel__slide { aspect-ratio: 4 / 3; }
  .hero-carousel__text { margin: 0 1rem 1.5rem; }
  .hero-carousel__title { font-size: 1.4rem; }
}

.usp-tiles { margin: 0 0 3rem; }
.usp-tiles__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; list-style: none; margin: 0; padding: 0; text-align: center; }
.usp-tiles__tile img { width: 5rem; height: 5rem; border-radius: var(--b-radius-full); object-fit: cover; background: var(--ffs-lavender); }
.usp-tiles__tile p { margin: 0.5rem 0 0; }
@media (max-width: 640px) { .usp-tiles__list { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }

.product-carousel { background: var(--ffs-lavender); border-radius: var(--b-radius-lg); padding: 2rem 1.5rem; margin: 0 0 3rem; }
.product-carousel__title { margin: 0 0 1.5rem; text-align: center; text-transform: uppercase; letter-spacing: 0.04em; }
.product-carousel__track { grid-auto-columns: calc((100% - 3 * 1.5rem) / 4); gap: 1.5rem; padding-bottom: 0.5rem; }
.product-carousel__item { scroll-snap-align: start; }
@media (max-width: 960px) { .product-carousel__track { grid-auto-columns: calc((100% - 2 * 1.5rem) / 3); } }
@media (max-width: 640px) { .product-carousel__track { grid-auto-columns: 70%; gap: 1rem; } }
.category-tiles { background: var(--ffs-lavender); border-radius: var(--b-radius-lg); padding: 2rem 1.5rem; margin: 0 0 3rem; }
.category-tiles__title { margin: 0 0 1.5rem; text-align: center; text-transform: uppercase; letter-spacing: 0.04em; }
.category-tiles__track { grid-auto-columns: 10rem; gap: 1.5rem; justify-content: safe center; padding-bottom: 0.5rem; }
.category-tiles__item { scroll-snap-align: start; }
.category-tiles__tile { display: grid; justify-items: center; gap: 0.75rem; color: var(--b-text); text-decoration: none; text-align: center; }
.category-tiles__image { width: 10rem; height: 10rem; border-radius: var(--b-radius-full); object-fit: cover; background: var(--ffs-white); }
.category-tiles__tile:hover .category-tiles__name { text-decoration: underline; }
@media (max-width: 640px) { .category-tiles__track { grid-auto-columns: 7.5rem; gap: 1rem; } .category-tiles__image { width: 7.5rem; height: 7.5rem; } }
@media (prefers-reduced-motion: no-preference) { .hero-carousel__track, .product-carousel__track, .category-tiles__track { scroll-behavior: smooth; } }

/* order-confirmation (P10): how to pay a bank transfer, FEATURE-002 D8 */
.order-payment { margin: 1.5rem 0; padding: 1.25rem; border-radius: var(--b-radius); background: var(--ffs-lavender); }
.order-payment__title { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ffs-slate); margin: 0 0 0.75rem; }
.order-payment__body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.5rem; }
.order-payment__list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.35rem 1rem; margin: 0; flex: 1 1 18rem; }
.order-payment__list dt { color: var(--b-text-secondary); }
.order-payment__list dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.order-payment__symbol, .order-payment__amount { font-weight: 700; }
.order-payment__qr { margin: 0; flex: 0 0 auto; text-align: center; max-width: 12rem; }
.order-payment__code { width: 10rem; height: 10rem; margin: 0 auto 0.5rem; padding: 0.25rem; background: var(--ffs-white); border-radius: var(--b-radius); }
.order-payment__code svg { display: block; width: 100%; height: 100%; }
.order-payment__qr figcaption { font-size: 0.875rem; }

/* order tracking (FEATURE-003 D2) */
.order-track__body { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.order-track__block { padding: 1.25rem; border-radius: var(--b-radius); background: var(--ffs-lavender); }
.order-track__title { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ffs-slate); margin: 0 0 0.75rem; }
.order-track__list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.35rem 1rem; margin: 0; }
.order-track__list dt { color: var(--b-text-secondary); }
.order-track__list dd { margin: 0; overflow-wrap: anywhere; }
.order-track__address-line { display: block; }
.order-track__lines { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-variant-numeric: tabular-nums; }
.order-track__lines th, .order-track__lines td { text-align: left; padding: 0.35rem 0.5rem 0.35rem 0; vertical-align: top; }
.order-track__lines th { font-size: 0.875rem; color: var(--b-text-secondary); font-weight: 600; }
.order-track__lines td:nth-child(n+2), .order-track__lines th:nth-child(n+2) { text-align: right; white-space: nowrap; }
.order-track__ended { padding: 0.75rem 1rem; border-radius: var(--b-radius); background: var(--ffs-lavender); font-weight: 700; }
.order-status-steps { display: flex; list-style: none; margin: 1.5rem 0 0; padding: 0; gap: 0.5rem; }
.order-status-steps__step { flex: 1 1 0; position: relative; padding-top: 1.75rem; text-align: center; color: var(--b-text-secondary); }
.order-status-steps__step::before { content: ""; position: absolute; top: 0.25rem; left: 50%; width: 1rem; height: 1rem; margin-left: -0.5rem; border-radius: 50%; border: 2px solid var(--ffs-grey-light); background: var(--b-bg); }
.order-status-steps__step + .order-status-steps__step::after { content: ""; position: absolute; top: 0.7rem; right: calc(50% + 0.75rem); width: calc(100% - 1rem); height: 2px; background: var(--ffs-grey-light); }
.order-status-steps__step--done { color: var(--b-text); }
.order-status-steps__step--done::before { border-color: var(--ffs-slate); background: var(--ffs-slate); }
.order-status-steps__step--done + .order-status-steps__step--done::after { background: var(--ffs-slate); }
.order-status-steps__step[aria-current="step"] .order-status-steps__label { font-weight: 700; }
.order-status-steps__label, .order-status-steps__date { display: block; }
.order-status-steps__date { font-size: 0.875rem; }
@media (max-width: 520px) {
  .order-status-steps { flex-direction: column; gap: 0.75rem; }
  .order-status-steps__step { padding: 0 0 0 1.75rem; text-align: left; }
  .order-status-steps__step::before { left: 0; margin-left: 0; }
  .order-status-steps__step + .order-status-steps__step::after { display: none; }
}

/* Pre-launch holding page (FEATURE-012) */
.pre-launch { min-height: 100vh; display: flex; flex-direction: column; background: var(--b-bg-secondary); }
.pre-launch__header { padding: 1.5rem 1rem; text-align: center; }
.pre-launch__brand { margin: 0; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.04em; color: var(--b-color-primary); }
.pre-launch__main { flex: 1; width: 100%; max-width: 40rem; margin: 0 auto; padding: 0 1rem 2rem; }
.pre-launch__intro { background: var(--b-bg-tertiary); border-radius: var(--b-radius-lg); padding: 2rem 1.5rem; text-align: center; margin-bottom: 1.5rem; }
.pre-launch__intro h1 { margin: 0 0 0.75rem; font-size: 1.7rem; color: var(--b-color-primary-hover); }
.pre-launch__intro p { margin: 0; color: var(--b-text-secondary); line-height: 1.55; }
.pre-launch__card { background: var(--b-bg); border-radius: var(--b-radius-lg); padding: 1.5rem; text-align: center; }
.pre-launch__card h2 { margin: 0 0 0.75rem; font-size: 1.2rem; }
.pre-launch__card p { color: var(--b-text-secondary); }
.pre-launch__mail { font-weight: 700; color: var(--b-color-primary-hover); }
.pre-launch__footer { text-align: center; padding: 1.5rem 1rem; font-size: 0.85rem; color: var(--b-text-secondary); }
.pre-launch__footer p { margin: 0.25rem 0; }
