/* ─────────────────────────────────────────
   LUNA LIVING — Design Tokens & Global Styles
   Mobile-first. S3-hosted static site.
───────────────────────────────────────── */

:root {
  /* Brand colour (from brand kit) */
  --c-red:        oklch(47.4% 0.182 28);   /* #AB1516 */
  --c-red-dk:     oklch(40.5% 0.160 28);
  --c-stone:      oklch(91.2% 0.006 60);   /* #E5E1DE */
  --c-ink:        oklch(24.4% 0.006 20);   /* #231F20 */

  /* Neutrals */
  --c-paper:      oklch(98.6% 0.003 80);   /* page */
  --c-cream:      oklch(95.6% 0.009 75);   /* header + footer */
  --c-tile:       oklch(94.2% 0.004 90);   /* panels + photo tiles */
  --c-ink-mute:   oklch(46% 0.008 30);
  --c-line:       oklch(87% 0.006 60);
  --c-on-red:     oklch(98% 0.006 40);
  --c-overlay:    oklch(22% 0.008 40 / 0.4);

  /* Type */
  --f-display:    'Cormorant Garamond', Georgia, serif;
  --f-body:       'Figtree', system-ui, -apple-system, sans-serif;
  --f-ar:         'Readex Pro', system-ui, sans-serif;

  --t-body:   1rem;
  --t-small:  0.875rem;
  --t-label:  0.75rem;

  /* Spacing (4pt) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Layout */
  --gutter:   16px;
  --col-gap:  10px;
  --row-gap:  var(--sp-8);
  --topbar-h: 64px;
  --radius:   2px;

  /* Motion */
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:  180ms;
  --dur-med:   420ms;
  --dur-slow:  800ms;

  /* Layers */
  --z-topbar:   10;
  --z-bagbar:   50;
  --z-backdrop: 200;
  --z-sheet:    201;
  --z-lightbox: 400;
  --z-intro:    500;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--c-paper);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--f-body);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--c-ink);
  background-color: var(--c-paper);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

:focus-visible {
  outline: 2px solid var(--c-red);
  outline-offset: 3px;
}

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

/* ── Arabic ── */
:lang(ar) body { font-family: var(--f-ar); }

:lang(ar) .item__name,
:lang(ar) .drawer__name,
:lang(ar) .cart-sheet__title,
:lang(ar) .cart-item__name,
:lang(ar) .cart-total__amount {
  font-family: var(--f-ar);
  font-weight: 500;
  letter-spacing: 0;
}

:lang(ar) .drawer__category,
:lang(ar) .drawer__label,
:lang(ar) .filter {
  letter-spacing: 0;
  text-transform: none;
}

/* ── Intro ── */
.intro { display: none; }

.js:not(.intro-seen) .intro {
  position: fixed;
  inset: 0;
  z-index: var(--z-intro);
  display: grid;
  place-items: center;
  background: var(--c-paper);
  cursor: pointer;
  animation: introOut 600ms var(--ease-out) 1400ms forwards;
}

.intro__logo {
  width: min(52vw, 260px);
  animation: introLogo 1100ms var(--ease-expo) both;
}

.js:not(.intro-seen) .intro.is-done { animation: introOut 300ms var(--ease-out) forwards; }

@keyframes introLogo {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes introOut {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* ── Page ── */
.page {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-bottom: env(safe-area-inset-bottom);
  transition: padding-bottom var(--dur-med) var(--ease-out);
}

body.has-bag .page {
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  background: oklch(95.6% 0.009 75 / 0.96);
}

.topbar__inner {
  height: var(--topbar-h);
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 calc(var(--gutter) - 10px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.topbar .lang-toggle { justify-self: start; }
.topbar .nav__cart-btn { justify-self: end; }

.topbar__logo {
  display: block;
  width: 74px;
}

.topbar__logo img { width: 100%; }

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--c-ink);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.icon-btn:hover { background-color: oklch(91% 0.006 60 / 0.7); }

.lang-toggle__label {
  font-family: var(--f-ar);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1;
}

:lang(ar) .lang-toggle__label {
  font-family: var(--f-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.nav__cart-count {
  position: absolute;
  top: 4px;
  inset-inline-end: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--c-red);
  color: var(--c-on-red);
  font-family: var(--f-body);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
}

.nav__cart-count[hidden] { display: none; }

/* ── Banner ── */
.banner {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--c-tile);
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

/* ── Welcome (text + arches) ── */
.welcome {
  display: grid;
  gap: 6px;
  max-width: 1200px;
  margin: 6px auto 0;
  padding: 0 6px;
}

.welcome__text {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--sp-6);
  padding: var(--sp-16) var(--gutter);
  text-align: center;
  background: linear-gradient(135deg, oklch(98.4% 0.002 90), var(--c-tile));
}

.welcome__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 10vw, 4.25rem);
  line-height: 1;
  letter-spacing: 0.01em;
}

:lang(ar) .welcome__title {
  font-family: var(--f-ar);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.3;
}

.link-cta {
  display: inline-block;
  padding: var(--sp-2) 0;
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  line-height: 1.6;
  transition: color var(--dur-fast) var(--ease-out);
}

.link-cta:hover { color: var(--c-red); }

:lang(ar) .link-cta { letter-spacing: 0; font-size: var(--t-small); }

.welcome__media {
  padding: var(--sp-8) var(--sp-6) var(--sp-10);
  background: var(--c-tile);
}

.hero__arches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  align-items: start;
  max-width: 520px;
  margin: 0 auto;
}

