/* Selvage — clothing store. Tokens first. */
:root {
  --ink: #2a2326;
  --indigo: #5b3a4a;
  --rinse: #e9c7d5;
  --stitch: #a12b5b;          /* berry: the one accent */
  --stitch-hover: #8a2250;
  --on-dark: #f3b9d0;         /* accent text on dark bars */
  --bg: #fdfbfb;
  --surface: #ffffff;
  --text: #2a2326;
  --muted: #76696f;
  --line: #eadfe3;
  --field: #ffffff;
  --tile-a: #f5ebef;
  --tile-b: #f0e3e8;
  --focus: #2a2326;
  --danger: #b3261e;
  --ok: #1f7a4d;
  --pressed-bg: var(--ink);
  --pressed-fg: #fff;
  --toast-bg: var(--ink);
  --toast-fg: #fff;
  color-scheme: light;
  --radius: 10px;
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
}
:root[data-theme="dark"] {
  --bg: #171214;
  --surface: #211a1d;
  --text: #f5eef0;
  --muted: #b7a8ae;
  --line: #3a2e33;
  --field: #171214;
  --focus: #f5eef0;
  --stitch: #d9588a;
  --stitch-hover: #e56f9d;
  --tile-a: #2a2125;
  --tile-b: #31262b;
  --danger: #ff8a80;
  --ok: #6fd6a2;
  --pressed-bg: var(--stitch);
  --toast-bg: #f5eef0;
  --toast-fg: #2a2326;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #171214;
    --surface: #211a1d;
    --text: #f5eef0;
    --muted: #b7a8ae;
    --line: #3a2e33;
    --field: #171214;
    --focus: #f5eef0;
    --stitch: #d9588a;
    --stitch-hover: #e56f9d;
    --tile-a: #2a2125;
    --tile-b: #31262b;
    --danger: #ff8a80;
    --ok: #6fd6a2;
    --pressed-bg: var(--stitch);
    --toast-bg: #f5eef0;
    --toast-fg: #2a2326;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--stitch); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }


/* ---------- Garment drawing ---------- */
.line-img { display: grid; place-content: center; }


/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  border: 2px solid transparent; font-weight: 600; text-decoration: none; letter-spacing: -.005em;
  transition: background-color .18s, border-color .18s, transform .18s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--stitch); color: #fff; }
.btn-primary:hover { background: var(--stitch-hover); }
.btn-line { border-color: currentColor; background: transparent; }
.btn-line:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link { color: inherit; font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-color: var(--stitch); }
.link:hover { text-decoration-color: currentColor; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; background: transparent; border-radius: 50%; text-decoration: none;
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.icon-btn svg { width: 24px; height: 24px; }
.badge {
  position: absolute; top: 3px; inset-inline-end: 1px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--stitch); color: #fff;
  font-size: .72rem; font-weight: 700; display: grid; place-items: center; line-height: 1;
}
.badge:empty, .badge[data-n="0"] { display: none; }


/* ---------- Announcement + header ---------- */
.header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 68px; gap: 16px; }
.logo { text-decoration: none; font-size: 1.65rem; font-weight: 700;  line-height: 1; justify-self: start; padding-bottom: 7px; position: relative; }
.logo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 2px dashed var(--stitch); }
.nav { display: flex; gap: 6px; }
.nav a { padding: 10px 14px; border-radius: 999px; text-decoration: none; font-weight: 500; }
.nav a:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.nav a[aria-current="page"] { background: var(--pressed-bg); color: var(--pressed-fg); }
.actions { display: flex; justify-content: flex-end; gap: 2px; }
.only-mobile { display: none; }
@media (max-width: 880px) {
  .header-in { grid-template-columns: auto 1fr auto; }
  .nav { display: none; }
  .only-mobile { display: inline-grid; }
  .logo { justify-self: center; }
}


/* ---------- Dialogs / drawers ---------- */
dialog { border: 0; padding: 0; color: var(--text); background: var(--surface); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(30, 20, 25, .55); backdrop-filter: blur(2px); }
.drawer { margin: 0 auto 0 0; width: min(440px, 100vw); height: 100dvh; flex-direction: column; }
.drawer[open] { display: flex; animation: slide-in .3s var(--ease); }

