/* ==========================================================================
   QuidBuys theme - modelled on Shopify's Dawn
   Light, typographic, generous whitespace, square corners, black CTAs.
   No external requests: fonts fall back to a system stack so the page has
   zero third-party dependencies to muddy performance testing.
   ========================================================================== */

:root {
  --font-body: "Assistant", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);

  --color-text: 18, 18, 18;
  --color-background: 255, 255, 255;
  --color-foreground-alt: 115, 115, 115;
  --color-border: 18, 18, 18;
  --color-accent: 18, 18, 18;
  --color-accent-contrast: 255, 255, 255;
  --color-sale: 179, 27, 27;
  --color-success: 22, 101, 52;
  --color-shade: 246, 246, 246;

  /* Secondary text floor. #121212 at 0.62 alpha on white is 4.52:1, just over
     the WCAG 1.4.3 AA bar for body text; 0.64 leaves a little headroom. Every
     muted colour resolves through this rather than picking its own alpha,
     because an audit found six shades between 0.45 and 0.55 that all failed. */
  --color-muted: rgba(var(--color-text), 0.64);

  --border-subtle: 1px solid rgba(var(--color-border), 0.08);
  --border-strong: 1px solid rgba(var(--color-border), 0.55);

  --page-width: 1200px;
  --page-gutter: 1.25rem;
  --section-gap: 4.5rem;

  --buttons-radius: 0;
  --inputs-radius: 0;

  --duration-short: 120ms;
  --duration-default: 220ms;
  --easing: cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
  --focus-ring: 2px solid rgb(var(--color-text));
}

@media (min-width: 750px) {
  :root {
    --page-gutter: 2.5rem;
    --section-gap: 6rem;
  }
}

/* --------------------------------------------------------------- reset --- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: rgb(var(--color-text));
  background: rgb(var(--color-background));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
  cursor: pointer;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ typography - */

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.1em; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.text-muted { color: rgba(var(--color-text), 0.62); }
.text-sale { color: rgb(var(--color-sale)); }
.text-small { font-size: 0.875rem; }

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: rgb(var(--color-background));
  border: var(--border-strong);
}
.skip-link:focus { top: 1rem; }

/* ---------------------------------------------------------------- layout - */

.page-width {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.page-width--narrow { max-width: 780px; }

.section { margin-block: var(--section-gap); }
.section--tight { margin-block: 2.5rem; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.section-header h2 { margin: 0; }

.link-arrow {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

/* --------------------------------------------------------------- buttons - */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.875rem;
  padding: 0.6rem 1.75rem;
  border: 1px solid rgb(var(--color-accent));
  border-radius: var(--buttons-radius);
  background: rgb(var(--color-accent));
  color: rgb(var(--color-accent-contrast));
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: opacity var(--duration-short) var(--easing);
}

.button:hover { opacity: 0.82; }

.button--secondary {
  background: transparent;
  color: rgb(var(--color-text));
}

.button--full { width: 100%; }

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------------------------------------------------------------- header - */

.announcement {
  background: rgb(var(--color-text));
  color: rgb(var(--color-background));
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0.6rem 1rem;
}

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgb(var(--color-background));
  border-bottom: var(--border-subtle);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4.25rem;
}

.header__logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
}

.header__logo span { color: rgba(var(--color-text), 0.45); }

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: none;
  position: relative;
}

.header__icon svg { width: 20px; height: 20px; }

.cart-count {
  position: absolute;
  top: 0.35rem;
  right: 0.3rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: rgb(var(--color-text));
  color: rgb(var(--color-background));
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
}

/* --- primary nav + mega menu --- */

/* Desktop/mobile nav swap lives at the end of this section, after
   .header__menu-toggle is defined, so the media query is not overridden by a
   later same-specificity rule. */
.nav {
  display: none;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__item { position: relative; }

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 1.4rem 0.85rem;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav__link:hover { text-decoration: underline; }

.nav__item--has-children:hover .nav__panel,
.nav__item--has-children:focus-within .nav__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 15rem;
  padding: 1.25rem;
  background: rgb(var(--color-background));
  border: var(--border-subtle);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--duration-default) var(--easing),
    transform var(--duration-default) var(--easing),
    visibility var(--duration-default);
}

.nav__panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.15rem;
}

.nav__panel a {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  text-decoration: none;
}

.nav__panel a:hover { text-decoration: underline; }

/* --- mobile drawer --- */

.header__menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: none;
  margin-left: calc(var(--page-gutter) * -0.5);
}

