/* ==========================================================================
   ARAL — iOS-inspired layer (v3)
   Loaded after app.css. Overrides tokens + the components people touch most:
   materials, continuous corners, capsule controls, iOS type scale.
   Nothing here touches markup contracts, routes, API or data.
   ========================================================================== */

/* ---------- 1. type + colour tokens ---------- */
:root {
  --ios-blue: #0A84FF;
  --ios-green: #34C759;
  --ios-orange: #FF9F0A;
  --ios-red: #FF3B30;

  --font-sans: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, 'Segoe UI', Tahoma, sans-serif;

  /* iOS type ramp (Arabic keeps 1.6 line-height, no letter-spacing) */
  --ios-large-title: 34px;
  --ios-title1: 28px;
  --ios-title2: 22px;
  --ios-title3: 20px;
  --ios-headline: 17px;
  --ios-body: 17px;
  --ios-callout: 16px;
  --ios-subhead: 15px;
  --ios-footnote: 13px;
  --ios-caption: 11px;

  --fs-h1: var(--ios-large-title);
  --fs-h2: var(--ios-title2);
  --fs-h3: var(--ios-title3);
  --fs-base: var(--ios-body);
  --fs-sm: var(--ios-subhead);
  --fs-xs: var(--ios-footnote);

  /* radii — continuous-feeling */
  --r-card: 24px;
  --r-sheet: 28px;
  --r-control: 14px;
  --r-image: 16px;
  --radius: var(--r-control);
  --radius-lg: var(--r-card);
  --radius-pill: 999px;

  /* materials */
  --mat-bar: rgba(255, 255, 255, .72);
  --mat-sheet: rgba(255, 255, 255, .86);
  --mat-fill: rgba(120, 120, 128, .12);
  --hairline: rgba(60, 60, 67, .29);
  --blur: saturate(180%) blur(20px);

  /* light surfaces */
  --paper: #F2F2F7;
  --paper-2: #FFFFFF;
  --paper-3: #E5E5EA;
  --ink: #1C1C1E;
  --ink-2: rgba(60, 60, 67, .6);
  --steel: rgba(60, 60, 67, .6);
  --line: var(--hairline);
  --line-strong: rgba(60, 60, 67, .45);
  --accent: #E8501C;
  --accent-deep: #C33F12;
  --accent-soft: rgba(232, 80, 28, .12);
  --accent-ink: #FFFFFF;
  --shadow-1: none;
  --shadow-2: 0 8px 30px rgba(0, 0, 0, .08);
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, .12);
}

html[data-theme='dark'] {
  --mat-bar: rgba(28, 28, 30, .72);
  --mat-sheet: rgba(28, 28, 30, .88);
  --mat-fill: rgba(120, 120, 128, .24);
  --hairline: rgba(84, 84, 88, .65);

  --paper: #000000;
  --paper-2: #1C1C1E;
  --paper-3: #2C2C2E;
  --ink: #FFFFFF;
  --ink-2: rgba(235, 235, 245, .6);
  --steel: rgba(235, 235, 245, .6);
  --line: var(--hairline);
  --line-strong: rgba(84, 84, 88, .9);
  --accent: #FF6A35;
  --accent-soft: rgba(255, 106, 53, .16);
  --accent-ink: #0B0B0C;
  --shadow-2: 0 8px 30px rgba(0, 0, 0, .6);
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, .7);
}

/* ---------- 2. base ---------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-size: var(--ios-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, .pdp-title { font-size: var(--ios-large-title); font-weight: 700; letter-spacing: 0; line-height: 1.2; }
h2 { font-size: var(--ios-title2); font-weight: 600; letter-spacing: 0; }
h3 { font-size: var(--ios-title3); font-weight: 600; letter-spacing: 0; }
.eyebrow, .hero-index .n { font-family: var(--font-sans); font-size: var(--ios-caption); letter-spacing: .04em; color: var(--steel); text-transform: none; }

/* ---------- 3. bars: translucent material ---------- */
.site-header {
  background: var(--mat-bar);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: .5px solid var(--hairline);
  box-shadow: none;
}
.announce { background: var(--mat-fill); color: var(--ink); border-bottom: .5px solid var(--hairline); }
.announce a, .announce span { color: var(--ink); font-size: var(--ios-footnote); }