@keyframes slide-in { from { transform: translateX(-40px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 14px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.35rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px; overscroll-behavior: contain; }
.drawer-foot { padding: 18px 24px 24px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.ship-meter { padding: 16px 24px; background: color-mix(in srgb, var(--stitch) 16%, var(--surface)); border-bottom: 1px solid var(--line); font-size: .92rem; }
.ship-meter .bar { height: 6px; background: color-mix(in srgb, var(--text) 14%, transparent); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.ship-meter .bar i { display: block; height: 100%; background: var(--stitch); border-radius: 99px; transition: width .5s var(--ease); }
.line-item { display: grid; grid-template-columns: 84px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-img { aspect-ratio: 4 / 5; background: var(--tile-a); border-radius: 8px; padding: 8px; }
.line-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.line-top a { text-decoration: none; }
.line-meta { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.line-bot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; }
.qty button { width: 38px; height: 38px; border: 0; background: transparent; border-radius: 50%; font-size: 1.25rem; line-height: 1; }
.qty button:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.qty output { min-width: 26px; text-align: center; font-weight: 600; }
.text-btn { border: 0; background: none; padding: 8px 4px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: .9rem; }
.text-btn:hover { color: var(--text); }
.empty { text-align: center; padding: 56px 16px; display: grid; gap: 14px; justify-items: center; }
.empty h3 { font-size: 1.4rem; }
.empty p { color: var(--muted); max-width: 36ch; }
.row { display: flex; justify-content: space-between; gap: 12px; }
.row.total { font-size: 1.15rem; font-weight: 700; }
.fine { color: var(--muted); font-size: .875rem; }
.sheet { margin: 0; width: 100vw; height: 100dvh; }
.sheet[open] { animation: fade-in .2s; }

@keyframes fade-in { from { opacity: 0; } }
.search-top { display: flex; align-items: center; gap: 8px; padding: 14px var(--gutter); border-bottom: 1px solid var(--line); }
.search-top input { flex: 1; min-width: 0; font-size: 1.4rem; font-weight: 600; border: 0; background: transparent; padding: 10px 4px; letter-spacing: -.02em; }
.search-top input:focus { outline: none; }
.search-top input::placeholder { color: var(--muted); font-weight: 500; }
.search-res { max-width: 760px; margin: 0 auto; padding: 24px var(--gutter); }
.search-res li a { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 10px 8px; border-radius: 10px; text-decoration: none; }
.search-res li a:hover, .search-res li a:focus-visible { background: color-mix(in srgb, var(--text) 7%, transparent); }
.search-res .thumb { aspect-ratio: 1; background: var(--tile-a); border-radius: 8px; padding: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: transparent; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--pressed-bg); color: var(--pressed-fg); border-color: var(--pressed-bg); }
.menu-links { display: grid; padding: 12px var(--gutter); }
.menu-links a { padding: 18px 0; font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em; text-decoration: none; border-bottom: 1px solid var(--line); }


/* ---------- Hero ---------- */
.hero { padding: clamp(24px, 4vw, 56px) 0 clamp(40px, 6vw, 80px); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.8rem); line-height: 1.2; max-width: 14ch; }
.hero-copy p { margin-top: 24px; font-size: 1.15rem; color: var(--muted); max-width: 44ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hang { position: absolute; top: 0; left: 9%; transform-origin: 50% 0; animation: swing 2.6s .35s var(--ease) both; z-index: 2; }

@keyframes swing { 0% { transform: rotate(-16deg); } 22% { transform: rotate(10deg); } 42% { transform: rotate(-6deg); } 62% { transform: rotate(3deg); } 82% { transform: rotate(-1.2deg); } 100% { transform: rotate(0); } }
.hang-string { width: 2px; height: 46px; margin: 0 auto; background: var(--stitch); }
.hang-card {
  position: relative; width: 138px; padding: 26px 14px 14px; background: #fff8fa; color: var(--ink);
  clip-path: polygon(14% 0, 86% 0, 100% 10%, 100% 100%, 0 100%, 0 10%); text-align: left;
}
.hang-card::before { content: ""; position: absolute; top: 9px; left: 50%; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: var(--ink); }
.hang-card b { display: block; font-size: .98rem; line-height: 1.15; letter-spacing: -.02em; }
.hang-card span { display: block; font-size: .8rem; color: #76696f; margin-top: 4px; }
.hang-card strong { display: block; margin-top: 10px; font-size: 1.35rem; letter-spacing: -.03em; border-top: 2px dashed var(--stitch); padding-top: 8px; }
@media (max-width: 880px) {
  .hero-in { grid-template-columns: 1fr; }
  .hang-card { width: 118px; }
}


/* ---------- Sections ---------- */
.section { padding: clamp(40px, 6vw, 88px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: clamp(20px, 3vw, 36px); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 3rem);  }
.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px) clamp(12px, 1.6vw, 22px); }
.products.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .products, .products.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .products, .products.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.card { position: relative; }
.card:nth-child(even) .card-img { background: var(--tile-b); }
.card:hover .card-img .garment { transform: scale(1.04); }
.heart {
  position: absolute; left: 8px; top: 8px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: #2a2326;
}
.heart:hover { background: rgba(255,255,255,.7); }
.heart svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .25s var(--ease); }
.heart[aria-pressed="true"] svg { fill: var(--stitch); stroke: var(--stitch); transform: scale(1.1); }
.quick {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% - 100% + 0px); z-index: 2;
}
.quick-in {
  position: absolute; left: 8px; right: 8px; background: rgba(253,251,251,.96); color: #2a2326; border-radius: 8px; padding: 10px;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .25s var(--ease);
  display: grid; gap: 8px; bottom: 8px;
}
.quick-in p { font-size: .8rem; font-weight: 600; }
.quick-sizes { display: flex; gap: 6px; }
.quick-sizes button {
  flex: 1; min-height: 36px; border: 1.5px solid #e3d3d9; border-radius: 6px; background: #fff; color: #2a2326; font-weight: 600; font-size: .85rem; padding: 0;
}
.quick-sizes button:hover:not([disabled]) { background: var(--stitch); border-color: var(--stitch); color: #fff; }
.quick-sizes button[disabled] { color: #b3a3aa; text-decoration: line-through; cursor: not-allowed; background: #f1e8eb; }
.card-wrap { position: relative; }
.card-wrap:hover .quick-in, .card-wrap:focus-within .quick-in { opacity: 1; transform: none; pointer-events: auto; }
.quick-anchor { position: absolute; inset: 0 0 auto 0; aspect-ratio: 4 / 5; pointer-events: none; }
.card-wrap:hover .quick-anchor .quick-in, .card-wrap:focus-within .quick-anchor .quick-in { pointer-events: auto; }
@media (hover: none) {
  .quick-anchor { display: none; }
}
.card-body { padding-top: 12px; display: grid; gap: 2px; }
.card-body h3 { font-size: 1.05rem; letter-spacing: -.015em; line-height: 1.25; }
.card-body h3 a { text-decoration: none; }
.card-body h3 a:hover { text-decoration: underline; text-decoration-color: var(--stitch); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.card-body .sub { color: var(--muted); font-size: .9rem; }
.card-body .price { font-weight: 600; margin-top: 2px; }


/* Material band */
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.promises div { padding-top: 18px; border-top: 2px dashed var(--stitch); }
.promises h3 { font-size: 1.2rem; }
.promises p { color: var(--muted); margin-top: 6px; max-width: 34ch; }
@media (max-width: 720px) {
  .promises { grid-template-columns: 1fr; }
}


/* ---------- Shop ---------- */
.page-head { padding: clamp(28px, 4vw, 56px) 0 20px; }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4.6rem);  }
.page-head p { color: var(--muted); margin-top: 10px; max-width: 54ch; }
.page-head h1:focus { outline: none; }
.shop-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.toolbar .count { color: var(--muted); }
.select {
  min-height: 44px; padding: 0 16px 0 40px; border: 1.5px solid var(--line); border-radius: 999px; background-color: var(--field);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 16px center;
}
.filters { position: sticky; top: 90px; display: grid; gap: 0; }
.fgroup { padding: 18px 0; border-bottom: 1px solid var(--line); }
.fgroup:first-child { padding-top: 4px; }
.fgroup h2, .fgroup legend { font-size: 1rem; letter-spacing: -.01em; margin-bottom: 12px; padding: 0; font-weight: 700; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fsizes { display: flex; flex-wrap: wrap; gap: 8px; }
.fsizes .chip { min-width: 48px; justify-content: center; padding: 0 12px; }
.range { width: 100%; accent-color: var(--stitch); height: 28px; }
.filters-head, .filters-foot { display: none; }
.filter-toggle { display: none; }
.active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.active-chips:empty { display: none; }
.active-chips .chip { background: color-mix(in srgb, var(--text) 8%, transparent); border-color: transparent; min-height: 34px; padding: 0 12px; font-size: .9rem; }
.scrim { position: fixed; inset: 0; background: rgba(30,20,25,.55); z-index: 59; }
@media (max-width: 880px) {
  .shop-layout { grid-template-columns: 1fr; }
  .filter-toggle { display: inline-flex; }
  .filters {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60; max-height: 86dvh; overflow-y: auto; background: var(--surface);
    border-radius: 18px 18px 0 0; padding: 0 20px; transform: translateY(105%); visibility: hidden; transition: transform .3s var(--ease), visibility 0s .3s;
  }
  .filters.open { transform: none; visibility: visible; transition: transform .3s var(--ease); }
  .filters-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--surface); padding: 14px 0; z-index: 2; border-bottom: 1px solid var(--line); }
  .filters-head h2 { font-size: 1.3rem; }
  .filters-foot { display: block; position: sticky; bottom: 0; background: var(--surface); padding: 14px 0 18px; }
}


/* ---------- Product page ---------- */
.crumbs { padding: 20px 0 14px; font-size: .9rem; color: var(--muted); }
.crumbs a { text-underline-offset: 3px; }
.pdp { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.buy { position: sticky; top: 92px; display: grid; gap: 22px; }
.buy h1 { font-size: clamp(2rem, 4vw, 3.1rem);  }
.buy h1:focus { outline: none; }
.buy .price { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; }
.buy .lede { color: var(--muted); max-width: 46ch; font-size: 1.05rem; }
.opt-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-weight: 600; }
.opt-label span { font-weight: 400; color: var(--muted); }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.size {
  min-width: 56px; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--field); font-weight: 600;
  transition: border-color .15s, background-color .15s;
}
.size:hover:not([disabled]) { border-color: var(--text); }
.size[aria-pressed="true"] { background: var(--pressed-bg); color: var(--pressed-fg); border-color: var(--pressed-bg); }
.size[disabled] { color: var(--muted); text-decoration: line-through; background: transparent; border-style: dashed; cursor: not-allowed; opacity: .7; }
.field-error { color: var(--danger); font-size: .92rem; margin-top: 8px; display: flex; gap: 6px; }
.field-error:empty { display: none; }
.sizes.shake { animation: shake .35s; }