/* Above 990px the inline nav replaces the drawer trigger. */
@media (min-width: 990px) {
  .nav { display: block; }
  .header__menu-toggle { display: none; }
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.drawer[open],
.drawer.is-open { display: block; }

.drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.drawer__panel {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: min(22rem, 88vw);
  background: rgb(var(--color-background));
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.drawer__panel--end {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: var(--border-subtle);
  margin-bottom: 0.5rem;
}

.drawer__close {
  border: 0;
  background: none;
  padding: 0.5rem;
  margin: -0.5rem;
}

.drawer__nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.drawer__nav > ul > li { border-bottom: var(--border-subtle); }

.drawer__nav a {
  display: block;
  padding: 0.85rem 0;
  text-decoration: none;
  font-size: 1rem;
}

.drawer__nav ul ul {
  padding-bottom: 0.5rem;
}

.drawer__nav ul ul a {
  padding: 0.4rem 0 0.4rem 1rem;
  font-size: 0.9rem;
  color: rgba(var(--color-text), 0.72);
}

/* --- search --- */

.search-form {
  display: flex;
  align-items: stretch;
  border: var(--border-strong);
  border-radius: var(--inputs-radius);
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0.7rem 0.9rem;
  font: inherit;
  background: transparent;
  color: inherit;
}

.search-form input:focus { outline: none; }

.search-form button {
  border: 0;
  background: none;
  padding: 0 0.9rem;
  display: inline-flex;
  align-items: center;
}

/* ----------------------------------------------------------- breadcrumbs - */

.breadcrumbs {
  padding-block: 1.1rem;
  font-size: 0.82rem;
  color: rgba(var(--color-text), 0.62);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li::after {
  content: "/";
  margin-left: 0.4rem;
  color: var(--color-muted);
}

.breadcrumbs li:last-child::after { content: none; }

.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: rgb(var(--color-text)); }

/* ------------------------------------------------------------------ hero - */

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(78vh, 620px);
  padding: 4rem 0;
  background: rgb(var(--color-shade));
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__media svg { width: 100%; height: 100%; }

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 34rem;
}

.hero__content h1 { margin-bottom: 0.5rem; }

.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* ------------------------------------------------------------ usp strip -- */

.usp {
  display: grid;
  gap: 1.5rem;
  padding-block: 2.5rem;
  border-block: var(--border-subtle);
  text-align: center;
}

@media (min-width: 750px) {
  .usp { grid-template-columns: repeat(3, 1fr); }
}

.usp h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.usp p { margin: 0; font-size: 0.9rem; color: rgba(var(--color-text), 0.62); }

/* --------------------------------------------------------- product grid -- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 750px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1.25rem; }
}

@media (min-width: 990px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: rgb(var(--color-shade));
}

.card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--easing), opacity 300ms var(--easing);
}

/* Second colourway, revealed on hover. Kept in the DOM rather than swapped by
   script so it is a real crawlable image reference. */
.card__image--hover {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.card:hover .card__image { transform: scale(1.02); }
.card:hover .card__image--hover { opacity: 1; }

@media (hover: none) {
  .card__image--hover { display: none; }
}

.card__badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.2rem 0.55rem;
  background: rgb(var(--color-sale));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card__badge--soldout {
  background: rgba(var(--color-text), 0.75);
}

.card__info { padding-top: 0.7rem; }

.card__vendor {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.15rem;
}

.card__title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 0.3rem;
}

.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; }

.card__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.95rem;
}

.card__price del {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.card__price ins {
  text-decoration: none;
  color: rgb(var(--color-sale));
  font-weight: 600;
}

.card__rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* #d4a017 measured 2.38:1 on white, well under the 4.5:1 AA bar. #8a6508 is
   5.32:1 on white and 4.92:1 on the card shade, and still reads as gold.
   Sized well above the surrounding text: at 0.78rem the glyphs were too small
   to count at a glance, which is the only thing a card rating is for. */
.card__stars {
  color: #8a6508;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.08em;
}

.card__rating-count { font-size: 0.85rem; }

.card__swatches {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0.5rem 0 0;
}

.swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1px solid rgba(var(--color-text), 0.22);
  flex: none;
}

.card__swatch-more {
  font-size: 0.72rem;
  color: var(--color-muted);
  margin-left: 0.1rem;
}

/* -------------------------------------------------- collection listing --- */

.collection-header {
  padding-block: 1.5rem 2rem;
  max-width: 44rem;
}

.collection-header h1 { margin-bottom: 0.4rem; }
.collection-header p { color: rgba(var(--color-text), 0.66); margin: 0; }

.collection-layout {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 990px) {
  .collection-layout {
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 3rem;
  }
}

.collection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: var(--border-subtle);
  margin-bottom: 1.5rem;
}

.collection-count {
  font-size: 0.875rem;
  color: rgba(var(--color-text), 0.62);
}

.sort-select {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.sort-select select {
  font: inherit;
  font-size: 0.875rem;
  padding: 0.45rem 2rem 0.45rem 0.65rem;
  border: var(--border-subtle);
  border-radius: var(--inputs-radius);
  background: rgb(var(--color-background));
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23121212' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 10px 6px;
}

/* --- facets --- */

/* As with the header nav, the desktop swap is declared after .facets-toggle. */
.facets { display: none; }

.facets__group {
  border-bottom: var(--border-subtle);
  padding-block: 0.35rem;
}

.facets__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.facets__summary::-webkit-details-marker { display: none; }

.facets__summary::after {
  content: "";
  width: 10px;
  height: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23121212' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat center;
  transition: transform var(--duration-short) var(--easing);
}

details[open] > .facets__summary::after { transform: rotate(180deg); }

.facets__list {
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.1rem;
  max-height: 16rem;
  overflow-y: auto;
}

.facet-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0;
  font-size: 0.875rem;
  text-decoration: none;
  color: rgba(var(--color-text), 0.85);
}

.facet-option:hover { color: rgb(var(--color-text)); }

.facet-option__box {
  flex: none;
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(var(--color-text), 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.facet-option[aria-pressed="true"] .facet-option__box {
  background: rgb(var(--color-text));
  border-color: rgb(var(--color-text));
}

.facet-option[aria-pressed="true"] .facet-option__box::after {
  content: "";
  width: 0.55rem;
  height: 0.3rem;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.facet-option__count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--color-muted);
}

.facet-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.facet-price input {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: var(--border-subtle);
  border-radius: var(--inputs-radius);
  font: inherit;
  font-size: 0.85rem;
}

.active-facets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.active-facet {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.6rem;
  border: var(--border-subtle);
  font-size: 0.8rem;
  text-decoration: none;
  background: rgb(var(--color-shade));
}

.active-facet::after {
  content: "\00d7";
  font-size: 1rem;
  line-height: 1;
  color: var(--color-muted);
}

.facets-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: var(--border-subtle);
  background: none;
  font-size: 0.875rem;
}