.arch {
  aspect-ratio: 3 / 4.2;
  border-radius: 50% 50% 18px 18px / 35.7% 35.7% 18px 18px;
  overflow: hidden;
  background: var(--c-paper);
}

.arch--low { margin-top: var(--sp-10); }

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

/* ── Looks strip ── */
.looks {
  max-width: 1200px;
  margin: 6px auto 0;
}

.looks__row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 6px;
  padding: 0 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.looks__row::-webkit-scrollbar { display: none; }

.looks__row li {
  scroll-snap-align: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--c-tile);
}

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

/* ── Shop ── */
.shop {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-16) var(--gutter);
}

.section-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.875rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: var(--sp-8);
}

:lang(ar) .section-title { font-family: var(--f-ar); letter-spacing: 0; }

/* Collection filters */
.filters {
  display: flex;
  justify-content: center;
  gap: var(--sp-6);
  margin: calc(var(--sp-4) * -1) calc(var(--gutter) * -1) var(--sp-8);
  padding: 0 var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar { display: none; }
.filters[hidden] { display: none; }

.filter {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 var(--sp-2);
  font-family: var(--f-display);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-ink-mute);
  border-bottom: 1.5px solid transparent;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.filter:hover { color: var(--c-ink); }

.filter[aria-pressed="true"] {
  color: var(--c-ink);
  border-bottom-color: currentColor;
}

/* Product grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--row-gap);
}

.grid__empty {
  grid-column: 1 / -1;
  padding: var(--sp-16) 0;
  text-align: center;
  color: var(--c-ink-mute);
}

.item__link {
  display: block;
  width: 100%;
  text-align: center;
}

.item__media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--c-tile);
  isolation: isolate;
}

.item__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
  transition: opacity var(--dur-med) var(--ease-out),
              transform var(--dur-slow) var(--ease-expo);
}

.item__img--alt {
  opacity: 0;
  mix-blend-mode: normal;
}

.item__media--empty {
  display: grid;
  place-items: center;
}

.item__ph {
  width: 38%;
  opacity: 0.14;
}

.item__info {
  display: grid;
  gap: 2px;
  padding-top: var(--sp-4);
}

.item__name {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.3;
}

:lang(ar) .item__name { text-transform: none; }

.item__price {
  font-size: var(--t-small);
  color: var(--c-ink-mute);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Quick add */
.item {
  display: flex;
  flex-direction: column;
}

.item__buy {
  margin-top: auto;
  padding-top: var(--sp-3);
}

.item__add,
.item__size {
  min-height: 44px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.item__add {
  width: 100%;
  padding: 0 var(--sp-2);
}

:lang(ar) .item__add {
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: 0;
}

.item__add:hover,
.item__size:hover { border-color: var(--c-ink); }

.item__add.is-added {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-paper);
}

.item.is-picking .item__add { display: none; }

.item__sizes {
  display: flex;
  gap: 4px;
}

.item__sizes[hidden] { display: none; }

.item__size {
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  letter-spacing: 0.04em;
}

.item__size:hover {
  background: var(--c-ink);
  color: var(--c-paper);
}

@media (hover: hover) {
  .item__link:hover .has-alt .item__img--alt { opacity: 1; }
  .item__link:hover .item__media:not(.has-alt) .item__img { transform: scale(1.03); }
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: 0 var(--sp-6);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  transition: background-color var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}

:lang(ar) .btn {
  font-size: var(--t-body);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.btn--red {
  background: var(--c-red);
  color: var(--c-on-red);
}

.btn--red:hover { background: var(--c-red-dk); }

.btn--red[aria-disabled="true"] { opacity: 0.5; }

.btn--red[aria-disabled="true"]:hover { background: var(--c-red); }

.btn-whatsapp {
  width: 100%;
  background: var(--c-red);
  color: var(--c-on-red);
}

.btn-whatsapp:hover { background: var(--c-red-dk); }

/* ── Footer ── */
.footer {
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  padding: var(--sp-12) var(--gutter) var(--sp-10);
  background: var(--c-cream);
  text-align: center;
}

.footer__logo {
  width: 64px;
  margin-bottom: var(--sp-3);
}

.footer__wa {
  display: inline-block;
  padding: var(--sp-2) 0;
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  text-decoration: underline;
  text-decoration-color: var(--c-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color var(--dur-fast) var(--ease-out);
}

.footer__wa:hover { text-decoration-color: currentColor; }

.footer__legal {
  font-size: var(--t-label);
  color: var(--c-ink-mute);
}

/* ── Floating bag bar ── */
.bag-bar {
  position: fixed;
  z-index: var(--z-bagbar);
  left: 50%;
  bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  width: min(calc(100% - 2 * var(--gutter)), 420px);
  min-height: 54px;
  padding: 0 var(--sp-5);
  border-radius: var(--radius);
  background: var(--c-red);
  color: var(--c-on-red);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 10px 28px -14px oklch(30% 0.12 28 / 0.6);
  transform: translate(-50%, 160%);
  visibility: hidden;
  transition: transform var(--dur-med) var(--ease-expo),
              visibility 0s linear var(--dur-med);
}

:lang(ar) .bag-bar { letter-spacing: 0; text-transform: none; font-weight: 500; }

.bag-bar.is-visible {
  transform: translate(-50%, 0);
  visibility: visible;
  transition: transform var(--dur-med) var(--ease-expo),
              visibility 0s;
}

.bag-bar__label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.bag-bar__count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--c-on-red);
  color: var(--c-red);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0;
}

.bag-bar__total {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.bag-bar.pulse { animation: bagPulse 420ms var(--ease-out); }

@keyframes bagPulse {
  0%   { transform: translate(-50%, 0) scale(1); }
  40%  { transform: translate(-50%, 0) scale(1.03); }
  100% { transform: translate(-50%, 0) scale(1); }
}

/* ── Backdrops ── */
.drawer-backdrop,
.cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: var(--c-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out);
}

.drawer-backdrop.is-open,
.cart-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Sheets (drawer + bag) ── */
.sheet {
  position: fixed;
  z-index: var(--z-sheet);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--c-paper);
  border-radius: 14px 14px 0 0;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform var(--dur-med) var(--ease-expo),
              visibility 0s linear var(--dur-med);
}