@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.linkish { border: 0; background: none; padding: 4px 0; font-weight: 500; color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--stitch); text-decoration-thickness: 2px; }
.cta-row { display: flex; gap: 10px; }
.cta-row .btn-primary { flex: 1; min-height: 56px; font-size: 1.05rem; }
.cta-row .wish { width: 56px; height: 56px; padding: 0; border: 2px solid var(--line); border-radius: 50%; background: transparent; display: grid; place-items: center; flex: none; }
.cta-row .wish:hover { border-color: var(--text); }
.cta-row .wish svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cta-row .wish[aria-pressed="true"] svg { fill: var(--stitch); }
.perks { display: grid; gap: 8px; color: var(--muted); font-size: .95rem; }
.perks li { display: flex; gap: 10px; align-items: baseline; }
.perks li::before { content: ""; flex: none; width: 14px; border-top: 2px dashed var(--stitch); transform: translateY(-4px); }
details.acc { border-top: 1px solid var(--line); }
details.acc:last-of-type { border-bottom: 1px solid var(--line); }
details.acc summary { list-style: none; cursor: pointer; padding: 16px 0; display: flex; justify-content: space-between; font-weight: 600; min-height: 52px; align-items: center; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; transition: transform .2s; }
details.acc[open] summary::after { transform: rotate(45deg); }
details.acc .acc-body { padding: 0 0 18px; color: var(--muted); max-width: 54ch; }
details.acc ul { display: grid; gap: 6px; }
@media (max-width: 880px) {
  .pdp { grid-template-columns: 1fr; }
  .buy { position: static; }
  .cta-row { position: sticky; bottom: 0; z-index: 20; background: var(--bg); padding: 12px 0 14px; box-shadow: 0 -1px 0 var(--line); }
}