/* Above 990px the sidebar is always open and the drawer trigger is redundant. */
@media (min-width: 990px) {
  .facets { display: block; }
  .facets-toggle { display: none; }
}

/* ------------------------------------------------------------ pagination - */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.5rem;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.pagination a:hover { border-color: rgba(var(--color-text), 0.2); }

.pagination [aria-current="page"] {
  border-color: rgb(var(--color-text));
  font-weight: 600;
}

.pagination__gap { color: var(--color-muted); }

/* ---------------------------------------------------------------- product - */

.product {
  display: grid;
  gap: 2rem;
  padding-block: 1rem 3rem;
}

@media (min-width: 990px) {
  .product {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 4rem;
    align-items: start;
  }
}

.product__gallery {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 750px) {
  .product__gallery {
    grid-template-columns: 5rem minmax(0, 1fr);
    align-items: start;
  }
  .product__thumbs { order: -1; }
}

.product__main-image {
  background: rgb(var(--color-shade));
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.product__main-image img { width: 100%; height: 100%; object-fit: cover; }

.product__thumbs {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
}

@media (min-width: 750px) {
  .product__thumbs { flex-direction: column; overflow: visible; }
}

.product__thumb {
  flex: none;
  width: 4.25rem;
  aspect-ratio: 4 / 5;
  border: 1px solid transparent;
  background: rgb(var(--color-shade));
  padding: 0;
  overflow: hidden;
}

.product__thumb img { width: 100%; height: 100%; object-fit: cover; }
.product__thumb[aria-current="true"] { border-color: rgb(var(--color-text)); }

.product__info { max-width: 32rem; }

.product__vendor {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
}

.product__title { margin: 0.4rem 0 0.6rem; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }

.product__price {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 1.35rem;
  margin-bottom: 0.3rem;
}

.product__price del { font-size: 1rem; color: var(--color-muted); }
.product__price ins { text-decoration: none; color: rgb(var(--color-sale)); }

.product__tax-note {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.product__option { margin-bottom: 1.35rem; }

.product__option-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
}

.product__option-label span { font-weight: 400; color: var(--color-muted); }

.option-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.option-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.85rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(var(--color-text), 0.25);
  font-size: 0.875rem;
  text-decoration: none;
  transition: border-color var(--duration-short) var(--easing);
}

.option-value:hover { border-color: rgba(var(--color-text), 0.6); }

.option-value[aria-current="true"] {
  border-color: rgb(var(--color-text));
  box-shadow: inset 0 0 0 1px rgb(var(--color-text));
  font-weight: 600;
}

.option-value--unavailable {
  color: var(--color-muted);
  text-decoration: line-through;
  border-style: dashed;
}

.product__form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.quantity {
  display: inline-flex;
  align-items: center;
  border: var(--border-strong);
  width: fit-content;
}

.quantity button {
  width: 2.5rem;
  height: 2.75rem;
  border: 0;
  background: none;
  font-size: 1.1rem;
}

.quantity input {
  width: 3rem;
  height: 2.75rem;
  border: 0;
  text-align: center;
  font: inherit;
  background: transparent;
}

.product__stock {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: rgb(var(--color-success));
  margin-bottom: 1rem;
}

.product__stock::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.product__stock--out { color: var(--color-muted); }

.accordion {
  border-top: var(--border-subtle);
}

.accordion details { border-bottom: var(--border-subtle); }

.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.accordion summary::-webkit-details-marker { display: none; }

.accordion summary::after {
  content: "+";
  font-size: 1.1rem;
  font-weight: 400;
}

.accordion details[open] summary::after { content: "\2212"; }

.accordion__body { padding-bottom: 1.25rem; font-size: 0.925rem; }
.accordion__body :last-child { margin-bottom: 0; }

.spec-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.9rem;
}

.spec-list div { display: flex; gap: 0.5rem; }
.spec-list dt { color: var(--color-muted); min-width: 7rem; }
.spec-list dd { margin: 0; }

/* ------------------------------------------------------------------ rte --- */

.rte { font-size: 1rem; }
.rte h2 { margin-top: 1.8em; }
.rte h3 { margin-top: 1.5em; }
.rte ul, .rte ol { padding-left: 1.25rem; margin-bottom: 1.1em; }
.rte li { margin-bottom: 0.35em; }
.rte a { text-decoration: underline; }
.rte blockquote {
  margin: 1.5em 0;
  padding-left: 1.25rem;
  border-left: 2px solid rgba(var(--color-text), 0.2);
  color: rgba(var(--color-text), 0.75);
}
.rte table { width: 100%; border-collapse: collapse; margin-bottom: 1.25em; font-size: 0.9rem; }
.rte th, .rte td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: var(--border-subtle); }
.rte th { font-weight: 600; }

/* ----------------------------------------------------------------- blog --- */