.sheet.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform var(--dur-med) var(--ease-expo),
              visibility 0s;
}

.sheet__grabber {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 50%;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  border-radius: 2px;
  background: oklch(98% 0.004 60 / 0.9);
  box-shadow: 0 0 0 1px oklch(70% 0.01 60 / 0.2);
}

/* ── Product Drawer ── */
.product-drawer {
  max-height: 94svh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer__close {
  position: absolute;
  z-index: 4;
  top: var(--sp-3);
  inset-inline-end: var(--sp-3);
  background: oklch(96.4% 0.004 60 / 0.9);
}

.drawer__close:hover { background: var(--c-paper); }

/* ── Slideshow ── */
.slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.6;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  background: var(--c-tile);
  user-select: none;
  touch-action: pan-y;
}

.slideshow__track {
  display: flex;
  height: 100%;
  transition: transform var(--dur-med) var(--ease-expo);
  will-change: transform;
}

.slideshow__slide {
  flex: 0 0 100%;
  height: 100%;
  isolation: isolate;
  background: var(--c-tile);
}

.slideshow__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.slideshow__slide--detail img {
  object-fit: cover;
  mix-blend-mode: normal;
}

.slideshow__slide--empty {
  display: grid;
  place-items: center;
}

.slideshow__slide--empty img {
  width: 34%;
  height: auto;
  opacity: 0.14;
}

.slideshow__arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: oklch(96.4% 0.004 60 / 0.9);
  color: var(--c-ink);
  transition: opacity var(--dur-fast) var(--ease-out);
}

.slideshow__arrow--prev { inset-inline-start: var(--sp-3); }
.slideshow__arrow--next { inset-inline-end: var(--sp-3); }

[dir="rtl"] .slideshow__arrow svg { transform: scaleX(-1); }

