/* صافي | Safy — Mobile app UI kit
   Layout: desktop = screen navigator · phone frame · UX notes. Phone (<560px) = full-bleed app. */

:root {
  --bg: #F3F7F8;
  --surface: #FFFFFF;
  --surface-2: #F1F5F7;
  --surface-3: #E7EEF1;
  --tile: #EEF6F7;
  --border: #E3EAEE;
  --text: #0A2230;
  --text-2: #33505E;
  --muted: #7A92A0;
  --primary: #08707E;
  --primary-2: #0BA3B3;
  --on-primary: #FFFFFF;
  --primary-soft: #DDF6F8;
  --primary-ink: #075E6B;
  --accent: #C9F06B;
  --accent-soft: #F3FCD9;
  --accent-ink: #0A2230;
  --deal: #FF5C4D;
  --deal-soft: #FFE6E3;
  --deal-ink: #C9362A;
  --points: #FFB020;
  --points-soft: #FFF3D6;
  --points-ink: #9A6400;
  --ok: #12A15E;
  --ok-soft: #E3F7EC;
  --warn: #E58A00;
  --warn-soft: #FFF2DB;
  --danger: #E5483A;
  --danger-soft: #FFE6E3;
  --overlay: rgba(6, 24, 32, .48);
  --shadow: 0 6px 18px -8px rgba(6, 40, 52, .18), 0 1px 2px rgba(6, 40, 52, .05);
  --shadow-up: 0 -8px 24px -12px rgba(6, 40, 52, .2);
  --page: #E6F2F4;
  --page-ink: #0A2230;
  --panel: rgba(255, 255, 255, .72);
  --panel-border: rgba(8, 112, 126, .12);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #061A21;
  --surface: #0C2530;
  --surface-2: #112F3B;
  --surface-3: #173A47;
  --tile: #10303B;
  --border: #1C4150;
  --text: #E7F1F4;
  --text-2: #B6CAD2;
  --muted: #7F99A5;
  --primary: #2CC3D1;
  --primary-2: #38C2CF;
  --on-primary: #032A31;
  --primary-soft: rgba(56, 194, 207, .14);
  --primary-ink: #7DDAE2;
  --accent: #C9F06B;
  --accent-soft: rgba(201, 240, 107, .12);
  --deal: #FF7466;
  --deal-soft: rgba(255, 92, 77, .14);
  --deal-ink: #FF9A8F;
  --points: #FFC24D;
  --points-soft: rgba(255, 176, 32, .14);
  --points-ink: #FFC24D;
  --ok: #34C77F;
  --ok-soft: rgba(18, 161, 94, .16);
  --warn: #FFAA33;
  --warn-soft: rgba(229, 138, 0, .16);
  --danger: #FF7466;
  --danger-soft: rgba(229, 72, 58, .16);
  --overlay: rgba(0, 0, 0, .6);
  --shadow: 0 8px 22px -10px rgba(0, 0, 0, .6), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-up: 0 -8px 24px -12px rgba(0, 0, 0, .6);
  --page: #04141A;
  --page-ink: #E7F1F4;
  --panel: rgba(12, 37, 48, .78);
  --panel-border: rgba(125, 218, 226, .12);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--page);
  color: var(--page-ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; border-radius: 8px; }