/* ---------- Forms / checkout ---------- */
.co { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; padding-bottom: 40px; }
.co form { display: grid; gap: 36px; }
.co fieldset { display: grid; gap: 16px; }
.co legend { font-size: 1.4rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: 14px; padding: 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fields .full { grid-column: 1 / -1; }
.f label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.f input, .f select {
  width: 100%; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--field);
}
.f input:hover, .f select:hover { border-color: var(--muted); }
.f input:focus-visible, .f select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.f.bad input, .f.bad select { border-color: var(--danger); }
.f .help { color: var(--muted); font-size: .85rem; margin-top: 5px; }
.f .err { color: var(--danger); font-size: .9rem; margin-top: 5px; }
.f .err:empty { display: none; }
.opt { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); }
.opt:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt input { accent-color: var(--ink); width: 20px; height: 20px; flex: none; }
.opt .grow { flex: 1; }
.opt b { display: block; }
.opt small { color: var(--muted); }
.opt .p { font-weight: 600; }
.summary { position: sticky; top: 92px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 24px; display: grid; gap: 14px; }
.summary h2 { font-size: 1.4rem; letter-spacing: -.03em; }
.sum-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; font-size: .95rem; }
.sum-item .line-img { padding: 4px; border-radius: 6px; position: relative; }
.sum-item .q { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; border-radius: 99px; background: var(--ink); color: #fff; font-size: .72rem; display: grid; place-items: center; font-weight: 700; padding: 0 5px; }
.sum-item small { color: var(--muted); display: block; }
.promo { display: flex; gap: 8px; }
.promo input { flex: 1; min-width: 0; min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); padding: 0 14px; background: var(--field); text-transform: uppercase; }
.promo .btn { min-height: 48px; padding: 0 20px; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.ok { color: var(--ok); font-weight: 600; font-size: .92rem; }
.form-alert { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border: 1.5px solid var(--danger); border-radius: 12px; padding: 14px 16px; font-weight: 600; }
.demo-note { background: color-mix(in srgb, var(--stitch) 18%, var(--surface)); border-radius: 10px; padding: 10px 14px; font-size: .9rem; }
@media (max-width: 880px) {
  .co { grid-template-columns: 1fr; }
  .summary { position: static; order: -1; }
  .fields { grid-template-columns: 1fr; }
}
.done { text-align: center; max-width: 640px; margin: clamp(32px, 7vw, 96px) auto; display: grid; gap: 20px; justify-items: center; }
.done h1 { font-size: clamp(2.2rem, 6vw, 3.8rem);  }
.done p { color: var(--muted); max-width: 46ch; }
.done .num { display: inline-block; border: 2px dashed var(--stitch); padding: 8px 18px; border-radius: 8px; font-weight: 700; letter-spacing: .02em; color: var(--text); }


/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 24px); z-index: 90; background: var(--toast-bg); color: var(--toast-fg);
  padding: 13px 22px; border-radius: 999px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease);
  box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* Arabic: no tracking (it breaks letter joins), LTR islands right-aligned */