.article-grid {
  display: grid;
  gap: 2rem 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  background: rgb(var(--color-shade));
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.article-card__media img { width: 100%; height: 100%; object-fit: cover; }
.article-card h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.article-card h3 a { text-decoration: none; }
.article-card h3 a:hover { text-decoration: underline; }
.article-card p { font-size: 0.9rem; color: rgba(var(--color-text), 0.65); margin-bottom: 0.4rem; }

.article-meta {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.article-hero { padding-block: 1rem 2rem; max-width: 46rem; }
.article-hero h1 { margin-block: 0.5rem; }
.article-body { max-width: 46rem; }
.article-body img { margin-block: 1.75rem; }

/* ---------------------------------------------------------- collection ---- */

.collection-cards {
  display: grid;
  gap: 1.5rem 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.collection-card__media {
  display: block;
  aspect-ratio: 3 / 4;
  background: rgb(var(--color-shade));
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.collection-card__media img { width: 100%; height: 100%; object-fit: cover; }
.collection-card h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.collection-card h3 a { text-decoration: none; }
.collection-card h3 a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------- cart --- */

.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 600;
  padding-bottom: 0.85rem;
  border-bottom: var(--border-subtle);
}
.cart-table td { padding-block: 1.15rem; border-bottom: var(--border-subtle); vertical-align: top; }
.cart-item { display: flex; gap: 1rem; }
.cart-item img { width: 4.5rem; flex: none; background: rgb(var(--color-shade)); }
.cart-item__title { font-size: 0.95rem; margin: 0 0 0.2rem; }
.cart-item__meta { font-size: 0.82rem; color: var(--color-muted); }

.cart-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  padding-top: 1.5rem;
}

.cart-subtotal { font-size: 1.1rem; font-weight: 600; }

.notice {
  padding: 0.9rem 1.1rem;
  background: rgb(var(--color-shade));
  border-left: 3px solid rgba(var(--color-text), 0.4);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------- empty ---- */

.empty-state {
  text-align: center;
  padding-block: 4rem;
  max-width: 30rem;
  margin-inline: auto;
}

/* ---------------------------------------------------------------- footer -- */

.footer {
  margin-top: var(--section-gap);
  border-top: var(--border-subtle);
  padding-block: 3rem 2rem;
  background: rgb(var(--color-background));
}

.footer__grid {
  display: grid;
  gap: 2.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  padding-bottom: 2.5rem;
}

.footer__newsletter { grid-column: 1 / -1; max-width: 26rem; }

@media (min-width: 990px) {
  .footer__newsletter { grid-column: auto; max-width: none; }
}

.footer h2 {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.footer a { font-size: 0.9rem; text-decoration: none; color: rgba(var(--color-text), 0.72); }
.footer a:hover { color: rgb(var(--color-text)); text-decoration: underline; }

.newsletter-form { display: flex; gap: 0.5rem; margin-top: 0.85rem; }
.newsletter-form input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.8rem;
  border: var(--border-strong);
  border-radius: var(--inputs-radius);
  font: inherit;
  font-size: 0.9rem;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.75rem;
  border-top: var(--border-subtle);
  font-size: 0.82rem;
  color: var(--color-muted);
}

/* ------------------------------------------------- localisation selector -- */

/* Seventeen markets will not fit a <select>, so this is a disclosure grouped
   by region. Every option is a real link, which keeps the whole market cluster
   crawlable from any page rather than relying on the hreflang tags alone. */

.localisation { position: relative; }

.localisation > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  border: var(--border-subtle);
  font-size: 0.85rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.localisation > summary::-webkit-details-marker { display: none; }
.localisation > summary:hover { border-color: rgba(var(--color-text), 0.35); }
.localisation[open] > summary svg { transform: rotate(180deg); }
.localisation > summary svg { transition: transform var(--duration-short) var(--easing); }

.localisation__flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.1rem 0.25rem;
  border-radius: 2px;
  background: rgba(var(--color-text), 0.08);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.localisation__panel {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  z-index: 30;
  width: min(40rem, calc(100vw - 2rem));
  padding: 1.25rem;
  background: rgb(var(--color-background));
  border: var(--border-subtle);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  max-height: 60vh;
  overflow-y: auto;
}

.localisation--drawer .localisation__panel {
  position: static;
  width: auto;
  border: 0;
  box-shadow: none;
  padding: 0.75rem 0 0;
}

.localisation__group h3 {
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.6rem;
}

.localisation__group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; }

.localisation__group a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem;
  margin-inline: -0.4rem;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 3px;
}

.localisation__group a:hover { background: rgb(var(--color-shade)); }
.localisation__group a[aria-current="true"] { font-weight: 600; }

.localisation__currency {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.footer__copyright { margin: 0; }

/* ------------------------------------------------------- mega menu ------- */

/* Departments carry up to eight children, so the panel goes multi-column
   rather than running off the bottom of the viewport. */
.nav__item--has-children .nav__panel {
  min-width: 26rem;
  padding: 1.5rem 1.75rem;
}

.nav__panel ul {
  grid-template-columns: repeat(2, minmax(7rem, 1fr));
  gap: 0.15rem 2rem;
}

.nav__panel a { padding: 0.4rem 0; }

/* --------------------------------------------- sticky add to cart (mobile) */

.product__sticky-atc {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem var(--page-gutter);
  background: rgba(var(--color-background), 0.97);
  backdrop-filter: blur(6px);
  border-top: var(--border-subtle);
  transform: translateY(110%);
  transition: transform var(--duration-default) var(--easing);
}

.product__sticky-atc.is-visible { transform: translateY(0); }
.product__sticky-atc .button { flex: 1; min-height: 2.6rem; }

.product__sticky-atc__meta {
  min-width: 0;
  font-size: 0.8rem;
  line-height: 1.3;
}

.product__sticky-atc__title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

@media (min-width: 750px) {
  .product__sticky-atc { display: none; }
}

/* ----------------------------------------------------------- reduced-motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- reviews - */

.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.review {
  border-top: var(--border-subtle);
  padding-top: 1.1rem;
}

.review__stars { margin: 0 0 0.35rem; font-size: 0.95rem; }
.review__title { font-size: 1rem; margin: 0 0 0.4rem; }
.review__body { font-size: 0.925rem; margin: 0 0 0.6rem; color: rgba(var(--color-text), 0.8); }

.review__meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.review__verified {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.05rem 0.4rem;
  background: rgb(var(--color-shade));
  border-radius: 2px;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgb(var(--color-success));
}

/* --------------------------------------------------------------- authors -- */

.author-hero {
  display: grid;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

@media (min-width: 750px) {
  .author-hero { grid-template-columns: 10rem minmax(0, 1fr); gap: 2.5rem; }
}

.author-hero__portrait { width: 10rem; height: 10rem; object-fit: cover; border-radius: 50%; }
.author-hero h1 { margin-bottom: 0.5rem; }
.author-hero__lede { font-size: 1.05rem; color: rgba(var(--color-text), 0.72); max-width: 46ch; }

.author-hero__links { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.85rem; margin: 0; }

.author-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin: 1.25rem 0;
  padding: 1rem 0;
  border-block: var(--border-subtle);
}
.author-facts dt {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.15rem;
}
.author-facts dd { margin: 0; font-size: 0.9rem; font-weight: 600; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.tag-list li {
  padding: 0.3rem 0.7rem;
  background: rgb(var(--color-shade));
  font-size: 0.82rem;
}

.author-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; }
@media (min-width: 750px) { .author-grid { grid-template-columns: repeat(2, 1fr); } }

.author-card { display: flex; gap: 1.25rem; align-items: start; }
.author-card__portrait { flex: none; }
.author-card__portrait img { width: 7.5rem; height: 7.5rem; object-fit: cover; border-radius: 50%; }
.author-card h2 { font-size: 1.15rem; margin-bottom: 0.1rem; }
.author-card h2 a { text-decoration: none; }
.author-card h2 a:hover { text-decoration: underline; }
.author-card__role {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

/* byline block at the foot of an article */
.author-box {
  display: flex;
  gap: 1rem;
  align-items: start;
  margin-top: 2.5rem;
  padding: 1.25rem;
  background: rgb(var(--color-shade));
  max-width: 46rem;
}
.author-box img { width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; flex: none; }
.author-box__name { margin: 0 0 0.3rem; font-size: 0.95rem; }
.author-box__name span { display: block; font-size: 0.8rem; font-weight: 400; }
.author-box p:last-child { margin-bottom: 0; }

.article-sources {
  max-width: 46rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: var(--border-subtle);
}
.article-sources h2 { font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }
.article-sources ol { padding-left: 1.2rem; font-size: 0.875rem; }
.article-sources li { margin-bottom: 0.35rem; }

/* ------------------------------------------------------- cookie consent -- */

/* The banner ships in the HTML for everyone and starts hidden, so one cached
   body serves every visitor. Script reveals it only when no choice is stored. */

.consent {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 70;
  background: rgb(var(--color-background));
  border-top: 2px solid rgb(var(--color-text));
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.1);
}

.consent[hidden] { display: none; }

.consent__inner {
  max-width: var(--page-width);
  margin-inline: auto;
  padding: 1.25rem var(--page-gutter);
  display: grid;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 990px) {
  .consent__inner { grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; }
}

.consent__title { font-size: 1rem; margin-bottom: 0.3rem; }
.consent__copy p { margin: 0; font-size: 0.875rem; color: rgba(var(--color-text), 0.75); }

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.consent__actions .button { min-height: 2.6rem; padding-inline: 1.1rem; font-size: 0.875rem; }

/* --- preferences dialog --- */

.consent-modal { position: fixed; inset: 0; z-index: 80; }
.consent-modal[hidden] { display: none; }

.consent-modal__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }

.consent-modal__panel {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  background: rgb(var(--color-background));
  padding: 1.5rem var(--page-gutter) 2rem;
}

@media (min-width: 750px) {
  .consent-modal__panel {
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(34rem, calc(100vw - 3rem));
    border: var(--border-subtle);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  }
}

.consent-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.consent-modal__header h2 { margin: 0; font-size: 1.15rem; }

.consent-category { padding: 1rem 0; border-bottom: var(--border-subtle); }
.consent-category p { margin: 0; font-size: 0.85rem; color: rgba(var(--color-text), 0.65); }

.consent-category__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}
.consent-category__head h3 { margin: 0; font-size: 0.95rem; }