.num, .price, .tnum { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ================= Stage (desktop presentation) ================= */
.stage {
  position: fixed; inset: 0;
  display: grid; grid-template-columns: minmax(240px, 300px) 1fr minmax(240px, 320px);
  align-items: center; gap: 24px; padding: 20px 28px;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(11, 163, 179, .22), transparent 60%),
    radial-gradient(700px 500px at 0% 110%, rgba(201, 240, 107, .25), transparent 60%),
    var(--page);
}
.stage-bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.stage-bubbles i { position: absolute; border-radius: 50%; border: 2px solid rgba(11, 163, 179, .18); background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 60%); }
.panel {
  position: relative; z-index: 2; align-self: stretch; display: flex; flex-direction: column; min-height: 0;
  background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border); border-radius: 24px; padding: 18px;
}
.panel h3 { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.nav-list { overflow-y: auto; margin: 12px -8px 0; padding: 0 8px; scrollbar-width: thin; }
.nav-group { margin-bottom: 14px; }
.nav-group > b { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 6px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 12px; font-size: 13.5px; color: var(--text-2); text-align: start; transition: background .2s, color .2s; }
.nav-item:hover { background: var(--primary-soft); color: var(--text); }
.nav-item.on { background: var(--primary); color: var(--on-primary); }
.nav-item .n { font-size: 11px; opacity: .6; min-width: 18px; font-variant-numeric: tabular-nums; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.brand-row a { color: var(--primary); font-size: 12.5px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.controls { display: grid; gap: 10px; margin-top: 14px; }
.controls .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); }
.note-card { margin-top: 16px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.note-card .eyebrow { font-size: 11px; font-weight: 600; color: var(--primary); letter-spacing: .04em; }
.note-card h4 { margin: 6px 0 8px; font-size: 18px; color: var(--text); text-wrap: balance; }
.note-card p { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
.note-card ul { margin: 10px 0 0; padding-inline-start: 18px; font-size: 13px; line-height: 1.8; color: var(--text-2); }
.pager { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; }
.pager button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text); }

.device-col { position: relative; z-index: 1; display: grid; place-items: center; height: 100%; min-height: 0; }
.device-scale { transform-origin: center center; }
.device {
  position: relative; width: 390px; height: 844px; border-radius: 58px; padding: 11px;
  background: linear-gradient(145deg, #23343B, #0B1418 45%, #1B2A30);
  box-shadow: 0 0 0 2px #3A4C54, 0 40px 80px -20px rgba(3, 30, 38, .55), 0 18px 30px -18px rgba(3, 30, 38, .5), inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.device::before { content: ""; position: absolute; inset-inline-end: -3px; top: 190px; width: 4px; height: 92px; border-radius: 3px; background: #2A3A41; }
.device::after { content: ""; position: absolute; inset-inline-start: -3px; top: 160px; width: 4px; height: 56px; border-radius: 3px; background: #2A3A41; box-shadow: 0 76px 0 #2A3A41; }
.viewport { position: relative; width: 100%; height: 100%; border-radius: 47px; overflow: hidden; background: var(--bg); isolation: isolate; }
.island { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 122px; height: 35px; border-radius: 20px; background: #05090B; z-index: 60; }
.statusbar { position: absolute; top: 0; inset-inline: 0; height: 50px; z-index: 55; display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0; font-size: 15px; font-weight: 600; color: var(--text); pointer-events: none; direction: ltr; transition: color .3s; }
.statusbar.light { color: #fff; }
.statusbar .sb-ic { display: flex; align-items: center; gap: 6px; }
.statusbar svg { display: block; }

/* frameless (real phone or embed) */
body.frameless { overflow: hidden; background: var(--bg); }
body.frameless .stage { display: block; padding: 0; background: var(--bg); }
body.frameless .panel, body.frameless .stage-bubbles { display: none; }
body.frameless .device-col { position: fixed; inset: 0; display: block; }
body.frameless .device-scale { transform: none !important; width: 100%; height: 100%; }
body.frameless .device { width: 100%; height: 100%; border-radius: 0; padding: 0; background: none; box-shadow: none; }
body.frameless .device::before, body.frameless .device::after, body.frameless .island { display: none; }
body.frameless .viewport { border-radius: 0; }
body.frameless.embed .statusbar { display: flex; }
body.frameless:not(.embed) .statusbar { display: none; }
body.frameless:not(.embed) .sb-space { height: env(safe-area-inset-top, 0px); }

@media (max-width: 1180px) { .stage { grid-template-columns: minmax(220px, 260px) 1fr; } .panel.notes { display: none; } }
@media (max-width: 760px) { .stage { grid-template-columns: 1fr; padding: 12px; } .panel.nav { display: none; } }

/* ================= Screen scaffolding ================= */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--text); overflow: hidden; }
.screen.enter { animation: scrIn .42s var(--ease-out) both; }
.screen.enter-back { animation: scrInBack .42s var(--ease-out) both; }
.screen.leave { animation: scrOut .42s var(--ease-out) both; pointer-events: none; }
.screen.leave-back { animation: scrOutBack .42s var(--ease-out) both; pointer-events: none; }
.screen.fade { animation: scrFade .3s ease both; }
@keyframes scrIn { from { transform: translateX(calc(var(--dirx) * 100%)); } to { transform: none; } }
@keyframes scrOut { to { transform: translateX(calc(var(--dirx) * -28%)); filter: brightness(.92); } }
@keyframes scrInBack { from { transform: translateX(calc(var(--dirx) * -28%)); filter: brightness(.92); } to { transform: none; filter: none; } }
@keyframes scrOutBack { to { transform: translateX(calc(var(--dirx) * 100%)); } }
@keyframes scrFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.viewport[dir="rtl"] { --dirx: -1; }
.viewport[dir="ltr"] { --dirx: 1; }

.sb-space { height: 50px; flex: none; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain; position: relative; }
.content::-webkit-scrollbar { display: none; }
.pad { padding: 0 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.bottom-gap { height: 110px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.ok-t { color: var(--ok); } .deal-t { color: var(--deal); } .warn-t { color: var(--warn); } .pri-t { color: var(--primary); }
.ic { width: 22px; height: 22px; stroke-width: 1.9; flex: none; }
.ic.sm { width: 18px; height: 18px; } .ic.xs { width: 15px; height: 15px; } .ic.lg { width: 26px; height: 26px; }
.viewport[dir="ltr"] .flip, .viewport[dir="ltr"] .flip-rtl-back { transform: scaleX(-1); }
.no-anim * { animation: none !important; }
:root[data-theme="dark"] .ph { background: var(--tile) !important; }

/* App bar */
.appbar { display: flex; align-items: center; gap: 10px; padding: 6px 14px 10px; min-height: 52px; flex: none; background: var(--bg); position: relative; z-index: 3; }
.appbar h1 { margin: 0; font-size: 18px; font-weight: 600; flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar h1.start { text-align: start; font-size: 22px; font-weight: 700; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--text); box-shadow: var(--shadow); position: relative; flex: none; transition: transform .15s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.ghost { background: transparent; box-shadow: none; }
.icon-btn .dot { position: absolute; top: 9px; inset-inline-end: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--deal); box-shadow: 0 0 0 2px var(--surface); }
.icon-btn .count { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--deal); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.spacer-42 { width: 42px; flex: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 54px; padding: 0 22px; border-radius: 16px; font-weight: 600; font-size: 15.5px; transition: transform .15s var(--ease-out), box-shadow .2s, background .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 22px -10px rgba(8, 112, 126, .7); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.soft { background: var(--primary-soft); color: var(--primary-ink); }
.btn.outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn.white { background: #fff; color: #075E6B; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 13.5px; }
.btn.md { height: 46px; padding: 0 18px; border-radius: 14px; font-size: 14.5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { color: var(--primary); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; }

/* Cards & sections */
.card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.card.p { padding: 16px; }
.card.flat { box-shadow: none; border: 1px solid var(--border); }
.sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 22px 18px 12px; }
.sec-h h2 { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sec-h p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 18px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }
.divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Pills / chips / badges */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.deal { background: var(--deal); color: #fff; }
.pill.deal-soft { background: var(--deal-soft); color: var(--deal-ink); }
.pill.best { background: var(--accent); color: var(--accent-ink); }
.pill.new { background: var(--primary); color: var(--on-primary); }
.pill.flash { background: #0A2230; color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.pts { background: var(--points-soft); color: var(--points-ink); }
.pill.pri { background: var(--primary-soft); color: var(--primary-ink); }
.pill.muted { background: var(--surface-2); color: var(--muted); }
.pill.ad { background: rgba(10, 34, 48, .55); color: #fff; backdrop-filter: blur(6px); font-size: 10.5px; height: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border); font-size: 13.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; transition: all .2s; }
.chip.on { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary-2); color: var(--primary-ink); font-weight: 600; }
.chip .sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 6px; background: var(--surface-2); border-radius: 14px; padding: 4px; }
.tabs button { flex: 1; height: 38px; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: all .2s; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs-line { display: flex; gap: 20px; padding: 0 18px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs-line button { padding: 10px 0 12px; font-size: 14px; font-weight: 600; color: var(--muted); position: relative; white-space: nowrap; }
.tabs-line button.on { color: var(--text); }
.tabs-line button.on::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 3px; border-radius: 3px; background: var(--primary-2); }
.tabs-line .c { font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 1px 6px; border-radius: 8px; margin-inline-start: 4px; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border); transition: box-shadow .2s; }
.input:focus-within { box-shadow: inset 0 0 0 2px var(--primary-2), 0 0 0 4px var(--primary-soft); }
.input input, .input select, .input textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; height: 100%; }
.input textarea { padding: 14px 0; resize: none; }
.input.area { height: auto; align-items: flex-start; }
.input .ic { color: var(--muted); }
.input .pre { display: inline-flex; align-items: center; gap: 6px; padding-inline-end: 10px; border-inline-end: 1.5px solid var(--border); height: 26px; font-weight: 600; font-size: 14px; direction: ltr; }
.input.err { box-shadow: inset 0 0 0 2px var(--danger); }
.hint { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.hint.err { color: var(--danger); }
.flag-eg { width: 22px; height: 15px; border-radius: 3px; overflow: hidden; display: inline-flex; flex-direction: column; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }
.flag-eg i { flex: 1; } .flag-eg i:nth-child(1) { background: #CE1126; } .flag-eg i:nth-child(2) { background: #fff; position: relative; } .flag-eg i:nth-child(3) { background: #111; }
.flag-eg i:nth-child(2)::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; transform: translate(-50%, -50%); background: #C09300; border-radius: 50%; }

.toggle { width: 50px; height: 30px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .25s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: inset-inline-start .25s var(--ease-spring); }
.toggle.on { background: var(--primary-2); }
.toggle.on::after { inset-inline-start: 23px; }
.check { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--border); display: grid; place-items: center; flex: none; transition: all .2s; color: transparent; }
.check.on { background: var(--primary); box-shadow: none; color: var(--on-primary); }
.radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--border); flex: none; transition: all .2s; }
.radio.on { box-shadow: inset 0 0 0 7px var(--primary-2); }

/* List rows */
.list { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; text-align: start; position: relative; }
.li + .li::before { content: ""; position: absolute; top: 0; inset-inline: 60px 16px; height: 1px; background: var(--border); }
.li .lic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); flex: none; }
.li .t { font-size: 14.5px; font-weight: 500; }
.li .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.li .end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

/* Bottom nav */
.bottomnav { position: absolute; bottom: 0; inset-inline: 0; z-index: 20; padding: 8px 12px 26px; background: var(--surface); box-shadow: var(--shadow-up); border-radius: 26px 26px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; }
.bn { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--muted); padding-top: 6px; position: relative; }
.bn.on { color: var(--primary); font-weight: 700; }
.bn.on::before { content: ""; position: absolute; top: -8px; width: 26px; height: 4px; border-radius: 0 0 4px 4px; background: var(--primary-2); }
.bn-cart { margin-top: -30px; }
.bn-cart .bubble { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-brand); color: #fff; box-shadow: 0 12px 24px -8px rgba(8, 112, 126, .65), 0 0 0 6px var(--surface); position: relative; transition: transform .3s var(--ease-spring); }
.bn-cart .bubble .count { position: absolute; top: 2px; inset-inline-end: 0; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.bn-cart.bump .bubble { animation: bump .5s var(--ease-spring); }
@keyframes bump { 40% { transform: scale(1.18); } }
.bn-cart.on::before { display: none; }

/* Sticky action bar */
.actionbar { position: absolute; bottom: 0; inset-inline: 0; z-index: 15; padding: 12px 16px 28px; background: var(--surface); box-shadow: var(--shadow-up); border-radius: 24px 24px 0 0; display: flex; align-items: center; gap: 12px; }

/* Product card */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 18px; }
.pcard { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 8px 8px 12px; display: flex; flex-direction: column; position: relative; min-width: 0; text-align: start; }
.hscroll .pcard { width: 168px; }
.pcard .ph { position: relative; border-radius: 15px; background: var(--tile); aspect-ratio: 1 / .92; display: grid; place-items: center; overflow: hidden; }
.pcard .ph svg.pack { width: 82%; height: 92%; transition: transform .35s var(--ease-out); }
.pcard:active .ph svg.pack { transform: scale(.96); }
.pcard .badges { position: absolute; top: 7px; inset-inline-start: 7px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pcard .fav { position: absolute; top: 6px; inset-inline-end: 6px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--muted); box-shadow: var(--shadow); }
.pcard .fav.on { color: var(--deal); }
.pcard .fav.on svg { fill: currentColor; }
.pcard .b { font-size: 11.5px; color: var(--muted); margin: 9px 4px 0; font-weight: 500; }
.pcard .nm { font-size: 13.5px; font-weight: 600; line-height: 1.45; margin: 2px 4px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.pcard .sz { font-size: 11.5px; color: var(--text-2); margin: 4px 4px 0; display: flex; align-items: center; gap: 4px; }
.pcard .pr { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin: 8px 4px 0; }
.pcard .price { font-size: 16px; font-weight: 700; line-height: 1.1; }
.pcard .price small { font-size: 11px; font-weight: 500; color: var(--muted); }
.pcard .old { font-size: 11.5px; color: var(--muted); text-decoration: line-through; }
.pcard .mg { font-size: 11px; color: var(--muted); margin: 6px 4px 0; display: flex; align-items: center; gap: 4px; }
.pcard .mg b { color: var(--ok); font-weight: 700; }
.add-btn { width: 38px; height: 38px; border-radius: 13px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex: none; transition: transform .2s var(--ease-spring); box-shadow: 0 8px 16px -8px rgba(8, 112, 126, .8); }
.add-btn:active { transform: scale(.88); }
.oos { position: absolute; inset: 0; background: rgba(241, 245, 247, .7); display: grid; place-items: center; }
:root[data-theme="dark"] .oos { background: rgba(6, 26, 33, .7); }
.oos span { background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px; }

.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--primary-soft); border-radius: 13px; height: 38px; padding: 3px; }
.stepper button { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--primary-ink); }
.stepper button:active { background: rgba(255, 255, 255, .6); }
.stepper .q { min-width: 26px; text-align: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text); }
.stepper.lg { height: 54px; border-radius: 16px; padding: 4px; }
.stepper.lg button { width: 44px; height: 46px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.stepper.lg .q { min-width: 46px; font-size: 18px; }
.stepper.lg .q small { display: block; font-size: 10px; color: var(--muted); font-weight: 500; }

/* Sheets, dialogs, toasts */
.overlay { position: absolute; inset: 0; z-index: 80; background: var(--overlay); opacity: 0; transition: opacity .3s; }
.overlay.on { opacity: 1; }
.sheet { position: absolute; inset-inline: 0; bottom: 0; z-index: 81; background: var(--surface); border-radius: 30px 30px 0 0; max-height: 88%; display: flex; flex-direction: column; transform: translateY(105%); transition: transform .42s var(--ease-out); box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, .3); }
.sheet.on { transform: none; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 10px auto 4px; flex: none; }
.sheet .sh-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px 12px; flex: none; }
.sheet .sh-h h3 { margin: 0; font-size: 18px; font-weight: 700; }
.sheet .sh-b { overflow-y: auto; padding: 0 20px 20px; scrollbar-width: none; }
.sheet .sh-f { padding: 12px 20px 28px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex: none; }
.dialog { position: absolute; z-index: 82; left: 50%; top: 50%; width: calc(100% - 48px); transform: translate(-50%, -46%) scale(.94); opacity: 0; transition: all .32s var(--ease-out); background: var(--surface); border-radius: 28px; padding: 24px 20px 18px; text-align: center; }
.dialog.on { transform: translate(-50%, -50%); opacity: 1; }
.toast { position: absolute; z-index: 90; left: 50%; bottom: 112px; transform: translate(-50%, 20px); opacity: 0; transition: all .35s var(--ease-out); background: #0A2230; color: #fff; padding: 12px 16px; border-radius: 16px; font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 40px); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast .ic { color: var(--accent); }
:root[data-theme="dark"] .toast { background: #E7F1F4; color: #0A2230; }
:root[data-theme="dark"] .toast .ic { color: var(--primary-ink); }
.flyer { position: absolute; z-index: 95; width: 54px; height: 54px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; pointer-events: none; transition: transform .7s cubic-bezier(.5, -0.3, .7, .4), opacity .7s; }
.flyer svg { width: 44px; height: 44px; }

/* Misc visuals */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.progress { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 6px; background: var(--grad-brand); transition: width .6s var(--ease-out); }
.progress.lime i { background: linear-gradient(90deg, #B6E34A, #8DBA1F); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 30px; gap: 10px; }
.empty .art { width: 150px; height: 150px; border-radius: 50%; background: var(--primary-soft); display: grid; place-items: center; position: relative; }
.empty h3 { margin: 6px 0 0; font-size: 18px; }
.empty p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.kv { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 6px 0; }
.kv span:first-child { color: var(--text-2); }
.kv.total { font-size: 17px; font-weight: 700; padding-top: 12px; border-top: 1px dashed var(--border); margin-top: 6px; }
.kv .num { font-weight: 600; }

/* Bubbles (brand motif) */
.bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bubbles i { position: absolute; bottom: -60px; border-radius: 50%; background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08) 45%, rgba(255, 255, 255, .02) 70%); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .28); animation: rise linear infinite; }
@keyframes rise { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 12% { opacity: 1; } 50% { transform: translate(14px, -45vh) scale(1); } 100% { transform: translate(-8px, -95vh) scale(1.08); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* embedded previews freeze ambient motion once entrance animations finish (keeps the gallery light) */
body.still *, body.still *::before, body.still *::after { animation-play-state: paused !important; }