/* ---------- 4. controls ---------- */
.btn {
  min-height: 48px;
  border-radius: var(--radius-pill);
  font-size: var(--ios-headline);
  font-weight: 600;
  padding-inline: 22px;
  border: .5px solid var(--hairline);
  background: var(--paper-2);
  color: var(--ink);
  transition: transform .2s cubic-bezier(.32, .72, 0, 1), opacity .2s, background .2s;
}
.btn:active { transform: scale(.97); opacity: .9; }
.btn--accent { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn--ghost { background: transparent; border-color: var(--hairline); }
.btn--block { width: 100%; }

.icon-btn { border-radius: var(--radius-pill); width: 40px; height: 40px; }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { stroke-width: 1.5; }

.lang-switch {
  border-radius: var(--radius-pill);
  background: var(--mat-fill);
  border: .5px solid var(--hairline);
  padding: 2px;
}
.lang-switch button { border-radius: var(--radius-pill); font-size: var(--ios-footnote); font-weight: 600; }
.lang-switch button[aria-pressed='true'] { background: var(--paper-2); color: var(--ink); }

.input, .select, .textarea, .field input, .field select, .field textarea {
  border-radius: var(--r-control);
  border: .5px solid var(--hairline);
  background: var(--paper-2);
  color: var(--ink);
  min-height: 48px;
  font-size: var(--ios-body);
}
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--ink-2); opacity: 1; }
.qty { border-radius: var(--radius-pill); background: var(--mat-fill); border: .5px solid var(--hairline); }
.qty button { border-radius: var(--radius-pill); }

/* ---------- 5. surfaces ---------- */
.card, .product-card, .cat-tile, .summary-card, .panel, .trust-box, .review, .order-card {
  background: var(--paper-2);
  border: .5px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
}
.product-card img, .card img, .stage img, .cat-tile img, .thumb img, .gallery img {
  border-radius: var(--r-image);
}
.product-card .media, .product-card .thumb-wrap { border-radius: var(--r-image); }
.badge, .chip, .pill, .price-off, .stock-note { border-radius: var(--radius-pill); }
.price-off, .badge--accent { background: var(--accent); color: var(--accent-ink); border: 0; }
.price, .price--now { font-weight: 700; color: var(--ink); }
.price--was { color: var(--ink-2); }

/* ---------- 6. sheets, drawer, toast ---------- */
.drawer {
  background: var(--mat-sheet);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-inline-start: .5px solid var(--hairline);
  border-start-start-radius: var(--r-sheet);
  border-end-start-radius: var(--r-sheet);
  box-shadow: var(--shadow-sheet);
}
.drawer-head { border-bottom: .5px solid var(--hairline); }
.drawer-foot { background: transparent; border-top: .5px solid var(--hairline); }
.overlay { background: rgba(0, 0, 0, .32); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }

.modal-card, .sheet, .filters-sheet {
  background: var(--mat-sheet);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-radius: var(--r-sheet);
  border: .5px solid var(--hairline);
  box-shadow: var(--shadow-sheet);
}