.consent-category__locked {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.consent-modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
}

/* --- toggle --- */

.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }

.switch__track {
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(var(--color-text), 0.22);
  transition: background var(--duration-short) var(--easing);
  position: relative;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 0.19rem;
  left: 0.19rem;
  width: 1.12rem;
  height: 1.12rem;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--duration-short) var(--easing);
}

.switch input:checked + .switch__track { background: rgb(var(--color-success)); }
.switch input:checked + .switch__track::after { transform: translateX(1.25rem); }
.switch input:focus-visible + .switch__track { outline: var(--focus-ring); outline-offset: 2px; }

.footer__consent-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.footer__consent-link:hover { color: rgb(var(--color-text)); }

/* ============================================================ mobile UX ===
   The collection page previously spent 927px of an 812px viewport on chrome
   before the first product: filter, result count and sort each took their own
   row. These rules put them on one line and turn the filter panel into a
   bottom sheet instead of an inline expand that pushes the grid down.
   ========================================================================= */

.collection-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.collection-toolbar .collection-count {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.facets-toggle {
  flex: none;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

.facets-toggle__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: rgb(var(--color-text));
  color: rgb(var(--color-background));
  font-size: 0.68rem;
  font-weight: 700;
}

/* The sort label is redundant next to a select that says "Best selling". */
@media (max-width: 749px) {
  .sort-select label { display: none; }
  .sort-select select { max-width: 9.5rem; }
  .collection-toolbar .collection-count { font-size: 0.75rem; }
  .collection-header { padding-block: 0.75rem 1rem; }
  .breadcrumbs { padding-block: 0.75rem; }
  .announcement { font-size: 0.72rem; padding: 0.45rem 1rem; }
}

/* --- filter panel as a bottom sheet below 990px --- */

@media (max-width: 989px) {
  .collection-facets { position: static; }

  .facets {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 60;
    max-height: 82vh;
    overflow-y: auto;
    background: rgb(var(--color-background));
    padding: 0.5rem var(--page-gutter) 1.5rem;
    border-top: 2px solid rgb(var(--color-text));
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(101%);
    transition: transform var(--duration-default) var(--easing);
  }

  /* Kept in flow but off-screen rather than display:none, so opening it
     animates instead of snapping. */
  .facets.is-open { display: block; transform: translateY(0); }

  .facets::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 0.25rem;
    border-radius: 999px;
    background: rgba(var(--color-text), 0.2);
    margin: 0.5rem auto 0.75rem;
  }

  .facets-backdrop {
    position: fixed;
    inset: 0;
    z-index: 59;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity var(--duration-default) var(--easing);
  }
  .facets-backdrop.is-open { opacity: 1; }

  /* A done button, because a bottom sheet with no dismiss is a trap. */
  .facets__done {
    position: sticky;
    bottom: 0;
    display: block;
    width: 100%;
    margin-top: 1rem;
    background: rgb(var(--color-accent));
    color: rgb(var(--color-accent-contrast));
    border: 0;
    padding: 0.8rem;
    font-weight: 600;
  }
}

