/* ==========================================================================
   Buy4Less Mart — mobile-first stylesheet
   Base styles target phones; larger screens are layered on with min-width.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --navy: #14285f;
  --navy-700: #0d1c45;
  --navy-50: #eef1f8;
  --gold: #ffb71b;
  --gold-600: #e6a000;
  --gold-100: #fff4d6;
  --gold-text: #8a5a00;      /* gold that passes contrast on light backgrounds */
  --wa: #0e7a3e;
  --wa-700: #0b6633;
  --bg: #f7f6f1;
  --surface: #fff;
  --line: #e3e1d8;
  --text: #14213d;
  --muted: #59627a;
  --danger: #b3261e;

  --font-body: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Fredoka', 'Nunito Sans', system-ui, sans-serif;

  --radius: 18px;
  --radius-lg: 26px;
  --header-h: 60px;
  --gutter: 16px;
  --max: 1200px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --shadow-sm: 0 1px 2px rgba(20, 40, 95, .06), 0 2px 8px rgba(20, 40, 95, .06);
  --shadow-md: 0 10px 30px rgba(20, 40, 95, .14);
  --shadow-lg: 0 24px 60px rgba(13, 28, 69, .28);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body.dialog-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, label { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 8px; }
.hero :focus-visible, .contact-card :focus-visible, .basket-bar :focus-visible { outline-color: var(--gold); }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 22px; height: 22px; flex: none; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px;
  font: 700 16px/1 var(--font-body);
  transition: transform .15s, background-color .2s, box-shadow .2s;
  position: relative;
}
.btn:active { transform: scale(.96); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-gold { background: var(--gold); color: var(--navy-700); box-shadow: 0 6px 20px rgba(255, 183, 27, .35); }
.btn-gold:hover { background: var(--gold-600); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-700); }
.btn-ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-quiet { background: #ebe9e0; color: var(--text); }
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  position: relative; width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--navy);
  transition: background-color .2s, transform .15s;
}
.icon-btn:hover { background: var(--navy-50); }
.icon-btn:active { transform: scale(.92); }
.link-btn {
  min-height: 44px; padding: 0 6px; border: 0; background: none;
  color: var(--navy); font-weight: 700; font-size: 15px; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn.center { display: block; margin: 8px auto 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: transform .35s var(--ease-out);
}
body.header-hidden .site-header { transform: translateY(-100%); }
.header-inner { display: flex; align-items: center; gap: 4px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-right: auto; font: 700 19px/1 var(--font-head); color: var(--navy); }
.brand-mark { width: 40px; height: 40px; object-fit: contain; flex: none; }
.brand-accent { color: var(--gold-text); }

.basket-btn .badge {
  position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px; border: 2px solid #fff;
  background: var(--gold); color: var(--navy-700); font: 800 12px/1 var(--font-body);
}
.bump { animation: bump .45s var(--ease-spring); }
@keyframes bump { 40% { transform: scale(1.25); } }

.btn-header { display: none; }

.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

.main-nav {
  position: absolute; left: 0; right: 0; top: 100%;
  display: none; flex-direction: column;
  padding: 4px var(--gutter) 12px;
  background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
}
.main-nav.nav-open { display: flex; animation: drop .2s var(--ease-out); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.main-nav a { display: flex; align-items: center; min-height: 54px; border-bottom: 1px solid var(--line); font: 600 20px/1 var(--font-head); color: var(--navy); }
.main-nav a:last-child { border-bottom: 0; }
.main-nav a[aria-current] { color: var(--gold-text); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(255, 183, 27, .2), transparent 55%),
    radial-gradient(90% 60% at 0% 100%, rgba(84, 120, 255, .28), transparent 60%),
    var(--navy);
  color: #fff;
  padding: 26px 0 64px;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.6px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 75%); mask-image: linear-gradient(to bottom, #000 0%, transparent 75%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.eyebrow { font: 800 12px/1.3 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.eyebrow-dark { color: var(--gold-text); }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px;
  border-radius: 999px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  letter-spacing: .08em; font-size: 12px;
  animation: rise .6s var(--ease-out) both;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }

.hero h1 { margin: 16px 0 16px; font: 700 clamp(44px, 13vw, 76px)/1 var(--font-head); letter-spacing: -.02em; }
.hero h1 .line { display: block; animation: rise .7s var(--ease-out) both; }
.hero h1 .line + .line { animation-delay: .1s; }
.hero h1 em { position: relative; display: inline-block; font-style: normal; color: var(--gold); }
.scribble { position: absolute; left: -2%; bottom: -.14em; width: 104%; height: .26em; overflow: visible; }
.scribble path { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 240; stroke-dashoffset: 240; animation: draw .9s .55s var(--ease-out) forwards; opacity: .9; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.hero-lead { max-width: 36ch; font-size: 17px; color: #dbe1f2; animation: rise .7s .2s var(--ease-out) both; }
.hero-actions { display: grid; gap: 10px; margin-top: 26px; animation: rise .7s .3s var(--ease-out) both; }

@keyframes tile-in { from { opacity: 0; transform: translateY(26px) scale(.94); } }

.spin-badge {
  position: absolute; left: -4px; top: -2px; z-index: 3;
  width: 96px; height: 96px; display: grid; place-items: center;
  border-radius: 50%; background: var(--gold); color: var(--navy-700);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
  animation: tile-in .7s .6s var(--ease-out) both;
}
.spin-badge > svg:not(.spin-badge-star) { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 16s linear infinite; }
.spin-badge text { font: 800 9.5px var(--font-body); fill: currentColor; }
.spin-badge-star { position: relative; width: 30px; height: 30px; color: var(--navy-700); animation: hi-twinkle 2.8s ease-in-out infinite; }
.eyebrow-more { display: none; }
@media (min-width: 480px) { .eyebrow-more { display: inline; } }

/* ---------- Hero illustration ---------- */
.hero-art { position: relative; width: 100%; max-width: 420px; margin-inline: auto; animation: tile-in .8s .2s var(--ease-out) both; }
.hero-illustration { display: block; width: 100%; height: auto; overflow: visible; }
.hero-illustration text { font-family: var(--font-head); font-weight: 700; }
.hi-float, .hi-shadow, .hi-bob, .hi-wiggle, .hi-twinkle, .hi-orbit, .hi-mist circle { transform-box: fill-box; transform-origin: center; }
.hi-float { animation: hi-float 6s ease-in-out infinite; }
.hi-shadow { animation: hi-shadow 6s ease-in-out infinite; }
.hi-bob { animation: hi-bob 4.6s ease-in-out infinite; }
.hi-wiggle { animation: hi-wiggle 5s ease-in-out infinite; }
.hi-twinkle { animation: hi-twinkle 2.8s ease-in-out infinite; }
.hi-orbit { animation: spin 70s linear infinite; }
.hi-mist circle { opacity: 0; animation: hi-mist 2.4s ease-out infinite; }
.hi-mist circle:nth-child(2) { animation-delay: .25s; }
.hi-mist circle:nth-child(3) { animation-delay: .5s; }
.hero-art .d1 { animation-delay: -1.2s; }
.hero-art .d2 { animation-delay: -2.4s; }
.hero-art .d3 { animation-delay: -3.6s; }
@keyframes hi-float { 50% { transform: translateY(-10px); } }
@keyframes hi-shadow { 50% { transform: scaleX(.85); opacity: .55; } }
@keyframes hi-bob { 50% { transform: translateY(-9px) rotate(6deg); } }
@keyframes hi-wiggle { 50% { transform: rotate(-3deg); } }
@keyframes hi-twinkle { 0%, 100% { transform: scale(.55); opacity: .35; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes hi-mist { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 25% { opacity: .85; } 100% { opacity: 0; transform: translate(16px, -5px) scale(1.4); } }

.float-pill {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border-radius: 16px; background: rgba(255, 255, 255, .96); color: var(--navy);
  box-shadow: 0 12px 28px rgba(5, 12, 35, .35);
  animation: pill-float 5s ease-in-out infinite;
}
.float-pill b { display: block; font: 700 15px/1.15 var(--font-head); }
.float-pill small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.pill-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--gold); color: var(--navy-700); }
.pill-icon.wa { background: var(--wa); color: #fff; }
.pill-icon .icon { width: 20px; height: 20px; }
.pill-a { left: -2px; bottom: 5%; rotate: -4deg; }
.pill-b { right: -2px; top: 4%; rotate: 3deg; animation-delay: -2.5s; }
@keyframes pill-float { 50% { translate: 0 -8px; } }

/* ---------- Marquee band ---------- */
.band-wrap { position: relative; z-index: 3; margin-top: -30px; padding: 14px 0; overflow: hidden; }
.band { margin-inline: -24px; padding: 13px 0; background: var(--gold); color: var(--navy-700); rotate: -2deg; box-shadow: 0 10px 26px rgba(20, 40, 95, .2); }
.band-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.band-list { display: flex; flex: none; }
.band-list li { display: flex; align-items: center; gap: 22px; padding-right: 22px; font: 600 18px/1 var(--font-head); white-space: nowrap; }
.band-list .icon { width: 16px; height: 16px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 44px 0; }
.section-head { margin-bottom: 20px; }
.section-head h2, .contact-card h2 { margin-top: 8px; font: 700 clamp(30px, 8vw, 46px)/1.08 var(--font-head); letter-spacing: -.01em; color: var(--navy); }
.section-lead { margin-top: 10px; max-width: 52ch; color: var(--muted); }

/* Scroll-driven reveal: pure CSS progressive enhancement, content is visible where unsupported. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal, .product-card { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
    .chat-preview .bubble { animation: pop linear both; animation-timeline: view(); animation-range: entry 30% entry 70%; }
    .chat-preview .bubble.in { animation-range: entry 55% entry 95%; }
  }
}
@keyframes reveal { from { opacity: 0; translate: 0 28px; } }
@keyframes pop { from { opacity: 0; scale: .85; } }

/* ---------- Catalogue controls ---------- */
.search { position: relative; }
.search-icon { position: absolute; left: 16px; top: 15px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 52px; padding: 0 52px 0 48px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 16px; /* 16px prevents iOS zoom-on-focus */
  outline: 0; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.search input:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(20, 40, 95, .12); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-kbd { display: none; }
.search-clear { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.search-clear:hover { background: var(--navy-50); }

.chips-bar {
  position: sticky; top: var(--header-h); z-index: 30;
  margin: 10px calc(var(--gutter) * -1) 0; padding: 10px var(--gutter);
  background: linear-gradient(var(--bg) 80%, rgba(247, 246, 241, 0));
  transition: top .35s var(--ease-out);
}
body.header-hidden .chips-bar { top: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px 0 16px; scroll-snap-align: start;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  font: 700 15px/1 var(--font-body); color: var(--text); white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s;
}
.chip:active { transform: scale(.95); }
.chip:hover { border-color: var(--navy); }
.chip-count { min-width: 26px; padding: 5px 7px; border-radius: 999px; background: var(--navy-50); font-size: 12px; text-align: center; color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[aria-pressed="true"] .chip-count { background: var(--gold); color: var(--navy-700); }

.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--muted); }
.result-actions { display: flex; align-items: center; gap: 4px; }
.sort select {
  height: 44px; padding: 0 34px 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 16px; font-weight: 700; color: var(--navy); cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314285f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}

.demo-notice { margin: 2px 0 14px; padding: 10px 14px; border: 1px solid #f0d58a; border-radius: 12px; background: #fff7dc; color: #4d3d0a; font-size: 14px; }

/* ---------- Product grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 240px; }
.product-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.product-card.in-basket { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 183, 27, .25), var(--shadow-sm); }
.card-media { position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden; background: #fff; border-bottom: 1px solid #f0eee6; }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; transition: transform .4s var(--ease-out); }
.fade-img { opacity: 0; transition: opacity .4s, transform .4s var(--ease-out); }
.fade-img.loaded { opacity: 1; }
.media-fallback { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(145deg, #eef1f8, #f7f6f1); color: #8a93ab; }
.media-fallback .icon { width: 44px; height: 44px; }
.sample-tag { position: absolute; top: 8px; left: 8px; padding: 4px 9px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.in-basket-tag {
  position: absolute; top: 8px; right: 8px; display: none; align-items: center; gap: 3px; padding: 4px 8px 4px 6px;
  border-radius: 999px; background: var(--gold); color: var(--navy-700); font-size: 12px; font-weight: 800;
}
.in-basket-tag .icon { width: 14px; height: 14px; }
.product-card.in-basket .in-basket-tag { display: inline-flex; animation: bump .4s var(--ease-spring); }

.product-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 5px; padding: 12px 12px 12px; }
.product-category { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); }
.product-name { font: 600 16px/1.25 var(--font-head); color: var(--navy); }
.name-btn { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.name-btn::after { content: ''; position: absolute; inset: 0 0 auto 0; aspect-ratio: 1; cursor: zoom-in; } /* stretches the tap target over the product image */
.pack-chip { padding: 3px 9px; border-radius: 8px; background: var(--navy-50); color: var(--navy); font-size: 12px; font-weight: 800; }
.product-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.45; color: var(--muted); }
.product-foot { display: grid; gap: 10px; width: 100%; margin-top: auto; padding-top: 8px; }
.product-price { font: 700 20px/1 var(--font-head); color: var(--navy); }

.add-btn { min-height: 46px; width: 100%; padding: 0 12px; font-size: 15px; background: var(--navy); color: #fff; }
.add-btn:hover { background: var(--navy-700); }
.stepper {
  display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; min-height: 46px; width: 100%;
  border-radius: 999px; background: var(--gold); color: var(--navy-700);
}
.stepper button { height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; transition: background-color .15s, transform .12s; }
.stepper button:hover { background: rgba(0, 0, 0, .07); }
.stepper button:active { transform: scale(.88); }
.stepper .icon { width: 18px; height: 18px; }
.stepper output { text-align: center; font: 700 18px/1 var(--font-head); font-variant-numeric: tabular-nums; }
.product-card:not(.in-basket) .stepper { display: none; }
.product-card.in-basket .add-btn { display: none; }

.empty-state { grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px; padding: 40px 16px; text-align: center; color: var(--muted); }
.empty-state > .icon { width: 52px; height: 52px; color: var(--gold-text); }
.empty-state h3 { font: 600 22px/1.2 var(--font-head); color: var(--navy); }
.empty-state p { max-width: 36ch; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

.skeleton-card { padding: 0 0 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; gap: 10px; }
.sk { background: linear-gradient(90deg, #eceae1 25%, #f6f5ef 50%, #eceae1 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px; }
.sk-img { aspect-ratio: 1; border-radius: 0; }
.sk-line { height: 14px; margin: 0 12px; }
.sk-line.short { width: 55%; }
.sk-btn { height: 44px; margin: 4px 12px 0; border-radius: 999px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- How it works ---------- */
.about-section { background: #fff; border-block: 1px solid var(--line); }
.how-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; counter-reset: step; }
.steps li { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--bg); border-radius: var(--radius); }
.step-num { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 14px; background: var(--gold); color: var(--navy-700); font: 700 20px/1 var(--font-head); rotate: -6deg; }
.steps li:nth-child(2) .step-num { rotate: 5deg; }
.steps h3 { font: 600 18px/1.25 var(--font-head); color: var(--navy); }
.steps p { margin-top: 2px; color: var(--muted); font-size: 15px; }

.chat-preview { overflow: hidden; border-radius: var(--radius-lg); background: #efeae2; box-shadow: var(--shadow-md); border: 6px solid var(--navy-700); }
.chat-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; }
.chat-top img { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.chat-top strong { display: block; font-size: 15px; line-height: 1.2; }
.chat-top small { color: var(--wa); font-weight: 700; font-size: 12px; }
.chat-body {
  display: grid; gap: 10px; padding: 16px 12px 18px;
  background-image: radial-gradient(rgba(0, 0, 0, .05) 1px, transparent 1.5px); background-size: 14px 14px;
}
.bubble { position: relative; max-width: 86%; padding: 9px 12px 22px; border-radius: 14px; font-size: 14px; line-height: 1.5; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); }
.bubble.out { justify-self: end; background: #d9fdd3; border-top-right-radius: 4px; }
.bubble.in { justify-self: start; background: #fff; border-top-left-radius: 4px; }
.bubble .meta { position: absolute; right: 10px; bottom: 5px; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: #667781; }
.bubble .meta .icon { width: 14px; height: 14px; color: #53bdeb; }
.chat-preview figcaption { padding: 8px 14px; background: #fff; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }

/* ---------- Contact ---------- */
.contact-card { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 30px 22px; border-radius: var(--radius-lg); background: var(--navy); color: #fff; }
.contact-card::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .1) 1px, transparent 1.6px); background-size: 20px 20px; -webkit-mask-image: linear-gradient(135deg, transparent 40%, #000); mask-image: linear-gradient(135deg, transparent 40%, #000); pointer-events: none; }
.contact-card::after { content: ''; position: absolute; right: -70px; bottom: -90px; width: 220px; height: 220px; border-radius: 50%; background: var(--gold); opacity: .14; pointer-events: none; }
.contact-card h2 { color: #fff; }
.contact-card p:not(.eyebrow) { margin-top: 10px; color: #dbe1f2; }
.contact-card .btn { position: relative; z-index: 1; width: 100%; }

/* ---------- Footer ---------- */
.site-footer { padding: 28px 0 calc(110px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 10px; text-align: center; }
.footer-tag { color: var(--muted); font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; }
.footer-links a, .footer-links button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border: 0; background: none; font-size: 15px; font-weight: 700; color: var(--navy); }
.footer-links button { color: var(--muted); font-weight: 600; }
.footer-copy { font-size: 13px; color: var(--muted); }
.back-top { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--navy-50); font-size: 14px; font-weight: 800; color: var(--navy); }
.back-top .icon { width: 18px; height: 18px; }

/* ---------- Floating chat button & basket bar ---------- */
.wa-fab {
  position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 40;
  display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 22px 0 16px;
  border-radius: 999px; background: var(--wa); color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 8px 24px rgba(14, 122, 62, .45);
  transition: transform .3s var(--ease-out), opacity .3s;
}
.wa-fab .icon { width: 26px; height: 26px; }
.wa-fab.is-hidden, body.has-basket .wa-fab { transform: translateY(140%); opacity: 0; pointer-events: none; }

.basket-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 45;
  transform: translateY(160%); transition: transform .45s var(--ease-spring);
}
body.has-basket .basket-bar { transform: none; }
.basket-bar-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 8px 8px 10px;
  border: 0; border-radius: 22px; background: var(--navy-700); color: #fff; text-align: left;
  box-shadow: var(--shadow-lg);
}
.bb-icon { position: relative; display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 16px; background: rgba(255, 255, 255, .1); }
.bb-count { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--gold); color: var(--navy-700); font: 800 12px/1 var(--font-body); }
.bb-text { display: grid; gap: 2px; margin-right: auto; }
.bb-text strong { font: 700 19px/1.1 var(--font-head); white-space: nowrap; }
.bb-text small { font-size: 13px; color: #b9c3e0; font-weight: 600; }
.bb-cta { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 16px; border-radius: 16px; background: var(--gold); color: var(--navy-700); font-weight: 800; font-size: 15px; }
.bb-cta .icon { width: 18px; height: 18px; }

/* Flying thumbnail when an item is added */
.fly-ghost { position: fixed; z-index: 200; pointer-events: none; object-fit: contain; background: #fff; border-radius: 14px; box-shadow: var(--shadow-md); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + var(--safe-b)); z-index: 300;
  display: flex; align-items: center; gap: 14px;
  width: max-content; max-width: min(92vw, 460px); padding: 12px 12px 12px 18px; min-height: 52px;
  background: #1b2440; color: #fff; border-radius: 16px;
  font-size: 15px; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translate(-50%, 16px) scale(.96); pointer-events: none; transition: opacity .2s, transform .3s var(--ease-spring);
}
body.has-basket .toast { bottom: calc(92px + var(--safe-b)); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.toast-action { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--gold); color: var(--navy-700); font-weight: 800; font-size: 14px; white-space: nowrap; }

/* ---------- Bottom sheets (quick view & basket) ---------- */
.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0; padding: 0; border: 0;
  width: 100%; max-width: none; max-height: 92vh; max-height: 92dvh;
  border-radius: 26px 26px 0 0; background: #fff; color: var(--text);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); overflow: hidden; overscroll-behavior: contain;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .38s var(--ease-out); }
.sheet.closing { animation: sheet-down .24s ease-in forwards; }
.sheet::backdrop { background: rgba(10, 18, 45, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .3s ease-out; }
.sheet.closing::backdrop { animation: fade .24s ease-in reverse forwards; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-grab, .sheet-head { touch-action: none; }
.sheet-grab { position: absolute; top: 0; left: 0; right: 0; z-index: 3; height: 28px; display: grid; place-items: center; cursor: grab; }
.sheet-handle { display: block; width: 44px; height: 5px; border-radius: 999px; background: #d3d1c8; }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 4; background: rgba(255, 255, 255, .92); box-shadow: var(--shadow-sm); }
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* Quick view */
.qv-media { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; height: min(44vh, 360px); padding: 34px 24px 16px; background: radial-gradient(circle at 50% 60%, #fff 30%, #f3f1ea 100%); }
.qv-media img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; animation: tile-in .45s var(--ease-out) both; }
.qv-media .sample-tag { top: 16px; left: 16px; }
.qv-body { display: grid; gap: 10px; padding: 20px 18px calc(22px + var(--safe-b)); }
.qv-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qv-title { font: 700 28px/1.1 var(--font-head); color: var(--navy); }
.qv-desc { color: var(--muted); }
.qv-price { font: 700 30px/1 var(--font-head); color: var(--navy); }
.qv-price small { margin-left: 6px; font: 700 14px var(--font-body); color: var(--muted); }
.qv-buy { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 10px; margin-top: 6px; }
.qv-buy .stepper { min-height: 54px; }
.qv-buy .stepper button { height: 54px; }
.qv-buy .btn { min-height: 54px; padding: 0 14px; white-space: nowrap; }
.qv-secondary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qv-secondary .btn-wa { flex: 1; }
.share-btn { width: 54px; height: 54px; background: var(--navy-50); }

/* Basket sheet */
.sheet-head { padding: 10px 12px 8px 18px; border-bottom: 1px solid var(--line); }
.sheet-head .sheet-handle { margin: 0 auto 8px; }
.sheet-head-row { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { display: flex; align-items: center; gap: 8px; font: 700 24px/1.1 var(--font-head); color: var(--navy); }
.count-pill { padding: 3px 10px; border-radius: 999px; background: var(--navy-50); font: 800 13px/1.3 var(--font-body); color: var(--navy); }
.basket-items { display: grid; padding: 4px 18px; }
.basket-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.bi-thumb { width: 64px; height: 64px; border-radius: 14px; border: 1px solid var(--line); background: #fff; object-fit: contain; padding: 4px; }
.bi-thumb.media-fallback { padding: 14px; }
.bi-top { display: flex; justify-content: space-between; gap: 10px; }
.bi-name { font: 600 16px/1.25 var(--font-head); color: var(--navy); }
.bi-meta { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.bi-total { font: 700 17px/1.2 var(--font-head); color: var(--navy); white-space: nowrap; }
.bi-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.stepper-sm { width: 140px; grid-template-columns: 44px 1fr 44px; min-height: 44px; background: var(--navy-50); color: var(--navy); }
.stepper-sm button { height: 44px; }
.stepper-sm output { font-size: 16px; }
.remove-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--danger); font-size: 14px; font-weight: 700; }
.remove-btn .icon { width: 18px; height: 18px; }
.remove-btn:hover { background: #fbeceb; }

.basket-empty { display: grid; justify-items: center; gap: 8px; padding: 36px 24px 28px; text-align: center; color: var(--muted); }
.basket-empty-art { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 28px; background: var(--gold-100); color: var(--gold-text); rotate: -6deg; margin-bottom: 6px; }
.basket-empty-art .icon { width: 40px; height: 40px; }
.basket-empty h3 { font: 600 22px/1.2 var(--font-head); color: var(--navy); }
.basket-empty .btn { margin-top: 8px; }

.order-details { margin: 8px 18px 20px; padding: 16px; border-radius: var(--radius); background: var(--bg); }
.details-head { display: flex; align-items: baseline; justify-content: space-between; }
.details-head h3 { font: 600 18px/1.2 var(--font-head); color: var(--navy); }
.details-head span { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.details-hint { margin: 4px 0 14px; font-size: 13px; color: var(--muted); }
.order-details .field:last-child { margin-bottom: 0; }

.sheet-foot { display: grid; gap: 10px; padding: 14px 18px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -8px 20px rgba(20, 40, 95, .06); }
.total-row { display: flex; align-items: baseline; justify-content: space-between; font-weight: 700; }
.total-row small { margin-left: 4px; font-size: 13px; color: var(--muted); }
.total-row strong { font: 700 26px/1 var(--font-head); color: var(--navy); }
.foot-note { font-size: 12px; text-align: center; color: var(--muted); }

/* ---------- Forms (shared) ---------- */
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--text); }
.field input:not([type=checkbox]):not([type=file]), .field textarea {
  display: block; width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid #d4d2c8; border-radius: 12px; background: #fff;
  font-size: 16px; /* prevents iOS zoom */ outline: 0; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 80px; line-height: 1.45; }
.field input:focus, .field textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(20, 40, 95, .12); }
.field-hint { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }

/* ---------- Admin dialog (full-screen on phones, centred card on larger) ---------- */
.admin-dialog {
  margin: 0; padding: 0; border: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none;
  background: var(--bg); color: var(--text); overscroll-behavior: contain;
}
.admin-dialog::backdrop { background: rgba(10, 20, 50, .6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.admin-shell { min-height: 100%; }
.admin-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px 16px; background: #fff; border-bottom: 1px solid var(--line);
}
.admin-brand { display: flex; align-items: center; gap: 8px; font: 700 17px/1 var(--font-head); color: var(--navy); }
.admin-brand .brand-mark { width: 36px; height: 36px; }
.admin-body { width: 100%; max-width: 560px; margin-inline: auto; padding: 22px 16px calc(32px + var(--safe-b)); }
.admin-body h2 { margin: 6px 0 6px; font: 700 28px/1.15 var(--font-head); color: var(--navy); }
.admin-intro { margin-bottom: 18px; color: var(--muted); font-size: 15px; }
.admin-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.file-drop { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 16px; border: 2px dashed #b9bdcc; border-radius: 12px; background: #fff; color: var(--navy); font-weight: 700; cursor: pointer; }
.file-drop:hover { background: var(--navy-50); }
.field:has(#image-input:focus-visible) .file-drop { outline: 3px solid var(--navy); outline-offset: 2px; }
.image-preview { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.image-preview img { width: 100%; max-height: 220px; object-fit: contain; padding: 8px; }

.switch-row { display: flex; align-items: center; gap: 12px; min-height: 52px; margin-bottom: 8px; font-weight: 700; cursor: pointer; }
.switch-row input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 52px; height: 30px; margin: 0; border-radius: 999px; background: #c5c8d4; transition: background-color .2s; cursor: pointer; }
.switch-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch-row input:checked { background: var(--wa); }
.switch-row input:checked::after { transform: translateX(22px); }

.form-actions { display: grid; gap: 10px; margin-top: 8px; }

.admin-list-wrap { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin-list-wrap h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font: 600 20px/1.2 var(--font-head); color: var(--navy); }
.admin-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.admin-thumb { display: grid; place-items: center; width: 52px; height: 52px; flex: none; overflow: hidden; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: #8a93ab; }
.admin-thumb img { width: 100%; height: 100%; object-fit: contain; }
.admin-row-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.admin-row-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 16px/1.25 var(--font-head); }
.admin-row-copy span { font-size: 13px; color: var(--muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--wa); }
.status-dot.off { background: #b6b9c6; }
.admin-row-button { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--navy-50); color: var(--navy); }
.admin-row-button.danger { background: #fbeceb; color: var(--danger); }
.admin-row-button .icon { width: 20px; height: 20px; }
.admin-empty, .config-notice { font-size: 15px; color: var(--muted); }
.config-notice { margin-top: 18px; padding: 14px; border-radius: 12px; background: #fff7dc; color: #4d3d0a; }
.config-notice code { font-weight: 700; }

/* ==========================================================================
   Larger screens
   ========================================================================== */
@media (min-width: 480px) {
  :root { --gutter: 20px; }
  .product-grid { gap: 16px; }
  .product-body { padding: 14px; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .form-actions { display: flex; }
  .form-actions .btn { flex: 0 1 auto; }
}

@media (min-width: 640px) {
  .hero-actions { display: flex; flex-wrap: wrap; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps li { padding: 18px; }
  .contact-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 44px; }
  .contact-card .btn { width: auto; }

  .admin-dialog { margin: auto; width: min(580px, calc(100% - 48px)); height: auto; max-height: 90vh; max-height: 90dvh; border-radius: var(--radius-lg); box-shadow: 0 30px 90px rgba(10, 20, 50, .4); }
  .admin-bar { padding-top: 8px; }
}

@media (min-width: 820px) {
  :root { --gutter: 32px; --header-h: 72px; }
  .section { padding: 80px 0; }
  .header-inner { gap: 12px; }
  .brand { margin-right: 16px; font-size: 22px; }
  .brand-mark { width: 46px; height: 46px; }
  .menu-toggle { display: none; }
  .main-nav { position: static; display: flex; flex-direction: row; gap: 4px; margin-right: auto; padding: 0; background: none; border: 0; box-shadow: none; }
  .main-nav a { min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; font: 700 16px/1 var(--font-body); }
  .main-nav a:hover { background: var(--navy-50); }
  .btn-header { display: inline-flex; min-height: 44px; padding: 0 20px; }

  .hero { padding: 72px 0 110px; }
  .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 64px; }
  .hero-lead { font-size: 19px; }
  .spin-badge { width: 116px; height: 116px; left: -28px; top: -18px; }
  .hero-art { max-width: 500px; }
  .float-pill b { font-size: 17px; }
  .spin-badge-star { width: 36px; height: 36px; }
  .band-wrap { margin-top: -60px; padding: 30px 0; }
  .band-list li { font-size: 22px; gap: 30px; padding-right: 30px; }

  .search { max-width: 480px; }
  .search-kbd { display: grid; place-items: center; position: absolute; right: 16px; top: 14px; width: 24px; height: 24px; border: 1.5px solid var(--line); border-radius: 6px; font: 700 13px/1 var(--font-body); color: var(--muted); pointer-events: none; }
  .search:has(.search-clear:not([hidden])) .search-kbd, .search:has(input:focus) .search-kbd { display: none; }
  .chips-bar { position: static; margin: 14px 0 0; padding: 0; background: none; }
  .chips { flex-wrap: wrap; overflow: visible; }
  .product-grid { gap: 20px; }
  .product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
  .product-card:hover .card-media img { transform: scale(1.05); }
  .product-name { font-size: 17px; }

  .how-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: 48px; }

  .wa-fab { display: none; } /* the header already has a chat button */
  .basket-bar { left: auto; right: 24px; bottom: 24px; width: 400px; }
  .toast, body.has-basket .toast { bottom: 28px; left: 32px; transform: translate(0, 16px) scale(.96); }
  .toast.show { transform: none; }
  .site-footer { padding-bottom: 36px; }
  .footer-inner { grid-template-columns: auto 1fr auto; justify-items: start; align-items: center; text-align: left; gap: 8px 24px; }
  .footer-tag { grid-column: 2; }
  .footer-links { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .footer-copy { grid-column: 1; grid-row: 2; }
  .back-top { grid-column: 3; grid-row: 1 / span 2; }

  /* Sheets become a centred modal (quick view) and a side drawer (basket) */
  .sheet-grab, .sheet-head .sheet-handle { display: none; }
  .sheet-product { inset: 0; margin: auto; width: min(900px, calc(100% - 64px)); max-height: min(640px, 88dvh); border-radius: var(--radius-lg); }
  .sheet-product[open] { animation: zoom-in .3s var(--ease-out); }
  .sheet-product.closing { animation: zoom-out .2s ease-in forwards; }
  .sheet-product .sheet-scroll { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .qv-media { height: 100%; min-height: min(460px, 80dvh); padding: 40px; }
  .qv-body { align-content: center; padding: 48px 40px; }
  .qv-title { font-size: 34px; }
  .sheet-basket { inset: 0 0 0 auto; width: min(440px, 100%); max-height: none; height: 100dvh; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
  .sheet-basket[open] { animation: slide-in .35s var(--ease-out); }
  .sheet-basket.closing { animation: slide-out .22s ease-in forwards; }
  .sheet-head { padding: 16px 16px 12px 22px; }
  @keyframes zoom-in { from { opacity: 0; transform: scale(.94); } }
  @keyframes zoom-out { to { opacity: 0; transform: scale(.96); } }
  @keyframes slide-in { from { transform: translateX(100%); } }
  @keyframes slide-out { to { transform: translateX(100%); } }
}

@media (min-width: 1100px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .band-track { animation: none; }
  .scribble path { stroke-dashoffset: 0; }
}

/* Long unbroken words (e.g. typos in admin-entered text) must never push past their container. */
.product-name, .product-desc, .bi-name, .qv-title, .qv-desc, .admin-row-copy span { overflow-wrap: anywhere; }

/* ---------- Small phones (iPhone SE 1st gen, small Androids) ---------- */
@media (max-width: 379px) {
  .wide-only { display: none; }
  .qv-buy { grid-template-columns: minmax(0, 1fr); }
  .bb-text strong { font-size: 17px; }
  .basket-bar-btn { gap: 10px; }
}

/* ---------- Phones in landscape: short screens get side-by-side sheets ---------- */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 819px) {
  .sheet { max-height: 94dvh; }
  .sheet-product .sheet-scroll { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .sheet-product .qv-media { height: auto; min-height: 100%; padding: 32px 16px 16px; }
  .sheet-product .qv-body { padding: 26px 20px 16px; gap: 8px; }
  .qv-title { font-size: 24px; }
  .qv-price { font-size: 24px; }
  .sheet-head { padding-top: 6px; }
  .sheet-head .sheet-handle { margin-bottom: 4px; }
  .sheet-head h2 { font-size: 20px; }
  .sheet-foot { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; padding-block: 10px; }
  .sheet-foot .btn-lg { min-height: 50px; }
  .foot-note { display: none; }
  .total-row { display: grid; gap: 2px; }
  .total-row strong { font-size: 22px; }
}

/* Short portrait screens: a smaller photo keeps the Add button in view without scrolling. */
@media (max-height: 700px) and (orientation: portrait) {
  .qv-media { height: 32vh; padding-top: 30px; }
  .qv-body { gap: 8px; padding-top: 16px; }
  .qv-title { font-size: 24px; }
  .qv-price { font-size: 26px; }
}