.toast {
  border-radius: var(--radius-pill);
  background: rgba(28, 28, 30, .92);
  color: #fff;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  padding: 10px 18px;
  font-size: var(--ios-subhead);
}
.toast--success { background: rgba(52, 199, 89, .95); color: #06220F; }

.mobile-menu { background: var(--mat-sheet); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.mobile-menu nav a { font-size: var(--ios-title3); border-radius: var(--r-control); }

/* ---------- 7. footer + sections ---------- */
.site-footer {
  background: var(--paper-2);
  color: var(--ink-2);
  border-top: .5px solid var(--hairline);
}
.site-footer h4 { color: var(--ink); font-size: var(--ios-footnote); font-weight: 600; }
.site-footer a { color: var(--ink-2); }
html[data-theme='dark'] .footer-brand img { filter: none; }

.hero { padding-block: 28px 40px; border-bottom: .5px solid var(--hairline); }
.hero-sub { font-size: var(--ios-body); color: var(--ink-2); }
.hero-meta strong { font-family: var(--font-sans); font-size: var(--ios-title2); font-weight: 700; }
.hero-meta span { font-size: var(--ios-caption); color: var(--ink-2); }
.hero-media img { border-radius: var(--r-card); }
.hero-note { border-radius: var(--radius-pill); background: var(--mat-bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: .5px solid var(--hairline); }

.section-head h2, .section-head .title { font-size: var(--ios-title2); }
.skeleton, .skeleton-line { background: var(--mat-fill); border-radius: 10px; }

/* ---------- 8. safe areas ---------- */
.site-header { padding-top: env(safe-area-inset-top); }
@media (max-width: 899px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .buy-bar { background: var(--mat-bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: .5px solid var(--hairline); }
  .buy-bar .btn { min-height: 44px; }
}

/* ---------- 9. motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn, .icon-btn { transition: none; }
  .btn:active, .icon-btn:active { transform: none; }
}

/* narrow phones: seven controls + logo must fit on one line */
@media (max-width: 480px) {
  .header-tools { gap: 0; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .lang-switch button { padding-inline: 6px; }
  .site-header .wrap { padding-inline: 10px; }
  .brand img { height: 24px; }
}

/* ---------- search-first hero ---------- */
.hero--search { padding-block: 20px 32px; border-bottom: .5px solid var(--hairline); }
.hero-line {
  font-size: var(--ios-title2);
  font-weight: 600;
  line-height: 1.35;
  margin: 6px 0 16px;
  max-width: 22ch;
}
.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 6px 8px 6px 14px;
  border-radius: 16px;
  background: var(--mat-bar);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: .5px solid var(--hairline);
  box-shadow: var(--shadow-2);
}
.hero-search__icon { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; }
.hero-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: var(--ios-body);
  font-family: inherit;
  outline: none;
  appearance: none;
}
.hero-search input::-webkit-search-cancel-button { display: none; }
.hero-search input::placeholder { color: var(--ink-2); opacity: 1; }
.hero-search__btn {
  flex: none;
  min-height: 38px;
  padding-inline: 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: var(--ios-subhead);
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.32,.72,0,1), opacity .2s;
}
.hero-search__btn:active { transform: scale(.97); opacity: .9; }

.hero-chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hero-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding-inline: 16px;
  border-radius: 999px;
  background: var(--paper-2);
  border: .5px solid var(--hairline);
  color: var(--ink);
  font-size: var(--ios-subhead);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.chip--ghost { background: transparent; color: var(--ink-2); }
.chip:active { transform: scale(.97); }

.hero-meta--inline {
  margin-top: 18px;
  padding-top: 14px;
  border-top: .5px solid var(--hairline);
  gap: 12px;
}
.hero-meta--inline strong { font-size: var(--ios-title3); }
@media (min-width: 900px) {
  .hero-line { font-size: var(--ios-title1); max-width: 26ch; }
  .hero-search { max-width: 640px; }
  .hero-chips { flex-wrap: wrap; overflow: visible; }
}

/* desktop hero: one centred column, nothing hugging the right edge */
@media (min-width: 900px) {
  .hero--search .wrap { text-align: center; }
  .hero-line { margin-inline: auto; max-width: 24ch; }
  .hero-search { margin-inline: auto; width: min(100%, 600px); }
  .hero-chips { justify-content: center; }
  .hero-meta--inline { max-width: 640px; margin-inline: auto; text-align: center; }
  .hero-meta--inline div { align-items: center; }
}

/* chips: make the scroll obvious and keep the last chip fully reachable */
.hero-chips { padding-inline: 2px; scroll-padding-inline: 16px; }
html[dir='rtl'] .hero-chips { -webkit-mask-image: linear-gradient(to left, #000 88%, transparent); mask-image: linear-gradient(to left, #000 88%, transparent); }
html[dir='ltr'] .hero-chips { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
@media (min-width: 900px) {
  html[dir='rtl'] .hero-chips, html[dir='ltr'] .hero-chips { -webkit-mask-image: none; mask-image: none; }
}

/* hero without the stats row: even rhythm into the categories section */
.hero--search { padding-block: 20px 24px; }
.hero-chips { padding-bottom: 6px; }
.hero--search + .section { padding-top: 24px; }

/* ---------- category tiles: caption bar, never text straight on a photo ---------- */
.cat-tile { border-radius: var(--r-card); border: .5px solid var(--hairline); background: var(--paper-2); }
.cat-tile img { opacity: 1; border-radius: 0; }
.cat-tile::before {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 62%;
  background: linear-gradient(to top, rgba(0, 0, 0, .42), transparent);
  pointer-events: none;
  z-index: 0;
}
.cat-tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 14px;
  border-radius: 16px;
  background: var(--mat-sheet);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: .5px solid var(--hairline);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .10);
}
.cat-tile h3 { font-size: var(--ios-headline); font-weight: 600; color: var(--ink); }
.cat-tile .count { font-size: var(--ios-footnote); color: var(--ink-2); }
.cat-tile::after {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--mat-bar);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: .5px solid var(--hairline);
  color: var(--ink);
  font-family: var(--font-sans);
}

/* section heads with the lede removed: keep the rhythm tight */
.section-head > div > h2:only-of-type { margin-bottom: 0; }
.section-head { margin-bottom: 20px; }

/* ==========================================================================
   10. shop + sheets — iOS search field, capsule controls, bottom sheets
   ========================================================================== */

/* --- search field --- */
.search-box {
  background: var(--mat-fill);
  border: 0;
  border-radius: 12px;
  min-height: 40px;
  padding-inline: 12px;
  max-width: none;
}
.search-box input { min-height: 40px; font-size: var(--ios-body); }
.search-box input::placeholder { color: var(--ink-2); opacity: 1; }
.shop-toolbar { border-bottom: 0; margin-bottom: 6px; padding-block: 10px 12px; gap: 10px; }
.result-line { font-family: var(--font-sans); font-size: var(--ios-footnote); color: var(--ink-2); }

/* --- capsule controls (sort + filter) --- */
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding-inline: 14px;
  border-radius: var(--radius-pill);
  background: var(--mat-fill);
  border: .5px solid transparent;
  color: var(--ink);
  font-size: var(--ios-subhead);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.seg-btn:active { transform: scale(.97); }
.seg-btn[aria-expanded='true'] { background: var(--ink); color: var(--paper); }
.seg-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.seg-badge {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding-inline: 5px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
}
.seg-badge[hidden] { display: none; }
.sort-select { display: none; }

/* --- chips --- */
.chip { background: var(--mat-fill); border: 0; font-size: var(--ios-footnote); padding: 7px 12px; color: var(--ink); }
.chip .x { color: var(--ink-2); }
.chips { margin-bottom: 14px; }

/* --- view toggle --- */
.view-toggle { border: 0; background: var(--mat-fill); border-radius: 10px; padding: 2px; gap: 2px; }
.view-toggle button { width: 36px; height: 32px; border-radius: 8px; }
.view-toggle button[aria-pressed='true'] { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* --- bottom sheets --- */
.sheet-grab {
  display: block;
  width: 36px;
  height: 5px;
  margin: 8px auto 2px;
  border-radius: 3px;
  background: var(--ink);
  opacity: .22;
}
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 129;
  background: rgba(0, 0, 0, .34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.sheet-backdrop[data-open='1'] { opacity: 1; pointer-events: auto; }
.sheet-backdrop[data-filters-backdrop] { z-index: 64; }

.sheet {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 130;
  max-height: 78vh;
  overflow-y: auto;
  padding: 0 0 calc(10px + env(safe-area-inset-bottom));
  border-start-start-radius: var(--r-sheet);
  border-start-end-radius: var(--r-sheet);
  border: 0;
  border-top: .5px solid var(--hairline);
  transform: translateY(105%);
  transition: transform .34s cubic-bezier(.32, .72, 0, 1);
}
.sheet[data-open='1'] { transform: none; }
.sheet[data-open='0'] { pointer-events: none; visibility: hidden; }
.sheet[data-open='1'] { visibility: visible; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 18px 8px; }
.sheet-head h2 { font-size: var(--ios-title3); font-weight: 600; color: var(--ink); }
.sheet-body { padding: 0 12px; }

.ios-list { display: flex; flex-direction: column; }
.ios-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding-inline: 8px;
  font-size: var(--ios-body);
  color: var(--ink);
  text-align: start;
  border-bottom: .5px solid var(--hairline);
  cursor: pointer;
}
.ios-row:last-child { border-bottom: 0; }
.ios-row:active { background: var(--mat-fill); }
.ios-check {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
.ios-row[aria-checked='true'] .ios-check { opacity: 1; }

/* --- filters as a real sheet on phones --- */
.filters .sheet-grab { display: none; }
.filters-foot { display: none; }
@media (max-width: 991px) {
  .filters[data-open='1'] {
    padding: 0 0 0;
    padding-inline: var(--gutter);
    border-top: .5px solid var(--hairline);
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    animation: aral-sheet-in .34s cubic-bezier(.32, .72, 0, 1);
    overscroll-behavior: contain;
  }
  .filters[data-open='1'] .sheet-grab { display: block; }
  .filters-foot {
    display: block;
    position: sticky;
    bottom: 0;
    margin-top: 8px;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    background: var(--mat-bar);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border-top: .5px solid var(--hairline);
  }
  .filters .filter-group:last-of-type { border-bottom: .5px solid var(--hairline); }
}
@keyframes aral-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop, .filters[data-open='1'] { transition: none; animation: none; }
}

/* filter button is a phone control: the desktop keeps the sidebar */
@media (min-width: 992px) { .seg-btn.filters-toggle { display: none; } }

/* sheets float instead of stretching on wide screens */
@media (min-width: 700px) {
  .sheet {
    max-width: 480px;
    margin-inline: auto;
    inset-block-end: 24px;
    border: .5px solid var(--hairline);
    border-radius: var(--r-sheet);
    padding-bottom: 10px;
  }
}

/* ---------- 11. new-arrivals rail (home 03) ---------- */
.product-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); min-width: 0; }
@media (min-width: 900px) { .product-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); } }
@media (max-width: 899px) {
  .product-rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    padding-bottom: 8px;
    scrollbar-width: none;
  }
  .product-rail::-webkit-scrollbar { display: none; }
  .product-rail > * { flex: 0 0 74%; max-width: 74%; scroll-snap-align: start; }
}