@media (min-width: 990px) {
  .facets__done { display: none; }
}

/* --- product gallery: main image leads on mobile --- */

@media (max-width: 749px) {
  .product__thumbs {
    margin-top: 0.6rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .product__thumb { scroll-snap-align: start; }
}

/* Source order is now main-image-then-thumbs; desktop puts the strip back on
   the left with grid placement rather than by reordering the markup. */
@media (min-width: 750px) {
  .product__gallery { grid-template-columns: 5rem minmax(0, 1fr); }
  .product__main-image { grid-column: 2; grid-row: 1; }
  .product__thumbs { grid-column: 1; grid-row: 1; }
}

/* ------------------------------------------------------------ back to top -- */

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border-subtle);
  border-radius: 50%;
  background: rgba(var(--color-background), 0.94);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity var(--duration-default) var(--easing),
              transform var(--duration-default) var(--easing);
}

.to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* The sticky add-to-cart bar owns the bottom-right corner on a product page. */
.product__sticky-atc.is-visible ~ .to-top { bottom: 4.5rem; }

/* Long count reads "Showing 1-24 of 341"; at 375px that ellipsises to
   "Showing 1-24 o...", so the short form takes over. */
.collection-count__short { display: none; }

@media (max-width: 749px) {
  .collection-count__long { display: none; }
  .collection-count__short { display: inline; }
  .collection-toolbar .collection-count { text-align: center; }
}

/* ====================================================== a11y / mobile ===
   Findings from a measured audit, not guesses. See the notes on each block.
   ======================================================================= */

/* iOS Safari zooms the viewport whenever a focused input has a font-size under
   16px, and there is no way back out except pinching. The newsletter field,
   search field and price inputs were all between 13.3px and 14.4px. */
@media (max-width: 749px) {
  input[type="text"],
  input[type="email"],
  input[type="search"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px;
  }
}

/* WCAG 2.5.8 (AA) wants a 24x24 minimum unless the target is inline in a
   sentence. These are standalone controls, so they get real hit areas even
   where the visible mark is smaller. */
.facet-option { min-height: 2.25rem; }
.product__thumb { min-width: 3rem; min-height: 3rem; }
.drawer__close,
.consent-modal__header .drawer__close { min-width: 2.75rem; min-height: 2.75rem; }
.switch { min-width: 2.75rem; min-height: 1.75rem; }
.pagination a,
.pagination span { min-width: 2.5rem; min-height: 2.5rem; }
.localisation__group a { min-height: 2.25rem; }
.footer__consent-link { min-height: 1.5rem; }
.active-facet { min-height: 1.75rem; }

/* Footer link lists are standalone navigation, not prose, so they need the
   target size even though they look like inline links. */
.footer ul a { display: inline-block; padding-block: 0.2rem; min-height: 1.75rem; }

/* Notched and gesture-bar devices: anything pinned to the bottom has to clear
   the home indicator or it is partly untappable. */
@supports (padding: max(0px)) {
  .consent__inner { padding-bottom: max(1.25rem, env(safe-area-inset-bottom)); }
  .consent-modal__panel { padding-bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem)); }
  .product__sticky-atc { padding-bottom: max(0.7rem, env(safe-area-inset-bottom)); }
  .facets { padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 1rem)); }
  .to-top { bottom: max(1rem, calc(env(safe-area-inset-bottom) + 0.5rem)); }
}

