/* Lina Line: a clean fashion store. White ground so her photos show true colour,
   black type, square photo edges, one action colour (WhatsApp green) used nowhere else. */
:root {
  --bg: #ffffff;
  --soft: #f5f5f4;       /* photo placeholders, footer, quiet panels */
  --ink: #111111;
  --muted: #5f5f5f;      /* 6.4:1 on white */
  --line: #e4e4e4;
  --sale: #c8102e;       /* sale price + badge, 5.9:1 on white */
  --wa: #15803d;         /* the one action colour, white text 5.0:1 */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: 128px;
  scroll-padding-bottom: calc(var(--nav-h) + var(--safe-b));
}
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  font-family: "Alexandria", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  padding: 0 env(safe-area-inset-right) calc(var(--nav-h) + var(--safe-b)) env(safe-area-inset-left);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
p { margin: 0; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.skip { position: fixed; top: 8px; inset-inline-start: 8px; z-index: 100; padding: 12px 16px; background: var(--ink); color: #fff; font-weight: 600; transform: translateY(-200%); }
.skip:focus-visible { transform: none; }
h1, h2, h3, .card-name, .promo-title { text-wrap: balance; }
p, li { text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
button, a, .chip { touch-action: manipulation; }
button, .chip, .bottom a, .seal { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

.ms {
  font-family: "Material Symbols Rounded";
  font-size: 24px; width: 1em; height: 1em; line-height: 1;
  display: inline-block; overflow: hidden; flex: none;
  font-weight: normal; font-style: normal; letter-spacing: normal; text-transform: none;
  white-space: nowrap; direction: ltr; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased;
}

.title { margin: 36px 0 14px; font-size: 20px; font-weight: 700; line-height: 1.35; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 12px; align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 16px 0;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.seal { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 48px; }
.seal img { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); }
.seal-name { display: none; font-size: 18px; font-weight: 700; }
.search { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 12px; background: var(--soft); border: 1px solid transparent; border-radius: 4px; }
.search:focus-within { border-color: var(--ink); background: var(--bg); }
.search .ms { color: var(--muted); font-size: 20px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; padding: 10px 0; outline: none; color: var(--ink); caret-color: var(--ink); }
.search input::placeholder { color: var(--muted); }
/* Category tabs: always there, like every fashion app. */
.chips { grid-column: 1 / -1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 4px -16px 0; padding: 0 12px; overscroll-behavior-x: contain; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; transition: color .15s, border-color .15s; }
.chip[aria-pressed="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }

/* Delivery terms strip */
.info { display: grid; gap: 2px; padding: 8px 16px; background: var(--soft); font-size: 13px; text-align: center; }
.info p { display: flex; align-items: center; justify-content: center; gap: 6px; }
.info .ms { font-size: 18px; }
#announce { font-weight: 700; }

/* ---------- Bottom nav (phone) ---------- */
.bottom {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; background: var(--bg); border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right) var(--safe-b) env(safe-area-inset-left);
}
.bottom a, .box-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h); padding: 0; border: 0; background: none; font-size: 11px; color: var(--muted); cursor: pointer; }
.bottom a[aria-current="page"], .box-btn { color: var(--ink); font-weight: 600; }
.bottom a:active .ms, .box-btn:active .ms { transform: scale(.9); }
.box-ic { position: relative; display: grid; place-items: center; }
.box-n { position: absolute; top: -5px; inset-inline-end: -9px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.box-ic.bump { animation: bump .45s var(--ease); }
@keyframes bump { 30% { transform: scale(1.25); } 60% { transform: scale(.92); } }

/* ---------- Sections ---------- */
main { display: block; }
section { padding: 0 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.more { min-height: 44px; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* Categories: square photo tiles, edge to edge. */
.cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 4px; margin: 0 -16px; padding: 0 4px; }
.cat { display: grid; gap: 6px; padding: 0; border: 0; background: none; text-align: center; cursor: pointer; }
.cat-well { display: block; aspect-ratio: 1; overflow: hidden; background: var(--soft); }
.cat-ic { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.cat:active .cat-ic { transform: scale(.97); }
.cat-name { font-size: 13px; font-weight: 600; line-height: 1.35; }

/* Live offer (set in the admin): flat block in its theme colour. */
.tag { margin-top: 16px; }
.tag-in { display: grid; justify-items: start; gap: 6px; padding: 20px; background: var(--tag-bg, var(--ink)); color: #fff; }
.tag-title { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.3; }
.tag-off { font-size: 16px; }
.tag-off b { font-weight: 700; color: var(--tag-tape, #fff); font-variant-numeric: tabular-nums; }
.tag-timer { display: flex; gap: 4px; margin: 4px 0; }
.tag-timer span { display: grid; justify-items: center; min-width: 52px; padding: 6px 4px; background: rgb(255 255 255 / .12); font-size: 11px; }
.tag-timer b { font-size: 20px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tag-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 48px; margin-top: 4px; padding: 0 20px; padding-inline-end: 12px; border: 0; background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; }

/* Featured product */
.promo { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; margin-top: 36px; padding: 0; padding-inline-end: 8px; border: 0; background: var(--soft); text-align: start; cursor: pointer; overflow: hidden; }
.promo img { width: 112px; height: 140px; object-fit: cover; transition: transform .45s var(--ease); }
.promo-text { display: grid; gap: 4px; min-width: 0; }
.promo-title { font-size: 16px; font-weight: 600; line-height: 1.45; }
.promo-price { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Rails */
.rail { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; overscroll-behavior-x: contain; }
.rail::-webkit-scrollbar { display: none; }
.rail .card { flex: 0 0 44%; max-width: 220px; scroll-snap-align: start; }

/* Product grid + cards: big photos, square edges, price always shown. */
.all { padding-bottom: 40px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 4px; margin: 0 -12px; }
.card { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: start; cursor: pointer; }
.thumb { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.card:active .thumb img { transform: scale(.98); }
.badge { position: absolute; top: 8px; inset-inline-start: 8px; padding: 2px 8px; background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 600; }
.badge.sale { background: var(--sale); color: #fff; }
.badge.out { background: var(--ink); color: #fff; }
.card.is-out .thumb img { filter: grayscale(.8); opacity: .65; }
.card-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 8px 4px 0; font-size: 13px; line-height: 1.5; min-height: 3em; overflow-wrap: anywhere; }
.price { display: block; margin: 2px 4px 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.grid .card-name, .grid .price { margin-inline: 12px 4px; }
.grid .card:nth-child(2n) .card-name, .grid .card:nth-child(2n) .price { margin-inline: 4px 12px; }
.price.ask { font-size: 13px; font-weight: 400; color: var(--muted); }
.price:has(.was) { color: var(--sale); }
.was { font-size: .85em; font-weight: 400; color: var(--muted); }
.empty { display: grid; gap: 16px; justify-items: center; padding: 32px 0; text-align: center; color: var(--muted); }

/* ---------- Footer ---------- */
.base { background: var(--soft); }
.base-in { padding: 8px 16px 32px; }
.base ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.branch-list li { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.branch-list strong { color: var(--ink); font-weight: 600; }
.social a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.social i, .social .ms { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 8px; color: #fff; font-size: 20px; }
.social span:not(.ms) { flex: 1; display: grid; grid-template-columns: auto auto; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: 14px; line-height: 1.3; }
.social small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 400; font-size: 14px; }
.s-ig i { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.s-tt i { background: #000; text-shadow: -1.5px -1px 0 #25f4ee, 1.5px 1px 0 #fe2c55; }
.s-sc i { background: #fffc00; color: #000; -webkit-text-stroke: .6px #000; }
.s-fb i { background: #1877f2; }
.s-wa i { background: #25d366; }
.s-call .ms { background: var(--ink); }
.credit { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; width: fit-content; max-width: 100%; margin: 32px auto 0; padding: 6px 6px 6px 18px; padding-inline-start: 18px; border-radius: 999px; background: var(--ink); color: rgb(255 255 255 / .7); font-size: 12px; box-shadow: 0 6px 20px rgb(0 0 0 / .18); }
.credit b { color: #fff; font-weight: 800; letter-spacing: .06em; }
.credit a { min-height: 32px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; background: rgb(255 255 255 / .12); color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Sheets (product + bag) ---------- */
dialog#sheet, dialog#box {
  width: 100%; max-width: 520px; max-height: 94dvh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 12px 12px 0 0; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); color: var(--ink);
}
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog[open] { animation: sheet-up .26s var(--ease); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-tools { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 1; display: flex; gap: 8px; }
.sheet-tools form, .box-head form { margin: 0; }
.icon-btn { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .94); color: var(--ink); cursor: pointer; }
.icon-btn:active { transform: scale(.92); }
.sheet-img { position: relative; background: var(--soft); }
.gal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.gal::-webkit-scrollbar { display: none; }
.gal img { flex: 0 0 100%; width: 100%; max-height: 58dvh; object-fit: contain; scroll-snap-align: center; }
.gal-dots { position: absolute; bottom: 10px; inset-inline: 0; display: flex; justify-content: center; gap: 6px; }
.gal-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgb(0 0 0 / .25); }
.gal-dots i.on { background: var(--ink); }
.sheet-body { display: grid; gap: 8px; padding: 16px 16px calc(16px + var(--safe-b)); }
.sheet-body h3 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.sheet-cat { font-size: 13px; color: var(--muted); }
.big-price .price { margin: 0; font-size: 22px; }
.big-price .price.ask { font-size: 16px; }
.sheet-desc { line-height: 1.75; color: #333; }
.sheet-save { justify-self: start; padding: 2px 8px; background: var(--sale); color: #fff; font-size: 13px; font-weight: 600; }
.sheet-stock { color: var(--sale); font-size: 14px; font-weight: 600; }
.sizes { margin: 8px 0 0; padding: 0; border: 0; min-width: 0; }
.sizes legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; }
.sizes div { display: flex; flex-wrap: wrap; gap: 8px; }
.sizes label { position: relative; }
.sizes input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.sizes span { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 48px; height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; cursor: pointer; transition: border-color .15s; }
.sizes span img { width: 28px; height: 28px; object-fit: cover; }
.sizes span i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.sizes input:checked + span { border: 2px solid var(--ink); font-weight: 700; }
.sizes input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.sizes input:disabled + span { color: #aaa; cursor: not-allowed; text-decoration: line-through; }
.sizes small { font-size: 12px; }
.sheet-details { display: grid; gap: 4px; margin: 4px 0 0; padding: 12px 0; padding-inline-start: 20px; border-block: 1px solid var(--line); font-size: 14px; line-height: 1.6; color: #333; }
.sheet-actions { display: grid; gap: 8px; margin-top: 8px; }
.wa-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border-radius: 4px; background: var(--wa); color: #fff; font-size: 16px; font-weight: 600; transition: filter .15s, transform .1s; }
.wa-btn:active { transform: scale(.99); filter: brightness(.92); }
.wa-btn[aria-disabled="true"] { background: #9a9a9a; cursor: pointer; }
.add-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 1px solid var(--ink); border-radius: 4px; background: var(--bg); color: var(--ink); font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s, transform .1s; }
.add-btn:active { transform: scale(.99); }
.add-btn:disabled, .add-btn[aria-disabled="true"] { border-color: var(--line); color: #9a9a9a; }
.sheet-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.sheet-note .ms { font-size: 20px; }

/* Bag */
.box-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 4px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.box-head .title { margin: 0; }
.box-list { display: grid; margin: 0; padding: 0 16px; list-style: none; }
.box-list li { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.box-item { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0; border: 0; background: none; text-align: start; cursor: pointer; }
.box-item img { width: 64px; height: 80px; flex: none; object-fit: cover; background: var(--soft); }
.box-item > span { display: grid; gap: 2px; min-width: 0; }
.box-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.box-item small { color: var(--muted); font-size: 13px; }
.box-price { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.box-del { flex: none; background: none; color: var(--muted); }
.box-empty { padding: 32px 24px; color: var(--muted); text-align: center; line-height: 1.8; }
.box-foot { display: grid; gap: 10px; padding: 16px 16px calc(16px + var(--safe-b)); }
.box-total { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 15px; }
.box-total b { font-size: 20px; font-variant-numeric: tabular-nums; }
.box-total small { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.link-btn { justify-self: center; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* Checkout (inside the bag) */
.checkout { display: grid; gap: 14px; padding: 16px 16px calc(16px + var(--safe-b)); }
.co-lead { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.co-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.co-field small { color: var(--muted); font-weight: 400; }
.co-field input, .co-field select, .co-field textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #bdbdbd; border-radius: 4px; background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; }
.co-field textarea { min-height: 0; resize: vertical; }
.co-field :focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.co-field[data-bad] input, .co-field[data-bad] select { border: 2px solid var(--sale); }
#co-vnote { color: var(--sale); }
.co-sum { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; padding: 12px 0; border-block: 1px solid var(--line); font-size: 15px; font-variant-numeric: tabular-nums; }
.co-sum dd { margin: 0; text-align: end; }
.co-sum .tot { font-size: 18px; font-weight: 700; }
.co-sum small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.co-err { margin: 0; color: var(--sale); font-size: 14px; font-weight: 600; }
.box-how { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.co-hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.co-steps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: st; font-size: 13px; color: var(--muted); }
.co-steps li { flex: 1; display: grid; justify-items: center; gap: 4px; padding-top: 4px; border-top: 3px solid var(--line); counter-increment: st; text-align: center; }
.co-steps li::before { content: counter(st); font-weight: 700; }
.co-steps li.on { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.co-steps li.ok { border-color: var(--wa); color: var(--wa); }
.co-find { position: relative; display: grid; gap: 6px; }
.co-hits { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 4px; }
.co-hits button { display: flex; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; text-align: start; cursor: pointer; }
.co-hits li:last-child button { border-bottom: 0; }
.co-hits small { color: var(--muted); font-size: 13px; }
.co-hits p { margin: 0; padding: 12px; color: var(--muted); font-size: 14px; }
.co-done { display: grid; justify-items: center; gap: 10px; padding: 32px 24px calc(24px + var(--safe-b)); text-align: center; line-height: 1.8; }
.co-done > .ms { font-size: 48px; color: var(--wa); }
.co-done h3, .co-done p { margin: 0; }
.co-done .co-sum, .co-done .wa-btn, .co-done .co-steps { width: 100%; }
.co-done .co-sum { text-align: start; }
.co-last { padding: 10px 12px; border-radius: 4px; background: #f0fdf4; }
.co-done .wa-btn .fa-brands { font-size: 22px; }

/* Add-to-bag motion + toast */
.ghost { position: fixed; z-index: 60; object-fit: cover; pointer-events: none; box-shadow: 0 10px 24px rgb(0 0 0 / .25); }
.toast { position: fixed; inset-inline: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 50; width: fit-content; max-width: calc(100% - 32px); margin-inline: auto; padding: 10px 18px; border-radius: 4px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; text-align: center; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .25s var(--ease); }
.toast.on { opacity: 1; transform: none; }
.toast:empty { display: none; }

@media (hover: hover) and (pointer: fine) {
  .chip:hover, .bottom a:hover { color: var(--ink); }
  .card:hover .thumb img, .cat:hover .cat-ic, .promo:hover img { transform: scale(1.03); }
  .card:hover .card-name { text-decoration: underline; text-underline-offset: 3px; }
  .social a:hover span:not(.ms) { text-decoration: underline; text-underline-offset: 3px; }
  .wa-btn:hover { filter: brightness(1.08); }
  .add-btn:hover:not(:disabled, [aria-disabled="true"]) { background: var(--ink); color: #fff; }
  .tag-btn:hover { opacity: .9; }
  .link-btn:hover { color: var(--ink); }
}

/* Landscape phones: short screens can't afford a sticky header. */
@media (orientation: landscape) and (max-height: 500px) {
  .top { position: static; }
  html { scroll-padding-top: 0; }
  dialog#sheet, dialog#box { max-height: 100dvh; }
  .gal img { max-height: 70dvh; }
}

@media (min-width: 400px) { .seal-name { display: inline; } }
@media (min-width: 560px) { .cats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 760px) {
  main, .base-in { max-width: 1280px; margin-inline: auto; }
  section, .base-in { padding-inline: 24px; }
  .cats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 8px; margin: 0; padding: 0; }
  .rail { margin: 0; padding-inline: 0; }
  .rail .card { flex: 0 0 220px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 32px 8px; margin: 0; }
  .grid .card .card-name, .grid .card .price { margin-inline: 4px; }
  dialog#sheet, dialog#box { margin: auto; border-radius: 8px; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  html { scroll-padding-top: 120px; scroll-padding-bottom: 0; }
  .top { grid-template-columns: auto minmax(0, 480px) 1fr; gap: 0 32px; padding: 8px max(24px, calc((100% - 1280px) / 2 + 24px)) 0; }
  .seal-name { font-size: 20px; }
  .chips { margin: 4px 0 0; padding: 0; justify-content: center; }
  .bottom { position: static; grid-column: 3; justify-self: end; gap: 4px; padding: 0; border: 0; background: none; }
  .bottom a, .box-btn { flex-direction: row; gap: 6px; min-height: 44px; padding: 0 12px; font-size: 14px; }
  .bottom a .ms, .box-btn .ms { font-size: 20px; }
  .toast { bottom: 24px; }
  .title { font-size: 24px; margin: 48px 0 18px; }
  .cat-name { font-size: 14px; }
  .promo { grid-template-columns: 200px minmax(0, 1fr) auto; padding-inline-end: 32px; }
  .promo img { width: 200px; height: 250px; }
  .promo-title { font-size: 22px; }
  .promo-price { font-size: 22px; }
  .tag-in { grid-template-columns: minmax(0, 1fr) auto; column-gap: 40px; align-items: center; padding: 32px 40px; }
  .tag-in > * { grid-column: 1; }
  .tag-timer { grid-column: 2; grid-row: 1 / 3; }
  .tag-btn { grid-column: 2; grid-row: 3; justify-self: end; }
  .tag-title { font-size: 36px; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 40px 12px; }
  .card-name { font-size: 14px; }
  .base-in { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; padding-bottom: 48px; }
  .base-in > :nth-child(1), .base-in > :nth-child(2) { grid-column: 1; }
  .base-in > :nth-child(3) { grid-column: 2; grid-row: 1; }
  .base-in > :nth-child(4) { grid-column: 2; grid-row: 2; }

  dialog#sheet { max-width: 1000px; max-height: 90dvh; display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden; }
  dialog#sheet:not([open]) { display: none; }
  .sheet-img { display: grid; place-items: center; min-height: 0; overflow: hidden; }
  .gal { width: 100%; height: 100%; }
  .gal img { max-height: 90dvh; height: 100%; object-fit: cover; }
  .sheet-body { align-content: start; padding: 64px 40px 40px; overflow-y: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Photo viewer: tap to zoom ---------- */
dialog#viewer { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #fff; }
dialog#viewer[open] { animation: none; }
dialog#viewer form { margin: 0; }
.viewer-close { position: fixed; top: calc(10px + env(safe-area-inset-top)); inset-inline-end: 10px; z-index: 2; box-shadow: 0 1px 4px rgb(0 0 0 / .15); }
.viewer-pan { width: 100%; height: 100%; overflow: auto; cursor: zoom-in; }
.viewer-pan img { width: 100%; height: 100%; object-fit: contain; }
dialog#viewer.zoom .viewer-pan { cursor: zoom-out; }
dialog#viewer.zoom .viewer-pan img { width: 250%; height: auto; max-width: none; object-fit: initial; }
.gal img { cursor: zoom-in; }

/* ---------- Sheet: order button stays under the thumb ---------- */
.sheet-actions { position: sticky; bottom: 0; z-index: 1; margin: 8px -16px 0; padding: 10px 16px calc(10px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); }
.sheet-body { padding-bottom: 0; }
.sheet-note { order: 0; }
.sheet-ask { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); font-weight: 400; }
.related { padding: 8px 0 20px; }
.related h4 { margin: 8px 0 10px; font-size: 16px; font-weight: 700; }
.related .rail { margin: 0 -16px; }
.related .card { flex-basis: 38%; }

.more-btn { display: block; width: 100%; max-width: 360px; min-height: 52px; margin: 28px auto 0; border: 1px solid var(--ink); border-radius: 4px; background: var(--bg); font-weight: 600; cursor: pointer; }
.more-btn:active { background: var(--soft); }

/* Arabic reads better above the 16px web minimum. */
body { font-size: 17px; }
.card-name { font-size: 14px; }
.sheet-desc { font-size: 17px; }

@media (hover: hover) and (pointer: fine) {
  .more-btn:hover { background: var(--ink); color: #fff; }
}
@media (min-width: 760px) {
  .related .rail { margin: 0; padding: 0; }
  .related .card { flex-basis: 160px; }
}
@media (min-width: 1024px) {
  .sheet-actions { margin-inline: -40px; padding-inline: 40px; }
  .sheet-body { padding-bottom: 0; }
}

/* Countdown boxes share the width on narrow phones instead of overflowing. */
@media (max-width: 1023px) {
  .tag-timer { align-self: stretch; max-width: 320px; }
  .tag-timer span { flex: 1 1 0; min-width: 0; }
}
/* The related rail must never widen the sheet's single column. */
.sheet-body { grid-template-columns: minmax(0, 1fr); }

/* Sub-sections inside a category (بناتي / ولادي): segmented buttons under the title. */
.subs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -4px -16px 16px; padding: 0 16px; }
.subs::-webkit-scrollbar { display: none; }
.sub { flex: none; min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); font-size: 15px; font-weight: 500; cursor: pointer; transition: border-color .15s, background-color .15s; }
.sub small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sub[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 700; }
.sub[aria-pressed="true"] small { color: rgb(255 255 255 / .75); }
@media (hover: hover) and (pointer: fine) { .sub:hover { border-color: var(--ink); } }
@media (min-width: 760px) { .subs { margin-inline: 0; padding: 0; } }

/* ---------- UX pass (Nov 30) ---------- */
/* Phone: fade the chip row's far edge so it reads as "scroll for more". */
@media (max-width: 1023px) {
  .chips { -webkit-mask-image: linear-gradient(to left, transparent, #000 28px); mask-image: linear-gradient(to left, transparent, #000 28px); padding-inline-end: 28px; }
}
.bottom a, .box-btn { font-size: 12px; }
/* Mouse users can't swipe: wrap the chips and give swipe rows a thin scrollbar. */
@media (hover: hover) and (pointer: fine) {
  .chips { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; padding-inline-end: 0; }
  .rail, .gal, .subs { scrollbar-width: thin; }
  .rail::-webkit-scrollbar, .gal::-webkit-scrollbar, .subs::-webkit-scrollbar { display: block; height: 8px; }
  .rail::-webkit-scrollbar-thumb, .gal::-webkit-scrollbar-thumb, .subs::-webkit-scrollbar-thumb { background: #c4c4c4; border-radius: 4px; }
}
@media (min-width: 1024px) { .chip { min-width: 44px; padding: 0 7px; } }
/* Tapping "choose a size/colour first" points at the missing choice. */
.sizes.nudge legend { color: var(--sale); animation: nudge .4s var(--ease); }
@keyframes nudge { 25% { transform: translateX(6px); } 75% { transform: translateX(-6px); } }