*, *::before, *::after { letter-spacing: 0 !important; }
.f input[dir="ltr"], .promo input[dir="ltr"] { text-align: right; }
.crumbs { line-height: 1.8; }
.price, .num, .badge, .qty output { font-variant-numeric: tabular-nums; }



/* ============ photo storefront ============ */
.card-img { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--tile-a); border-radius: var(--radius); overflow: hidden; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: opacity .35s var(--ease), transform .6s var(--ease); }
.card-img img.alt { opacity: 0; }
@media (hover: hover) {
  .card:hover .card-img img.alt { opacity: 1; }
  .card:hover .card-img img:first-child { transform: scale(1.03); }
}
.quick-anchor { aspect-ratio: 3 / 4; }
.quick-sizes { flex-wrap: wrap; }
.quick-sizes button { flex: 1 1 38px; padding: 0 6px; }
.price.ask { color: var(--muted); font-weight: 500; font-size: .95rem; }
.code { color: var(--muted); }

.hero-stage { position: relative; }
.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.panel { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: var(--ink); color: #fff; text-decoration: none; }
.panel:nth-child(2) { margin-top: 28px; }
.panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .6s var(--ease); }
.panel:hover img { transform: scale(1.04); }
.panel-label { position: absolute; inset-inline: 0; bottom: 0; padding: 48px 14px 14px; background: linear-gradient(transparent, rgba(30, 20, 25, .88)); font-weight: 700; font-size: 1.3rem; display: grid; }
.panel-label small { font-weight: 500; font-size: .85rem; opacity: .85; }
.hang { text-decoration: none; color: inherit; top: -18px; left: -22px; }
.hang-card { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .3)); }
@media (max-width: 880px) { .hero-stage { order: -1; } .panel:nth-child(2) { margin-top: 0; } .panel-label { font-size: 1.05rem; } }