/* A focus ring the same colour as the text is invisible on a dark control. */
.button:focus-visible,
.consent__actions .button:focus-visible {
  outline: 2px solid rgb(var(--color-background));
  outline-offset: -4px;
  box-shadow: 0 0 0 2px rgb(var(--color-text));
}

/* Windows High Contrast Mode drops background colours, which would leave the
   toggle and the swatches as invisible boxes. */
@media (forced-colors: active) {
  .switch__track { border: 1px solid CanvasText; }
  .switch input:checked + .switch__track { background: Highlight; }
  .swatch, .facet-option__box { border: 1px solid CanvasText; }
  .card__badge { border: 1px solid CanvasText; }
}


/* A standalone link above the h1, not inline in a sentence, so WCAG 2.5.8
   applies and it needs a real hit area. */
.product__vendor {
  display: inline-block;
  padding-block: 0.3rem;
  min-height: 1.75rem;
}

/* .sort-select select sets 0.875rem, which out-specifies the blanket 16px rule
   above. iOS does not zoom for a <select> (it opens a native picker), so this
   is legibility rather than a zoom fix, but 14px is small for a control that
   is one of only three things in the mobile toolbar. */
@media (max-width: 749px) {
  .sort-select select { font-size: 16px; padding-block: 0.5rem; }
}

/* Product page rating: same treatment as the cards, and a jump link to the
   reviews block since that is what people are looking for when they read it. */
.product__rating { margin: 0 0 0.9rem; font-size: 0.85rem; }

.product__rating a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.75rem;
  text-decoration: none;
  color: inherit;
}

.product__rating a:hover .text-muted { text-decoration: underline; }

/* Swatch links. The visible dot stays small; the hit area does not, because a
   14px target fails WCAG 2.5.8 and is miserable on a phone regardless. */
.swatch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin: -0.35rem;
  border-radius: 50%;
  text-decoration: none;
}

.swatch-link .swatch { transition: transform var(--duration-short) var(--easing); }
.swatch-link:hover .swatch,
.swatch-link:focus-visible .swatch { transform: scale(1.25); }
.swatch-link:focus-visible { outline: 2px solid rgb(var(--color-text)); outline-offset: 1px; }

.card__swatches { gap: 0.45rem; }

/* ===================================================== commerce ========== */

/* Forms shared by checkout, account and the Q&A block. Inputs are 16px on
   small screens because iOS zooms the viewport whenever a focused input is
   under 16px, and there is no way back except pinching. */

.form-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.field { margin-bottom: 1rem; }
.field--wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="password"], .field input[type="number"], .field textarea {
  width: 100%; font: inherit; font-size: 1rem;
  padding: 0.7rem 0.75rem; border-radius: 4px;
  border: 1px solid rgba(var(--color-border), 0.25);
  background: rgb(var(--color-background)); color: rgb(var(--color-text));
}
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid rgb(var(--color-accent)); outline-offset: 1px;
}
.field input[aria-invalid="true"] { border-color: rgb(var(--color-sale)); }
.field__hint { font-size: 0.8rem; color: var(--color-muted); margin: 0.3rem 0 0; }
.field__error { font-size: 0.82rem; color: rgb(var(--color-sale)); margin: 0.3rem 0 0; }
.field--check { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 1rem; font-size: 0.9rem; }
.field--check input { margin-top: 0.2rem; width: 1.15rem; height: 1.15rem; }

.qty-input {
  width: 4.5rem; font: inherit; font-size: 1rem; padding: 0.5rem;
  border: 1px solid rgba(var(--color-border), 0.25); border-radius: 4px;
}

.notice--error {
  border-color: rgba(var(--color-sale), 0.4);
  background: rgba(var(--color-sale), 0.06);
  color: rgb(var(--color-sale));
}
.notice--ok {
  border-color: rgba(var(--color-success), 0.35);
  background: rgba(var(--color-success), 0.06);
  color: rgb(var(--color-success));
}

/* ------------------------------------------------------------- summary --- */

.summary { margin: 1.25rem 0; }
.summary__row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; }
.summary__row dt, .summary__row dd { margin: 0; }
.summary__row--saving { color: rgb(var(--color-success)); }
.summary__row--total {
  border-top: var(--border-subtle); margin-top: 0.35rem; padding-top: 0.85rem;
  font-size: 1.1rem; font-weight: 600;
}
.summary__note { display: block; font-size: 0.78rem; color: var(--color-muted); font-weight: 400; }
.summary__tax { font-size: 0.8rem; color: var(--color-muted); margin: -0.5rem 0 1rem; }

/* ---------------------------------------------------------------- cart --- */

.cart-layout { display: grid; gap: 2.5rem; align-items: start; }
.cart-aside {
  border: var(--border-subtle); border-radius: 8px; padding: 1.25rem;
  background: rgba(var(--color-shade), 0.6);
}
.cart-aside h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.cart-aside .button--full { margin-bottom: 0.75rem; }
.cart-item__warn { font-size: 0.8rem; color: rgb(var(--color-sale)); margin: 0.3rem 0 0; }

.discount-form { margin-bottom: 1.25rem; }
.discount-form label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; }
.discount-form__row { display: flex; gap: 0.5rem; }
.discount-form__row input {
  flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: 0.65rem 0.7rem;
  border: 1px solid rgba(var(--color-border), 0.25); border-radius: 4px;
}
.discount-applied {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  margin: 0 0 1.25rem; padding: 0.6rem 0.75rem; border-radius: 4px;
  background: rgba(var(--color-success), 0.08); color: rgb(var(--color-success));
}
.discount-applied button {
  border: 0; background: none; padding: 0.25rem; font: inherit;
  font-size: 0.85rem; text-decoration: underline; cursor: pointer; color: inherit;
}