/* ---------- 12. bottom tab bar (phones) ---------- */
.tabbar { display: none; }
@media (max-width: 899px) {
  .tabbar {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 44;
    display: flex;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--mat-bar);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border-top: .5px solid var(--hairline);
    transition: transform .28s cubic-bezier(.32, .72, 0, 1);
  }
  .tabbar > a, .tabbar > button {
    flex: 1 1 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 50px;
    padding: 6px 2px 4px;
    color: var(--ink-2);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .tabbar svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .tabbar .is-active { color: var(--ink); }
  .tabbar .is-active svg { stroke-width: 2; }
  .tabbar-badge {
    position: absolute;
    top: 4px;
    inset-inline-start: 50%;
    margin-inline-start: 8px;
    display: grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding-inline: 4px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 10px;
    font-weight: 600;
  }
  .tabbar-badge[hidden] { display: none; }

  body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  body.has-buybar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.has-buybar .tabbar { transform: translateY(110%); }
  .toast-host { inset-block-end: calc(64px + env(safe-area-inset-bottom)); }
}

/* ---------- 13. cart drawer becomes a bottom sheet on phones ---------- */
@media (max-width: 899px) {
  .drawer, html[dir='rtl'] .drawer {
    inset-block: auto 0;
    inset-inline: 0;
    width: auto;
    max-height: 86vh;
    border-inline-start: 0;
    border-top: .5px solid var(--hairline);
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    box-shadow: var(--shadow-sheet);
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .drawer[data-open='1'], html[dir='rtl'] .drawer[data-open='1'] { transform: none; }
  .drawer-head { position: relative; padding-top: 20px; border-bottom: .5px solid var(--hairline); }
  .drawer-head::before {
    content: '';
    position: absolute;
    top: 8px;
    inset-inline-start: 50%;
    transform: translateX(50%);
    width: 36px;
    height: 5px;
    border-radius: 3px;
    background: var(--ink);
    opacity: .22;
  }
  html[dir='ltr'] .drawer-head::before { transform: translateX(-50%); }
  .drawer-foot { border-top: .5px solid var(--hairline); background: transparent; }
}

/* ---------- 14. product share row ---------- */
.pdp-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pdp-share .seg-btn { text-decoration: none; }
.pdp-share .seg-btn svg { width: 16px; height: 16px; }

/* ---------- 15. page background: a visible vertical gradient ---------- */
/* fixed attachment so the warm top and cool bottom span every viewport,
   not the whole (very long) document */
body {
  background-color: var(--paper);
  background-image: linear-gradient(180deg, #FFF9EF 0%, #F4F2F8 50%, #DFDDEC 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: 100% 100%;
}
html[data-theme='dark'] body {
  background-color: #000;
  background-image: linear-gradient(180deg, #2C2721 0%, #121212 55%, #000000 100%);
}

/* ---------- 16. footer brand: ink logo in light, white in dark ---------- */
.footer-brand .logo-ink, .footer-brand .logo-white {
  display: block;
  width: 132px;
  height: auto;
  margin-bottom: 14px;
}
.footer-brand .logo-white { display: none; }
html[data-theme='dark'] .footer-brand .logo-ink { display: none; }
html[data-theme='dark'] .footer-brand .logo-white { display: block; }
@media (max-width: 899px) {
  .footer-brand .logo-ink, .footer-brand .logo-white { width: 112px; margin-bottom: 10px; }
}

/* ---------- 17. product imagery: the radius comes from the wrapper ---------- */
.product-media,
.product-media a,
.pdp .stage,
.gallery .thumb,
.thumbs button,
.cart-line a,
.summary-line .thumb-wrap {
  overflow: hidden;
  border-radius: var(--r-image);
  isolation: isolate;
}
.product-media img,
.pdp .stage img,
.gallery .thumb img,
.thumbs button img {
  display: block;
  border-radius: inherit;
}
.product-media img { object-fit: cover; }
.product-media a { display: block; }
.cart-line img { border-radius: var(--r-image); }
.cart-line a { display: block; }

/* ---------- 18. cards clip their own media: same curve inside and out ---------- */
.product-card {
  overflow: hidden;
  border-radius: var(--r-card);
}
.product-card .product-media {
  border-radius: var(--r-card);
  margin: 0;
}
.product-card .product-media img { border-radius: inherit; }
.product-card .product-body { border-end-start-radius: var(--r-card); border-end-end-radius: var(--r-card); }
/* product detail gallery + thumbnails */
.pdp .stage { border-radius: var(--r-card); }
.pdp .stage img { border-radius: inherit; }
.thumbs button, .gallery .thumb { border-radius: var(--r-image); }
/* cart drawer + cart page line thumbnails */
.cart-line img, .cart-line a { border-radius: 16px; }

/* ---------- 19. product image floats inside the card ---------- */
.product-card { border-radius: var(--r-card); }
.product-card .product-media {
  margin: 8px 8px 0;
  border-radius: 18px;
}
.product-card .product-media img { border-radius: inherit; }
.product-card .product-body { padding-top: 10px; }
/* product detail: same breathing room around the stage image */
.pdp .stage { padding: 8px; border-radius: var(--r-card); }
.pdp .stage img { border-radius: 18px; }
/* cart drawer + cart page thumbnails */
.cart-line img, .cart-line a { border-radius: 14px; }

/* ---------- 20. compact product cards (smaller footprint everywhere) ---------- */
.product-card { border-radius: 20px; }
.product-card .product-media {
  aspect-ratio: 1 / 1;
  margin: 8px 8px 0;
  border-radius: 15px;
}
.product-card .product-media img { border-radius: inherit; }
.product-body { padding: 8px 10px 12px; gap: 1px; }
.product-cat { font-size: 9px; }
.product-name { font-size: 13px; line-height: 1.35; }
.product-name a {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.price-row { margin-top: 2px; gap: 6px; }
.price { font-size: 13px; }
.price--was { font-size: 10px; }
.price-off { font-size: 9px; padding: .1rem .35rem; }
.quick-add .btn { height: 32px; font-size: 12px; padding-block: 0; }
.badge-flag { font-size: 9px; padding: .12rem .4rem; }
.stock-note, .rating { font-size: 10px; }
.product-grid { gap: var(--s3); }
.product-rail { gap: var(--s3); }
@media (min-width: 900px) { .product-grid { gap: var(--s4); } }

/* ---------- 21. one media contract: every wrapper clips, every image follows the curve ---------- */
.product-media,
.product-media a,
.week-offer-media,
.pdp .stage,
.gallery .thumb,
.thumbs button,
.cart-line a,
.summary-line .thumb-wrap,
.cat-tile,
.admin-table .thumb,
.order-card img,
.review img {
  overflow: hidden;
}
.product-media img,
.week-offer-media img,
.pdp .stage img,
.gallery .thumb img,
.thumbs button img,
.cart-line img,
.summary-line .thumb-wrap img,
.cat-tile img,
.admin-table .thumb,
.order-card img,
.review img {
  border-radius: inherit;
}

/* ---------- 22. one imagery treatment everywhere: square frame, cover, inherited radius ---------- */
.product-card .product-media,
.week-offer-media,
.pdp .stage,
.gallery .thumb,
.thumbs button,
.cart-line a,
.summary-line .thumb-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.product-card .product-media img,
.week-offer-media img,
.pdp .stage img,
.gallery .thumb img,
.thumbs button img,
.cart-line img,
.summary-line .thumb-wrap img,
.admin-table img.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
  border-radius: inherit;
  display: block;
}
.cart-line img { width: 64px; height: 64px; }