.slideshow__arrow[hidden] { display: none; }

.slideshow__arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

.slideshow__dots {
  position: absolute;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}

.slideshow__dot {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.slideshow__dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: oklch(24% 0.006 20 / 0.25);
  transition: background-color var(--dur-fast) var(--ease-out),
              width var(--dur-fast) var(--ease-out);
}

.slideshow__dot.is-active::before {
  width: 16px;
  border-radius: 3px;
  background: var(--c-ink);
}

.slideshow__zoom {
  position: absolute;
  z-index: 3;
  bottom: var(--sp-3);
  inset-inline-end: var(--sp-3);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: oklch(96.4% 0.004 60 / 0.9);
  color: var(--c-ink);
}

.slideshow__zoom[hidden] { display: none; }

/* ── Drawer Body ── */
.drawer__body {
  padding: var(--sp-6) var(--sp-5) calc(var(--sp-6) + env(safe-area-inset-bottom));
}

.drawer__category {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-ink-mute);
  margin-bottom: var(--sp-2);
}

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

.drawer__name {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 2.125rem;
  line-height: 1.15;
}

.drawer__price {
  font-size: var(--t-body);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.drawer__colour {
  font-size: var(--t-small);
  color: var(--c-ink-mute);
  margin-top: var(--sp-1);
}

.drawer__label {
  margin-top: var(--sp-6);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.drawer__sizes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.drawer__sizes[hidden],
.drawer__label[hidden],
.drawer__size-hint[hidden] { display: none; }

.drawer__sizes.is-nudged { animation: nudge 360ms var(--ease-out); }

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.size-pill {
  min-width: 56px;
  height: 46px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: transparent;
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.size-pill:hover { border-color: var(--c-ink); }

.size-pill[aria-checked="true"] {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-paper);
}

.drawer__size-hint {
  min-height: 1.5em;
  margin: var(--sp-2) 0 var(--sp-4);
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--c-red);
}

.drawer__actions {
  display: flex;
  gap: var(--sp-3);
}

.drawer__add { flex: 1; }

/* ── Stepper ── */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.stepper__btn {
  width: 44px;
  height: 50px;
  font-size: 1.25rem;
  line-height: 1;
}

.stepper__btn:hover { color: var(--c-red); }

.stepper__btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.stepper__value {
  min-width: 2ch;
  text-align: center;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stepper--sm .stepper__btn { width: 36px; height: 36px; font-size: 1.0625rem; }
.stepper--sm .stepper__value { font-size: var(--t-small); }

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(18% 0.006 40 / 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-med) var(--ease-out),
              visibility 0s linear var(--dur-med);
  touch-action: none;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-med) var(--ease-out), visibility 0s;
}

.lightbox__close {
  position: absolute;
  z-index: 2;
  top: calc(var(--sp-4) + env(safe-area-inset-top));
  inset-inline-end: var(--sp-4);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: oklch(30% 0.006 40 / 0.7);
  color: oklch(94% 0.005 60);
}

.lightbox__img-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100dvh;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 240ms var(--ease-out);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox__img.is-zoomed { cursor: zoom-out; }

.lightbox__hint {
  position: absolute;
  bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--t-label);
  color: oklch(78% 0.006 60);
  white-space: nowrap;
  pointer-events: none;
}

/* ── Cart Sheet ── */
.cart-sheet {
  max-height: 90svh;
  display: flex;
  flex-direction: column;
}

.cart-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6) var(--sp-5) var(--sp-3);
  flex-shrink: 0;
}

.cart-sheet__title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 1.875rem;
  line-height: 1.2;
}

.cart-sheet__close { margin-inline-end: calc(var(--sp-2) * -1); }

.cart-sheet__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--sp-5);
}

.cart-empty {
  display: grid;
  justify-items: center;
  gap: var(--sp-4);
  padding: var(--sp-10) 0 var(--sp-12);
  text-align: center;
  color: var(--c-ink-mute);
}

.cart-empty__moon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-red);
  -webkit-mask: radial-gradient(circle at 70% 35%, transparent 12px, #000 13px);
          mask: radial-gradient(circle at 70% 35%, transparent 12px, #000 13px);
}

.cart-empty .btn { margin-top: var(--sp-2); }

/* ── Cart Item ── */
.cart-item {
  display: grid;
  grid-template-columns: 66px 1fr auto;
  gap: var(--sp-4);
  align-items: start;
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--c-line);
}

.cart-item:first-child { border-top: none; }

