/* AK Fabrics: professional, calm, responsive shop. Pure CSS, tokens enforced. */
:root {
  --bg: #FFFFFF;
  --soft: #F6F3EE;
  --ink: #141414;
  --mute: #6A6A6A;
  --line: #E8E3DA;
  --brand: #A82020;
  --wa: #1FA855;
  --wa-dark: #178A45;
  --gold: #B88A2E;
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-48: 48px;
  --sp-64: 64px;
  --rad-sm: 12px;
  --rad-md: 16px;
  --rad-lg: 20px;
  --rad-pill: 999px;
  --hdr: 60px;
  --gut: 16px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

@media (min-width: 768px) {
  :root {
    --gut: 24px;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  padding-bottom: 32px;
}
body.has-bar {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* ---------- header ---------- */
.shop-hdr {
  position: sticky; top: 0; z-index: 60; height: var(--hdr);
  background: rgba(255, 255, 255, .94); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.shop-hdr.scrolled { border-color: var(--line); box-shadow: 0 4px 20px rgba(0, 0, 0, .05); }
.shop-hdr-in { max-width: 1160px; margin: 0 auto; height: 100%; padding: 0 var(--gut); display: flex; align-items: center; justify-content: space-between; }
.logo { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.logo b { font-size: 1.15rem; font-weight: 800; letter-spacing: .14em; }
.logo span { font-size: .6rem; letter-spacing: .32em; color: var(--gold); font-weight: 700; margin-top: 4px; }
.hdr-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none;
  transition: background .2s, transform .2s;
}
.icon-btn:hover { background: var(--soft); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.wa svg { width: 34px; height: 34px; }
.icon-btn.wa { color: var(--wa); }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; display: none; align-items: center; justify-content: center;
}
.badge.pop { animation: pop .5s var(--ease); }
@keyframes pop { 0% { transform: scale(.4); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- wrap ---------- */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--gut); }

/* ---------- home hero ---------- */
.hero { padding: 14px 0 10px; }
.hero h1 { margin: 0; font-size: clamp(1.45rem, 6.2vw, 3.1rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { margin: 4px 0 0; color: var(--mute); font-size: clamp(.74rem, 3.3vw, .95rem); font-weight: 600; white-space: nowrap; }
.hero p i { font-style: normal; color: var(--gold); margin: 0 3px; }

/* ---------- home: first screen = header + hero + 4 big tiles, nothing cut off ---------- */
.first { display: flex; flex-direction: column; min-height: calc(100vh - var(--hdr)); }
@supports (height: 1svh) { .first { min-height: calc(100svh - var(--hdr)); } }

/* ---------- home tiles ---------- */
.tiles {
  flex: 1; min-height: 380px; max-height: 900px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px; padding-bottom: 14px;
}
@media (min-width: 768px) { .tiles { gap: 16px; padding-bottom: 20px; } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 1fr; max-height: 680px; } }

.tile {
  position: relative; display: block; min-height: 0; border-radius: 20px; overflow: hidden; background: var(--soft);
  text-decoration: none; color: #fff; isolation: isolate;
  opacity: 0; transform: translateY(14px);
  animation: tileIn .45s var(--ease) forwards; animation-delay: calc(var(--i) * 60ms);
  transition: transform .35s var(--ease), box-shadow .35s;
}
@keyframes tileIn { to { opacity: 1; transform: none; } }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; animation: drift 16s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.08); } }
.tile::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,0) 25%, rgba(0,0,0,.45) 60%, rgba(0,0,0,.82) 100%); }
.tile:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0, 0, 0, .18); }
.tile:active { transform: scale(.97); }
.tile::after { background: linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(0,0,0,.5) 66%, rgba(0,0,0,.86) 100%); }
.tile-txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 14px 16px; }
.tile-txt b { display: block; font-size: clamp(1.15rem, 5vw, 1.6rem); font-weight: 800; letter-spacing: -.01em; line-height: 1.15; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.tile-txt .tile-price { display: block; margin-top: 4px; font-size: clamp(.95rem, 4vw, 1.15rem); font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.tile-txt .tile-price s { font-weight: 500; font-size: .82em; opacity: .75; margin-left: 4px; }
.tile-txt small { display: block; margin-top: 3px; font-size: .74rem; font-weight: 600; opacity: .9; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.tile-go {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.94); color: var(--ink);
  display: flex; align-items: center; justify-content: center; transition: transform .35s var(--ease);
}
.tile:hover .tile-go { transform: translateX(3px) rotate(-45deg); }
.tile-tag { position: absolute; top: 12px; left: 12px; background: var(--brand); color: #fff; font-size: .66rem; font-weight: 800; letter-spacing: .08em; padding: 4px 9px; border-radius: 999px; }
.tile-tag.new { background: #4A154B; }
.tile-tag.promo { background: var(--gold); color: #1a1405; }

/* ---------- home: best sellers row ---------- */
.best { padding: 18px 0 0; }
.best-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.best-h h2 { margin: 0; }
.best-h span { color: var(--mute); font-size: .8rem; font-weight: 700; }
.best-h span b { display: inline-block; animation: hintNudge 1s var(--ease) infinite alternate; }
.best-row {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px var(--gut) 8px; margin: 0 calc(var(--gut) * -1);
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.best-row::-webkit-scrollbar { display: none; }
.bs { flex: 0 0 42%; max-width: 190px; scroll-snap-align: start; display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 640px) { .bs { flex-basis: 190px; } }
.bs-img { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; background: var(--soft); }
.bs-img img { width: 100%; height: 100%; object-fit: cover; }
.bs-tag { position: absolute; top: 8px; left: 8px; background: var(--brand); color: #fff; font-size: .6rem; font-weight: 800; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; }
.bs-name { margin: 8px 2px 2px; font-size: .88rem; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.bs-price { margin: 0 2px 8px; font-size: .95rem; font-weight: 800; white-space: nowrap; }
.bs-price s { font-weight: 500; color: var(--mute); font-size: .76rem; margin-left: 4px; }
.bs .btn-add { height: 42px; font-size: .86rem; border-radius: 10px; margin-top: auto; }
.bs-more { flex: 0 0 34%; max-width: 150px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 16px; border: 1.5px dashed var(--line); color: var(--ink); text-decoration: none; font-weight: 800; font-size: .88rem; text-align: center; padding: 10px; aspect-ratio: 1 / 1; }
.bs-more svg { width: 26px; height: 26px; }

/* ---------- home: "pasand nahi aaya" help block ---------- */
.help { margin: 22px 0 0; padding: 16px; border-radius: 18px; background: #EEF8F1; border: 1px solid #CFE8D8; display: grid; grid-template-columns: 44px 1fr; gap: 6px 12px; align-items: center; }
.help-ic { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--wa-dark); display: grid; place-items: center; }
.help-ic svg { width: 24px; height: 24px; }
.help-txt b { display: block; font-size: 1rem; font-weight: 800; line-height: 1.25; }
.help-txt span { display: block; margin-top: 2px; font-size: .86rem; color: #4a5a50; line-height: 1.4; }
.help .btn-wa { grid-column: 1 / -1; margin-top: 8px; width: 100%; }
@media (min-width: 640px) { .help { grid-template-columns: 44px 1fr auto; } .help .btn-wa { grid-column: auto; margin-top: 0; width: auto; } }

/* ---------- deal banner ---------- */
.deal {
  position: relative; overflow: hidden; margin: 20px 0 0; padding: 16px 18px; border-radius: 18px; color: #fff;
  background: linear-gradient(120deg, #141414, #2b2b2b); display: flex; flex-direction: column; gap: 8px;
}
@media (min-width: 640px) {
  .deal { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; }
}
.deal::after { content: ''; position: absolute; top: 0; bottom: 0; width: 60px; left: -80px; background: linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent); transform: skewX(-20deg); animation: shine 4.5s ease-in-out infinite; }
@keyframes shine { 0%, 55% { left: -90px; } 100% { left: 120%; } }
.deal-big { font-size: 1.55rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.deal-big small { display: block; font-size: .62rem; letter-spacing: .14em; color: #d9b45e; margin-bottom: 4px; font-weight: 700; }
.deal-txt { font-size: .92rem; line-height: 1.4; opacity: .95; }

/* ---------- home steps & facts: perfectly unified grid ---------- */
.section { padding: 36px 0 10px; }
.section h2 { margin: 0 0 16px; font-size: clamp(1.3rem, 5vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; }

.steps {
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

.step {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--soft); height: 100%;
}
.step-num {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
}
.step-body { flex: 1; min-width: 0; }
.step-body b { display: block; font-size: 1rem; font-weight: 800; line-height: 1.25; margin-bottom: 4px; }
.step-body span { color: var(--mute); font-size: .88rem; line-height: 1.4; display: block; }

.facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px;
}
@media (min-width: 768px) {
  .facts { gap: 16px; margin-top: 16px; }
}

.fact {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 14px 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; height: 100%;
}
.fact-icon { width: 32px; height: 32px; color: var(--ink); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.fact-icon svg { width: 24px; height: 24px; }
.fact b { display: block; font-size: .86rem; font-weight: 800; line-height: 1.2; margin-bottom: 2px; }
.fact span { display: block; font-size: .78rem; font-weight: 600; color: var(--mute); line-height: 1.3; }

/* ---------- footer ---------- */
.foot { margin-top: 40px; background: var(--ink); color: #fff; padding: 36px 0 60px; }
.foot h3 { margin: 0 0 6px; font-size: 1.15rem; letter-spacing: .1em; }
.foot p { margin: 4px 0; color: #cfcfcf; font-size: .92rem; }
.foot a { color: #fff; }
.btn-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 12px;
  background: var(--wa); color: #fff; font-weight: 800; font-size: .98rem; text-decoration: none; border: 0; transition: transform .2s, background .2s;
}
.btn-wa:hover { background: var(--wa-dark); }
.btn-wa:active { transform: scale(.97); }
.btn-wa svg { width: 22px; height: 22px; }
.foot .btn-wa { margin-top: 14px; }

/* ---------- scroll reveal ---------- */
.rv { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* ---------- category page ---------- */
.tabs {
  position: sticky; top: var(--hdr); z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tabs-in { max-width: 1160px; margin: 0 auto; display: flex; gap: 8px; overflow-x: auto; padding: 10px var(--gut); scrollbar-width: none; }
.tabs-in::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; height: 42px; padding: 0 18px; border-radius: 999px; display: inline-flex; align-items: center; text-decoration: none;
  font-weight: 700; font-size: .9rem; background: var(--soft); color: var(--ink); transition: background .2s, color .2s, transform .2s;
}
.tab:active { transform: scale(.95); }
.tab.on { background: var(--ink); color: #fff; }

.cat-head { padding: 22px 0 6px; }
.cat-head h1 { margin: 0; font-size: clamp(1.7rem, 6.5vw, 2.5rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.cat-desc { margin: 8px 0 10px; color: var(--mute); font-size: .94rem; line-height: 1.45; font-weight: 500; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--soft); border: 1px solid var(--line); font-size: .8rem; font-weight: 700; color: var(--ink);
}
.cat-chip svg { width: 16px; height: 16px; flex-shrink: 0; }
.cat-price { display: inline-flex; align-items: baseline; gap: 8px; font-weight: 800; font-size: 1.25rem; margin-top: 4px; }
.cat-price s { font-weight: 500; color: var(--mute); font-size: .92rem; }
.cat-price i { font-style: normal; font-size: .72rem; font-weight: 800; background: var(--brand); color: #fff; padding: 3px 8px; border-radius: 999px; }
.deal-strip {
  margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #FFF4D6; color: #5b4300; font-weight: 700; font-size: .92rem;
  display: flex; gap: 10px; align-items: center; border: 1px solid #fae8be;
}
.deal-strip svg { flex-shrink: 0; }

.cat-hint {
  margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #F6F3EE; border: 1px solid var(--line);
  color: var(--ink); font-size: .85rem; font-weight: 700; display: flex; align-items: center; gap: 10px;
  animation: hintIn .4s var(--ease);
}
@keyframes hintIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.cat-hint-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: var(--gold); flex-shrink: 0; }
.cat-hint-icon svg { width: 20px; height: 20px; }
.cat-hint-txt { flex: 1; min-width: 0; }
.hint-x { border: 0; background: transparent; font-size: 1.3rem; line-height: 1; color: var(--mute); padding: 0 4px; cursor: pointer; }

/* ---------- grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; padding: 18px 0 8px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 24px 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card { min-width: 0;
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(18px); animation: cardIn .6s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 45ms);
}
@keyframes cardIn { to { opacity: 1; transform: none; } }
.card-img {
  position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 1 / 1;
  background: linear-gradient(110deg, #efeae1 30%, #f8f5ef 50%, #efeae1 70%); background-size: 200% 100%; animation: sk 1.4s linear infinite;
}
@keyframes sk { to { background-position: -200% 0; } }
.card-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s, transform .5s var(--ease); }
.card-img img.ok { opacity: 1; }
.card-img:hover img { transform: scale(1.05); }
.card-img.done { animation: none; background: var(--soft); }
.card-tag { position: absolute; top: 10px; left: 10px; background: var(--brand); color: #fff; font-size: .66rem; font-weight: 800; letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; }
.card-zoom {
  position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%;
  background: #ffffff; color: var(--ink); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18); transition: transform .2s var(--ease);
}
.card-zoom:hover { transform: scale(1.08); }
.card-zoom svg { width: 20px; height: 20px; }

.card-name {
  margin: 10px 2px 4px; font-size: .95rem; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em;
}

.card-price-row {
  margin: 0 2px 10px; display: flex; align-items: center; justify-content: space-between; min-height: 32px; gap: 4px;
}
.card-price { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.card-price s { font-weight: 500; color: var(--mute); font-size: .8rem; }

/* Quantity picker */
.qty-picker {
  display: inline-flex; align-items: center; background: var(--soft); border-radius: 999px; border: 1px solid var(--line);
  height: 30px; padding: 0 2px;
}
.qty-btn {
  position: relative; width: 28px; height: 28px; border: 0; background: transparent; color: var(--ink);
  font-weight: 800; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; padding: 0; touch-action: manipulation; transition: background .15s;
}
.qty-btn::before { content: ''; position: absolute; inset: -6px; }
.qty-btn:active { background: var(--line); }
.qty-btn:disabled { color: #c4bfb5; cursor: not-allowed; }
.qty-num { min-width: 20px; text-align: center; font-size: .85rem; font-weight: 800; user-select: none; }
/* Narrow phones: stack old price under new price so the qty picker never gets squeezed */
@media (max-width: 430px) {
  .card-price { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.15; }
  .card-price s { font-size: .72rem; }
  .card-price-row { min-height: 38px; flex-wrap: wrap; row-gap: 4px; }
  .card-price { font-size: .9rem; }
  .qty-picker { height: 28px; padding: 0 1px; }
  .qty-btn { width: 22px; height: 22px; font-size: 1rem; }
  .qty-num { min-width: 14px; font-size: .8rem; }
  .qty-picker { margin-left: auto; }
}

.btn-add {
  position: relative; overflow: hidden; width: 100%; height: 48px; border: 0; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: .01em;
  transition: transform .2s var(--ease), background .25s;
}
.btn-add:active { transform: scale(.96); }
.btn-add.added { background: var(--wa); }
.btn-add:disabled { background: #d8d4cc; color: #fff; cursor: not-allowed; }

.more { text-align: center; padding: 18px 0 6px; color: var(--mute); font-size: .9rem; }
.more button { height: 48px; padding: 0 26px; border-radius: 12px; border: 1.5px solid var(--ink); background: #fff; font-weight: 800; }

/* ---------- bag bar ---------- */
.bar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 80;
  max-width: 580px; margin: 0 auto; display: flex; align-items: stretch; gap: 8px; padding: 8px;
  border-radius: 18px; background: var(--ink); color: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  transform: translateY(160%); transition: transform .5s var(--ease);
}
.bar.show { transform: none; }
.bar.bump { animation: barBump .5s var(--ease); }
@keyframes barBump { 0% { transform: translateY(0); } 30% { transform: translateY(-8px); } 100% { transform: translateY(0); } }
.bar-info {
  flex: 1; min-width: 0; text-align: left; background: transparent; color: #fff; border: 0; padding: 4px 8px;
  display: flex; flex-direction: column; justify-content: center; cursor: pointer;
}
.bar-info b { font-size: 1.05rem; font-weight: 800; white-space: nowrap; line-height: 1.2; }
.bar-info span { font-size: .78rem; color: #d9b45e; font-weight: 700; white-space: nowrap; line-height: 1.2; }
.bar .btn-wa { min-height: 50px; padding: 0 14px; gap: 6px; border-radius: 12px; font-size: .9rem; white-space: nowrap; }
.bar .btn-wa svg { width: 20px; height: 20px; }

/* ---------- floating WhatsApp button ---------- */
.fab {
  position: fixed; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 70;
  display: block; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: none; color: #fff; text-decoration: none;
  filter: drop-shadow(0 10px 14px rgba(8, 90, 42, .38)); transition: transform .4s var(--ease), opacity .3s;
  animation: fabIn .7s var(--ease) 1.2s backwards, fabFloat 3.2s ease-in-out 2s infinite;
}
.fab svg { display: block; width: 100%; height: 100%; }
.fab span { display: none; }
.fab::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid var(--wa); animation: ring 2.6s ease-out infinite; }
.fab:active { transform: scale(.94); }
@keyframes ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.35, 1.6); opacity: 0; } }
@keyframes fabFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes fabIn { from { transform: translateY(40px) scale(.6); opacity: 0; } }
.fab.hide { transform: translateY(120px); opacity: 0; pointer-events: none; }
.fab.late { transform: translateY(120px); opacity: 0; pointer-events: none; } /* home: stays hidden until the 4 tiles are scrolled past */

/* ---------- bag sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .35s; }
.scrim.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; max-width: 620px; margin: 0 auto;
  max-height: 90vh; display: flex; flex-direction: column; background: #fff; border-radius: 20px 20px 0 0;
  transform: translateY(105%); transition: transform .45s var(--ease); padding-bottom: env(safe-area-inset-bottom);
}
.sheet.show { transform: none; }
@supports (height: 1dvh) { .sheet { max-height: 90dvh; } }
/* each view is a flex column so the middle part scrolls and header/footer stay put */
.sheet-view { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.sheet-view > .sheet-h, .sheet-view > .sheet-f { flex-shrink: 0; }
.sheet-success { overflow-y: auto; }
@media (max-height: 700px) {
  .sheet-f { padding: 8px 18px 10px; }
  .sheet-f .note { display: none; }
  .sheet-f .btn-primary, .sheet-f .btn-wa { min-height: 46px; }
  .sheet-actions { gap: 8px; margin-top: 4px; }
  .sheet-list { min-height: 170px; }
}

.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.sheet-h h3 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.sheet-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--soft); font-size: 1.3rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.sheet-back {
  border: 0; background: transparent; font-size: .95rem; font-weight: 700; color: var(--ink); padding: 6px 10px 6px 0;
  display: inline-flex; align-items: center; gap: 4px;
}

.sheet-list { overflow-y: auto; padding: 4px 18px; flex: 1 1 auto; min-height: 120px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.it { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.it img { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; background: var(--soft); }
.it b { display: block; font-size: .95rem; line-height: 1.25; }
.it small { color: var(--mute); font-size: .8rem; }
.it .qty { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.it .qty button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 1.1rem; font-weight: 800; }
.it .qty span { min-width: 26px; text-align: center; font-weight: 800; font-size: .9rem; }
.it-x { border: 0; background: transparent; color: var(--mute); width: 38px; height: 38px; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.it-x svg { width: 18px; height: 18px; }

.sheet-f { padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.sum { display: flex; justify-content: space-between; font-size: .95rem; margin: 3px 0; }
.sum.big { font-size: 1.15rem; font-weight: 800; margin: 6px 0 4px; }
.sum.save { color: var(--wa-dark); font-weight: 700; }
.note { color: var(--mute); font-size: .8rem; margin: 6px 0 12px; line-height: 1.4; }

.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.btn-primary {
  width: 100%; min-height: 50px; border-radius: 12px; border: 0; background: var(--ink); color: #fff;
  font-weight: 800; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .2s, background .2s;
}
.btn-primary:active { transform: scale(.98); }
.sheet-f .btn-wa { width: 100%; }

.empty { padding: 40px 10px; text-align: center; color: var(--mute); font-size: .95rem; }

/* ---------- bag sheet: website order form view ---------- */
.sheet-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.form-body { padding: 14px 18px 8px; display: flex; flex-direction: column; gap: 14px; }
.form-field label { display: block; font-size: .85rem; font-weight: 700; color: var(--ink); margin-bottom: 5px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px;
  font-size: 16px; color: var(--ink); background: #fff; transition: border-color .2s; outline: none;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--ink); }
.form-field input.err, .form-field select.err, .form-field textarea.err { border-color: var(--brand); }
.form-field textarea { height: auto; min-height: 64px; padding: 10px 14px; resize: vertical; line-height: 1.4; }
.field-error { color: var(--brand); font-size: .78rem; font-weight: 700; margin-top: 4px; }

.form-summary {
  margin: 10px 18px 0; padding: 14px 16px; border-radius: 14px; background: var(--soft);
  border: 1px solid var(--line);
}
.form-summary .sum { font-size: .92rem; }
.form-summary .sum.big { font-size: 1.15rem; }

.form-actions { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.form-error-banner {
  padding: 10px 14px; border-radius: 10px; background: #FDE8E8; border: 1px solid #F8B4B4;
  color: var(--brand); font-size: .85rem; font-weight: 700; line-height: 1.4;
}
.btn-submit {
  width: 100%; min-height: 52px; border: 0; border-radius: 12px; background: var(--ink); color: #fff;
  font-weight: 800; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .2s, background .2s;
}
.btn-submit:active { transform: scale(.98); }
.btn-submit:disabled { background: #9c978f; cursor: not-allowed; }
.btn-form-wa { background: transparent; color: var(--wa-dark); border: 1.5px solid var(--line); font-size: .92rem; min-height: 48px; }
.btn-form-wa:hover { background: var(--soft); }

.spinner {
  width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; margin-left: 8px; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- bag sheet: success view ---------- */
.sheet-success { padding: 32px 20px 24px; text-align: center; }
.success-icon {
  width: 68px; height: 68px; border-radius: 50%; background: #E8F5E9; color: var(--wa);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.success-icon svg { width: 36px; height: 36px; }
.sheet-success h3 { margin: 0 0 10px; font-size: 1.3rem; font-weight: 800; }
.success-order-box {
  background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  margin: 12px auto; max-width: 320px; font-size: .95rem;
}
.success-order-box b { color: var(--ink); }
.success-msg { color: var(--mute); font-size: .92rem; line-height: 1.45; margin: 12px 0 20px; }
.success-msg b { color: var(--ink); }
.success-actions { display: flex; flex-direction: column; gap: 10px; max-width: 380px; margin: 0 auto; }
.btn-sec {
  width: 100%; min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  color: var(--ink); font-weight: 800; font-size: .95rem;
}

/* ---------- lightbox (big view) ---------- */
.lb {
  --lb-glass: rgba(255, 255, 255, .14); --lb-glass-line: rgba(255, 255, 255, .18);
  position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; overflow: hidden;
  background: rgba(12, 12, 13, calc(.98 * var(--lb-fade, 1)));
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.lb.show { opacity: 1; pointer-events: auto; }
.lb-bg {
  position: absolute; left: -10%; top: -10%; width: 120%; height: 120%; object-fit: cover; z-index: 0;
  filter: blur(46px) saturate(1.25); opacity: .42; pointer-events: none; transition: opacity .4s;
}
.lb-top, .lb-stage, .lb-info { position: relative; z-index: 1; }

.lb-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 6; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 14px 24px; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .45), transparent);
}
.lb-top > *, .lb-acts > * { pointer-events: auto; }
.lb-count {
  padding: 8px 14px; border-radius: var(--rad-pill); color: #fff; font-size: .82rem; font-weight: 700; letter-spacing: .04em;
  font-variant-numeric: tabular-nums; background: var(--lb-glass); border: 1px solid var(--lb-glass-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lb-acts { display: flex; gap: 10px; }
.lb-ic {
  width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--lb-glass); border: 1px solid var(--lb-glass-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background .2s, transform .2s var(--ease);
}
.lb-ic svg { width: 20px; height: 20px; display: block; }
.lb-ic:hover { background: rgba(255, 255, 255, .24); }
.lb-ic:active { transform: scale(.92); }

.lb-stage {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden;
  padding: 64px 12px 10px; touch-action: pan-y;
}
.lb-img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; user-select: none; -webkit-user-drag: none;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  transition: opacity .25s, transform .35s var(--ease);
}
.lb-img.swap-l { opacity: 0; transform: translateX(-36px) scale(.98); }
.lb-img.swap-r { opacity: 0; transform: translateX(36px) scale(.98); }
.lb-img.drag { transition: none; }
.lb-img.zoomed { transform: scale(2); cursor: zoom-out; border-radius: 0; }

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; padding: 0; border-radius: 50%; z-index: 5;
  display: grid; place-items: center; color: #fff; background: var(--lb-glass); border: 1px solid var(--lb-glass-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background .2s, opacity .2s, transform .2s var(--ease);
}
.lb-nav svg { width: 24px; height: 24px; display: block; }
.lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lb-nav:active { transform: translateY(-50%) scale(.92); }
.lb-nav:disabled { opacity: .22; pointer-events: none; }
.lb-nav.p { left: 12px; }
.lb-nav.n { right: 12px; }

.lb-swipe-hint {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 8px 16px; border-radius: var(--rad-pill); color: #fff; font-size: .8rem; font-weight: 700; pointer-events: none;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: hintFadeOut 3s forwards;
}
.lb-swipe-hint span { font-size: 1rem; animation: hintNudge 1s var(--ease) infinite alternate; }
.lb-swipe-hint span:first-child { animation-direction: alternate-reverse; }
@keyframes hintNudge { from { transform: translateX(-3px); } to { transform: translateX(3px); } }
@keyframes hintFadeOut { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }

.lb-info {
  width: 100%; max-width: 560px; margin: 0 auto; background: #fff; border-radius: 24px 24px 0 0;
  padding: 16px 18px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .35);
}
.lb-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lb-meta { min-width: 0; }
.lb-meta h3 { margin: 0; font-size: 1.05rem; font-weight: 800; line-height: 1.25; }
.lb-price { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.lb-price b { font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.lb-price s { color: var(--mute); font-weight: 500; font-size: .85rem; }
.lb-price small {
  color: var(--mute); font-weight: 700; font-size: .7rem; letter-spacing: .05em; padding: 2px 8px; border-radius: var(--rad-pill); background: var(--soft);
}
.lb-qty { flex-shrink: 0; margin-top: 2px; }
.lb-desc {
  margin: 10px 0; color: var(--mute); font-size: .86rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lb-trust { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lb-trust span {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--rad-pill); background: var(--soft);
  font-size: .74rem; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.lb-trust svg { width: 15px; height: 15px; flex-shrink: 0; }
.lb-btns { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.lb-btns .btn-add, .lb-btns .btn-wa { height: 52px; min-height: 52px; font-size: .9rem; padding: 0 8px; border-radius: 14px; white-space: nowrap; }
.lb-btns .btn-wa svg { width: 20px; height: 20px; }

@media (min-width: 900px) {
  .lb { flex-direction: row; align-items: stretch; }
  .lb-stage { padding: 76px 24px 28px 72px; }
  .lb-info {
    align-self: center; width: 400px; max-width: none; margin: 0 40px 0 0; border-radius: 24px; padding: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  }
  .lb-nav.p { left: 16px; }
  .lb-nav.n { right: 16px; }
  .lb-top { padding: 20px 24px 28px; }
  .lb-desc { -webkit-line-clamp: 4; }
}
@media (max-width: 420px) {
  .lb-nav { width: 38px; height: 38px; background: rgba(0, 0, 0, .35); }
  .lb-nav svg { width: 20px; height: 20px; }
  .lb-nav.p { left: 6px; }
  .lb-nav.n { right: 6px; }
}
@media (max-height: 640px) and (max-width: 899px) {
  .lb-desc { display: none; }
  .lb-stage { padding-top: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  .lb-img, .lb-swipe-hint, .lb-swipe-hint span { transition: none; animation: none; }
}

/* Toast notification */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: .88rem; font-weight: 700; z-index: 150; opacity: 0; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile, .rv, .card { opacity: 1 !important; transform: none !important; }
}