.gal { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; }
.gal:not(:has(.thumbs)) { grid-template-columns: minmax(0, 1fr); }
.thumbs { display: grid; gap: 10px; }
.thumb-btn { aspect-ratio: 3 / 4; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--tile-a); opacity: .75; transition: opacity .2s, border-color .2s; }
.thumb-btn:hover { opacity: 1; }
.thumb-btn[aria-pressed="true"] { border-color: var(--text); opacity: 1; }
.thumb-btn img, .gal-zoom img, .line-img img, .search-res .thumb img, .done-img img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.gal-main { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--tile-a); }
.gal-zoom { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gal-nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(253, 251, 251, .92); color: #2a2326; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.gal-next { left: 10px; }
.gal-prev { right: 10px; }
.gal-count { position: absolute; bottom: 10px; left: 10px; background: rgba(42, 35, 38, .8); color: #fff; font-size: .8rem; padding: 3px 12px; border-radius: 99px; }
@media (max-width: 880px) {
  .gal { grid-template-columns: minmax(0, 1fr); }
  .thumbs { order: 2; grid-auto-flow: column; grid-auto-columns: 64px; overflow-x: auto; padding-bottom: 4px; }
}

.line-img { padding: 0; overflow: hidden; display: block; }
.search-res .thumb { aspect-ratio: 1; padding: 0; overflow: hidden; background: var(--tile-a); border-radius: 8px; display: block; }
.done-img { width: 160px; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--tile-a); }

dialog.lightbox { margin: 0; width: 100vw; height: 100dvh; background: rgba(20, 14, 17, .95); color: #fff; }
dialog.lightbox[open] { display: grid; place-items: center; animation: fade-in .2s; }
.lightbox img { max-width: min(94vw, 920px); max-height: 90dvh; object-fit: contain; border-radius: 6px; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255, 255, 255, .26); }
.lb-close { top: 14px; right: 14px; }
.lb-nav { top: 50%; translate: 0 -50%; }
.lb-next { left: 14px; }
.lb-prev { right: 14px; }
.lb-count { position: absolute; bottom: 16px; left: 50%; translate: -50% 0; font-size: .9rem; background: rgba(255, 255, 255, .16); padding: 3px 14px; border-radius: 99px; }

.gal-count, .lb-count { direction: ltr; unicode-bidi: isolate; }

/* Telegram photos are 4:5 or 2:3: cards crop from the top, the product page never crops */
.card-img, .quick-anchor { aspect-ratio: 4 / 5; }
.gal-main { aspect-ratio: 4 / 5; }
.gal-zoom img { object-fit: contain; object-position: center; }
.thumb-btn { aspect-ratio: 4 / 5; }
.thumbs { max-height: min(86vh, 760px); overflow-y: auto; scrollbar-width: thin; padding-inline-end: 2px; }
@media (max-width: 880px) { .thumbs { max-height: none; overflow-y: visible; } }

/* theme toggle: show the icon of the mode you would switch to */
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
body, .header, .card-img, .tile { transition: background-color .25s, color .25s; }


/* ============ mobile-first polish ============ */
html, body { overflow-x: clip; }
.toolbar-l { display: flex; gap: 12px; align-items: center; }
.heart { background: rgba(255, 255, 255, .82); width: 40px; height: 40px; left: 8px; top: 8px; backdrop-filter: blur(4px); }
.heart:hover { background: #fff; }
.thumbs { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.thumb-btn { scroll-snap-align: start; }
.toast { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.footer-safe, footer { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 880px) {
  :root { --gutter: 16px; }
  #announce { font-size: .78rem; line-height: 1.45; padding: 7px 12px; }
  .header-in { min-height: 56px; gap: 4px; }
  .logo { font-size: 1.45rem; padding-bottom: 5px; }
  .icon-btn { width: 42px; height: 42px; }

  /* hero: tag stays inside the screen and no longer covers the tiles */
  .hero { padding: 16px 0 28px; }
  .hang { top: -12px; left: 4px; right: auto; }
  .hang-string { height: 12px; }
  .hang-card { width: 90px; padding: 20px 8px 8px; }
  .hang-card span { display: none; }
  .hang-card b { font-size: .85rem; }
  .hang-card span { font-size: .7rem; }
  .hang-card strong { font-size: 1.05rem; margin-top: 6px; padding-top: 6px; }
  .panels { gap: 8px; }
  .panel { border-radius: 12px; }
  .panel-label { padding: 36px 8px 10px; font-size: .95rem; }
  .panel-label small { font-size: .75rem; }
  .hero-copy { text-align: start; }
  .hero h1 { font-size: 2.05rem; line-height: 1.25; max-width: none; }
  .hero-copy p { margin-top: 14px; font-size: 1rem; }
  .hero-cta { margin-top: 20px; flex-wrap: nowrap; }
  .hero-cta .btn { flex: 1; padding: 0 12px; min-height: 50px; }

  .section { padding: 32px 0; }
  .section-head { margin-bottom: 16px; gap: 12px; }
  .section-head h2 { font-size: 1.5rem; }
  .products { gap: 22px 10px; }
  .card-body h3 { font-size: 1rem; }
  .card-body .sub { font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .price { font-size: .98rem; }

  .page-head { padding: 20px 0 12px; }
  .page-head h1 { font-size: 1.9rem; }
  .page-head p { font-size: .95rem; margin-top: 6px; }
  .toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 0 12px; margin-bottom: 16px; }
  .toolbar-l { display: contents; }
  .filter-toggle { order: 1; min-height: 46px; font-weight: 600; }
  .toolbar-r { order: 2; flex: 1; min-width: 0; }
  .toolbar-r .select { width: 100%; min-height: 46px; }
  .toolbar .count { order: 3; flex-basis: 100%; font-size: .9rem; }
  .chip { min-height: 44px; }
  .active-chips .chip { min-height: 38px; }

  .crumbs { padding: 12px 0 10px; font-size: .85rem; }
  .buy { gap: 18px; }
  .buy h1 { font-size: 1.7rem; }
  .buy .price { font-size: 1.35rem; }
  .size { min-width: 52px; min-height: 48px; }
  .cta-row { padding: 10px 0 calc(12px + env(safe-area-inset-bottom, 0px)); margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .thumbs { grid-auto-columns: 60px; gap: 8px; }
  .gal-nav { width: 40px; height: 40px; }

  .drawer-head { padding: 10px 8px 10px 16px; }
  .drawer-body { padding: 4px 16px; }
  .drawer-foot { padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .ship-meter { padding: 12px 16px; }
  .line-item { grid-template-columns: 72px 1fr; gap: 12px; }
  .menu-links a { font-size: 1.5rem; padding: 14px 0; }
  .search-top input { font-size: 1.15rem; }
  .search-res { padding: 12px var(--gutter); }
  .search-res li a { grid-template-columns: 52px 1fr auto; gap: 12px; }

  .co { gap: 20px; }
  .co form { gap: 28px; }
  .summary { padding: 16px; border-radius: 14px; }
  .opt { padding: 14px; }
  .done-img { width: 120px; }
  .promises { gap: 18px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 1.85rem; }
  .logo { font-size: 1.3rem; }
  .icon-btn { width: 40px; height: 40px; }
  .hero-cta { flex-direction: column; }
}

/* checkout: grid children may shrink below their content (was pushing the form off-screen on phones) */
.co > *, .co form, .co fieldset, .fields > *, .opt .grow { min-width: 0; }
@media (max-width: 880px) {
  .co { grid-template-columns: minmax(0, 1fr); }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .f input, .f select { max-width: 100%; }
  .opt { flex-wrap: wrap; }
  .opt small, .opt b { overflow-wrap: anywhere; }
}
.summary { grid-template-columns: minmax(0, 1fr); }
.summary > *, .sum-item > *, .promo > * { min-width: 0; }
.promo .btn { flex: none; }
#news-form input { min-width: 0; width: 100%; }
@media (min-width: 400px) { #news-form input { width: auto; flex: 1 1 200px; } }