.cart-item__thumb {
  width: 66px;
  height: 88px;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  background: var(--c-tile);
}

.cart-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.cart-item__thumb--empty {
  display: grid;
  place-items: center;
}

.cart-item__thumb--empty img {
  width: 60%;
  height: auto;
  opacity: 0.14;
}

.cart-item__details {
  display: grid;
  gap: var(--sp-1);
  justify-items: start;
}

.cart-item__name {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
}

.cart-item__meta {
  font-size: var(--t-small);
  color: var(--c-ink-mute);
}

.cart-item__controls {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.cart-item__remove {
  min-height: 36px;
  font-size: var(--t-small);
  color: var(--c-ink-mute);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-item__remove:hover { color: var(--c-red); }

.cart-item__price {
  font-size: var(--t-small);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Note Box ── */
.cart-note { margin-bottom: var(--sp-4); }

.cart-note__label {
  display: block;
  font-size: var(--t-small);
  font-weight: 500;
  margin-bottom: var(--sp-2);
}

.cart-note__input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: oklch(98.2% 0.003 60);
  font: inherit;
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--c-ink);
  resize: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.cart-note__input::placeholder { color: oklch(56% 0.008 30); }

.cart-note__input:focus {
  outline: none;
  border-color: var(--c-ink);
}

.cart-note__count {
  margin-top: var(--sp-1);
  text-align: end;
  font-size: var(--t-label);
  color: var(--c-ink-mute);
  font-variant-numeric: tabular-nums;
}

/* ── Cart Footer ── */
.cart-sheet__footer {
  flex-shrink: 0;
  padding: var(--sp-4) var(--sp-5) calc(var(--sp-5) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--c-line);
}

.cart-sum {
  display: grid;
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
  font-size: var(--t-small);
  color: var(--c-ink-mute);
}

.cart-sum__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.cart-sum__amount { font-variant-numeric: tabular-nums; }

.cart-sum__hint {
  margin-top: var(--sp-1);
  color: var(--c-ink);
}

.cart-sum__hint[hidden] { display: none; }

.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  font-weight: 500;
}

.cart-total__amount {
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── Badge pulse ── */
@keyframes badgePulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.nav__cart-count.pulse { animation: badgePulse 360ms var(--ease-out); }

/* ── Scroll lock ── */
body.no-scroll { overflow: hidden; }

/* ── Entrance motion ── */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-expo),
              transform var(--dur-slow) var(--ease-expo);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

.js .grid > .reveal:nth-child(even) { transition-delay: 80ms; }

/* ── Tablet / Desktop ── */
@media (min-width: 768px) {
  :root {
    --gutter:   32px;
    --col-gap:  16px;
    --row-gap:  var(--sp-12);
    --topbar-h: 76px;
  }

  .topbar__logo { width: 88px; }

  .banner { aspect-ratio: auto; height: min(68vh, 640px); }
  .banner img { object-position: 50% 42%; }

  .welcome { grid-template-columns: 1fr 1fr; }
  .welcome__media { padding: var(--sp-10) var(--sp-8) var(--sp-12); }

  .looks__row {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .section-title { font-size: 2.25rem; margin-bottom: var(--sp-10); }

  .filters { gap: var(--sp-10); }

  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* 1–2 products: keep them large and centred */
  .grid:not(:has(> :nth-child(3))) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 820px;
    margin-inline: auto;
  }

  /* exactly 4 products: 2×2 instead of 3 + 1 */
  .grid:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 820px;
    margin-inline: auto;
  }

  .item__name { font-size: 1.0625rem; }

  .footer__logo { width: 72px; }

  /* Side sheets: full-height panels */
  .sheet {
    top: 0;
    bottom: 0;
    left: auto;
    right: 0;
    width: min(460px, 100%);
    max-height: none;
    border-radius: 0;
    transform: translateX(100%);
  }

  [dir="rtl"] .sheet {
    left: 0;
    right: auto;
    transform: translateX(-100%);
  }

  .sheet.is-open,
  [dir="rtl"] .sheet.is-open { transform: translateX(0); }

  .sheet__grabber { display: none; }

  .product-drawer { overflow-y: auto; }

  .slideshow { border-radius: 0; }

  .drawer__body { padding: var(--sp-8) var(--sp-8) var(--sp-10); }

  .cart-sheet__header,
  .cart-sheet__footer { padding-inline: var(--sp-8); }

  .cart-sheet__body { padding: 0 var(--sp-8); }
}

@media (min-width: 1100px) {
  .grid:has(> :nth-child(4)),
  .grid:has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: none;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