.rate-list { list-style: none; margin: 1.25rem 0 0; padding: 1rem 0 0; border-top: var(--border-subtle); }
.rate-list li { font-size: 0.82rem; color: var(--color-muted); margin-bottom: 0.6rem; }
.rate-list strong { display: block; color: rgb(var(--color-text)); font-size: 0.88rem; }
.rate-list span { display: block; }

/* ------------------------------------------------------------ checkout --- */

.checkout-layout { display: grid; gap: 2.5rem; align-items: start; }
.checkout-block { border: 0; padding: 0; margin: 0 0 2rem; }
.checkout-block legend { font-size: 1.05rem; font-weight: 600; padding: 0; margin-bottom: 0.9rem; }
.checkout-aside {
  border: var(--border-subtle); border-radius: 8px; padding: 1.25rem;
  background: rgba(var(--color-shade), 0.6);
}
.checkout-aside h2 { margin: 0 0 1rem; font-size: 1.1rem; }

.checkout-lines { list-style: none; margin: 0 0 1rem; padding: 0; }
.checkout-lines li { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.85rem; font-size: 0.85rem; }
.checkout-lines img { border-radius: 4px; background: rgba(var(--color-shade), 1); }
.checkout-lines__body { flex: 1; min-width: 0; }
.checkout-lines__body strong { display: block; font-weight: 500; }
.checkout-lines__body span { color: var(--color-muted); font-size: 0.8rem; }

.rate-option {
  display: flex; gap: 0.75rem; align-items: flex-start;
  border: 1px solid rgba(var(--color-border), 0.18); border-radius: 6px;
  padding: 0.85rem; margin-bottom: 0.6rem; cursor: pointer;
}
.rate-option:has(input:checked) { border-color: rgb(var(--color-accent)); }
.rate-option input { margin-top: 0.2rem; width: 1.15rem; height: 1.15rem; }
.rate-option__body { flex: 1; font-size: 0.85rem; color: var(--color-muted); }
.rate-option__body strong { display: block; color: rgb(var(--color-text)); font-size: 0.95rem; }
.rate-option__body span { display: block; }
.rate-option__price { font-weight: 600; }

/* --------------------------------------------------------------- order --- */

.order-facts { display: grid; gap: 1rem; margin: 1.75rem 0; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.order-facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); }
.order-facts dd { margin: 0.2rem 0 0; font-size: 0.95rem; }

.order-lines { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.order-lines li {
  display: flex; gap: 0.85rem; align-items: center;
  padding: 0.75rem 0; border-bottom: var(--border-subtle); font-size: 0.9rem;
}
.order-lines img { border-radius: 4px; background: rgba(var(--color-shade), 1); }
.order-lines__body { flex: 1; min-width: 0; }
.order-lines__body span { display: block; color: var(--color-muted); font-size: 0.82rem; }
.order-address { font-style: normal; line-height: 1.7; color: var(--color-muted); }

/* ------------------------------------------------------------- account --- */

.account-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.account-grid { display: grid; gap: 2.5rem; margin-top: 2rem; }
.auth-form { max-width: 26rem; }
.auth-alt { margin-top: 1.5rem; font-size: 0.9rem; color: var(--color-muted); }

.order-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.order-list li {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: 0.7rem 0; border-bottom: var(--border-subtle); font-size: 0.9rem;
}
.order-list span { color: var(--color-muted); font-size: 0.85rem; }

.address-card { border: var(--border-subtle); border-radius: 8px; padding: 1.1rem; margin-bottom: 1rem; }
.address-card form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.85rem; }
.badge {
  display: inline-block; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0.2rem 0.5rem; border-radius: 999px;
  background: rgba(var(--color-shade), 1); color: var(--color-muted); margin: 0 0 0.6rem;
}

/* ------------------------------------------------------------------ Q&A --- */

.qa-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.qa { padding: 1.1rem 0; border-bottom: var(--border-subtle); }
.qa__question { font-size: 1rem; margin: 0 0 0.3rem; }
.qa__meta { font-size: 0.8rem; color: var(--color-muted); margin: 0 0 0.7rem; }
.qa__answer {
  border-left: 2px solid rgba(var(--color-border), 0.15);
  padding-left: 1rem; margin-left: 0.15rem;
}
.qa__answer p { margin: 0 0 0.4rem; }
.qa__by { font-size: 0.8rem; color: var(--color-muted); }
.qa-ask { border: var(--border-subtle); border-radius: 8px; padding: 1rem 1.1rem; }
.qa-ask summary { cursor: pointer; font-weight: 500; }
.qa-ask form { margin-top: 1.1rem; }

/* --------------------------------------------------- back-in-stock form --- */

.notify-form {
  border: var(--border-subtle); border-radius: 8px;
  padding: 1.1rem; margin-bottom: 1.5rem; background: rgba(var(--color-shade), 0.6);
}
.notify-form__title { font-size: 1rem; margin: 0 0 0.3rem; }
.notify-form__body { font-size: 0.85rem; color: var(--color-muted); margin: 0 0 0.85rem; }
.notify-form__row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.notify-form__row input {
  flex: 1; min-width: 12rem; font: inherit; font-size: 1rem; padding: 0.65rem 0.7rem;
  border: 1px solid rgba(var(--color-border), 0.25); border-radius: 4px;
}

.product-grid--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); }

@media (min-width: 750px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) 22rem; }
  .checkout-layout { grid-template-columns: minmax(0, 1fr) 23rem; }
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
