/* LoLo — вітрина. Колір бренду приходить з налаштувань (--brand). */
:root {
  --brand: #1F9D55;
  --brand-ink: #0E5A30;
  --brand-soft: #E7F5EC;
  --ink: #1C1F1D;
  --muted: #6A716B;
  --line: #E4E7E2;
  --bg: #F5F6F3;
  --card: #FFFFFF;
  --ok: #2F8A57;
  --warn: #D9731A;
  --no: #A7ADA8;
  --danger: #B42318;
  --radius: 16px;
  --f: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-brand: 'Unbounded', 'Onest', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

.test-ribbon { background: #FFF4CC; color: #6B4E00; font-size: 12.5px; font-weight: 600; text-align: center; padding: 6px 16px; line-height: 1.35; }

/* ---------- шапка ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(245, 246, 243, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); min-width: 0; flex: 0 1 auto; }
.brand img { height: 46px; width: auto; max-width: 180px; object-fit: contain; }
.brand-name { font-family: var(--f-brand); font-weight: 800; font-size: 30px; letter-spacing: -.01em; line-height: 1; white-space: nowrap; color: var(--ink); }
.brand-name i { font-style: normal; color: var(--brand); }
@media (min-width: 760px) { .brand-name { font-size: 34px; } .brand img { height: 52px; } }
.live { display: inline-flex; align-items: center; gap: 7px; background: var(--ink); color: #fff; border-radius: 99px; padding: 7px 12px; font-size: 12px; font-weight: 600; line-height: 1.2; max-width: 58%; }
.live::before { content: ''; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #FF4D4F; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- hero ---------- */
.hero { padding: 10px 0 14px; display: grid; gap: 6px; }
.hero h1 { margin: 0; font-size: clamp(21px, 4.6vw, 32px); line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; max-width: 24ch; }
.hero p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 52ch; }

/* ---------- роздріб / опт ---------- */
.mode { display: grid; gap: 8px; margin-bottom: 14px; max-width: 640px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 10px; padding: 10px; font-weight: 700; font-size: 15px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.mode-note { background: var(--brand-soft); color: var(--brand-ink); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; font-weight: 600; }

/* ---------- пошук ---------- */
.find { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 16px; padding: 5px 5px 5px 14px; max-width: 640px; }
.find svg { color: var(--muted); flex: 0 0 auto; width: 20px; height: 20px; }
.find input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; height: 44px; }
.find input::-webkit-search-cancel-button { cursor: pointer; }
.find button { border: 0; background: var(--ink); color: #fff; border-radius: 11px; padding: 0 16px; height: 44px; font-weight: 700; }
.findmsg { margin: 8px 2px 0; font-size: 13.5px; color: var(--danger); }

/* ---------- тематики ---------- */
.topics { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.topics::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- сітка товарів ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1020px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 35% { box-shadow: 0 0 0 3px var(--brand); transform: scale(1.02); } 100% { box-shadow: 0 0 0 0 transparent; transform: none; } }
.ph { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--brand-soft); border: 0; padding: 0; width: 100%; display: block; }
.ph img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.noimg { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-brand); font-weight: 800; font-size: 40px; color: var(--brand); opacity: .45; }
.code { position: absolute; z-index: 2; left: 6px; top: 6px; background: rgba(255, 255, 255, .94); border-radius: 7px; padding: 2px 7px; font-size: 12px; font-weight: 700; letter-spacing: .05em; font-variant-numeric: tabular-nums; color: var(--ink); }
.tag { position: absolute; z-index: 2; right: 6px; top: 6px; border-radius: 7px; padding: 2px 7px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--ink); }
.tag.t-hit { background: #E5484D; } .tag.t-new { background: #3E63DD; } .tag.t-sale { background: var(--ink); color: #FFD25E; }
.card h3 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.price b { font-size: 17px; }
.price s { color: var(--muted); font-size: 12.5px; }
.stock { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stock::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.stock.ok { color: var(--ok); } .stock.low { color: var(--warn); } .stock.no { color: var(--no); }
.add { margin-top: auto; border: 0; border-radius: 11px; height: 42px; background: var(--brand); color: #fff; font-weight: 700; }
.add:disabled { background: #ECEEEB; color: #9DA39E; cursor: not-allowed; }
.stepper { margin-top: auto; display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; height: 42px; border-radius: 11px; background: var(--ink); color: #fff; }
.stepper button { height: 42px; border: 0; background: transparent; font-size: 20px; font-weight: 700; color: #fff; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper span { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 10px; }
.skel { background: linear-gradient(90deg, #ECEFEB 25%, #F6F7F4 50%, #ECEFEB 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); aspect-ratio: 3 / 4.4; }
@keyframes sk { to { background-position: -200% 0; } }
.more-wrap { display: flex; justify-content: center; padding: 18px 0 4px; }

/* ---------- умови ---------- */
.info { margin-top: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 14px; }
@media (min-width: 820px) { .info { grid-template-columns: 1fr 1fr; padding: 20px; gap: 18px 28px; } }
.info .row { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.info .row b { display: block; font-size: 14.5px; margin-bottom: 1px; }
.info .row span { color: var(--muted); }
.info .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; flex: 0 0 auto; }
.info .ic svg { width: 20px; height: 20px; }

/* ---------- контакти ---------- */
.contact { margin-top: 22px; }
.contact h2 { margin: 0 0 10px; font-size: 17px; }
.contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; max-width: 640px; }
.contacts a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; padding: 0 6px; border-radius: 14px; text-decoration: none; font-weight: 700; font-size: 14px; color: #fff; min-width: 0; white-space: nowrap; }
.contacts a svg { width: 17px; height: 17px; flex: 0 0 auto; }
@media (max-width: 360px) { .contacts a svg { display: none; } }
.c-vb { background: #7360F2; } .c-tg { background: #229ED9; } .c-ph { background: var(--ink); }

/* ---------- кнопки ---------- */
.btn { border: 0; border-radius: 14px; min-height: 52px; padding: 0 20px; font-weight: 700; font-size: 16px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; text-decoration: none; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); width: auto; }
.btn.dark { background: var(--ink); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; flex: 0 0 auto; }
.link { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- футер ---------- */
.foot { margin-top: 34px; padding: 18px 0 calc(110px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; color: var(--muted); font-size: 13px; text-align: center; }
.foot-in a { color: var(--muted); }

/* ---------- нижні панелі ---------- */
.cart-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 24; width: min(520px, calc(100% - 24px)); border: 0; border-radius: 16px; background: var(--ink); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .25); font-weight: 600; font-size: 15px; }
.cart-bar .cnt { background: var(--brand); color: #fff; border-radius: 9px; min-width: 28px; height: 28px; padding: 0 6px; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.cart-bar .sum { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-bar.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: translateX(-50%) scale(1.04); } }
.pending-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 25; width: min(520px, calc(100% - 24px)); background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 12px 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); }
.pending-bar .pb-txt { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
.pending-bar b { font-variant-numeric: tabular-nums; }
.pending-bar .btn { width: auto; min-height: 42px; padding: 0 16px; font-size: 14px; }

/* ---------- шторка (кошик / оформлення / товар) ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(15, 17, 16, .45); }
.sheet { position: fixed; z-index: 41; background: var(--bg); display: flex; flex-direction: column; inset: auto 0 0 0; max-height: 92vh; max-height: 92dvh; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: up .25s ease-out; }
@media (min-width: 760px) { .sheet { inset: 0 0 0 auto; width: 460px; max-height: none; border-radius: 0; animation: side .25s ease-out; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes side { from { transform: translateX(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 18px; flex: 1; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 16px; display: grid; gap: 12px; align-content: start; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.line .mini { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--brand-soft); display: grid; place-items: center; font-weight: 800; color: var(--brand); }
.line .mini img { width: 100%; height: 100%; object-fit: cover; }
.line .nm { min-width: 0; font-size: 14px; line-height: 1.3; }
.line .nm small { display: block; color: var(--muted); font-variant-numeric: tabular-nums; }
.line .nm .warn { color: var(--warn); font-weight: 600; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; }
.qty button:disabled { opacity: .35; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; font-weight: 700; padding: 4px 2px; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 13px; }
.alert { background: #FFF4ED; color: #9A3412; border: 1px solid #FED7AA; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.alert.err { background: #FEF3F2; color: var(--danger); border-color: #FECDCA; }
.mode-pill { display: inline-block; background: var(--ink); color: #fff; border-radius: 7px; padding: 2px 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }

.fld { display: grid; gap: 6px; position: relative; }
.fld label { font-size: 13px; font-weight: 600; color: var(--muted); }
.fld input, .fld textarea { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 13px 14px; font-size: 16px; }
.fld textarea { resize: vertical; min-height: 64px; }
.fld input:focus, .fld textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.fld input:disabled { background: #F0F2EF; }
.fld.bad input { border-color: var(--danger); }
.fld .err-msg { color: var(--danger); font-size: 13px; }
.np-head { display: flex; align-items: center; gap: 10px; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.np-logo { background: #DA291C; color: #fff; font-weight: 800; font-size: 11px; border-radius: 6px; padding: 4px 6px; }
.suggest { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 24px rgba(0, 0, 0, .12); max-height: 260px; overflow-y: auto; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button:focus { background: var(--brand-soft); }
.suggest small { color: var(--muted); display: block; font-size: 12.5px; }
.suggest .none { padding: 11px 14px; color: var(--muted); font-size: 14px; }

/* ---------- екрани оплати / статусу ---------- */
.screen { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; padding: calc(20px + env(safe-area-inset-top)) 0 calc(24px + env(safe-area-inset-bottom)); }
.screen .wrap { max-width: 480px; display: grid; gap: 16px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 14px; }
.panel h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.timer { font-size: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--brand-ink); }
.timer-cap { color: var(--muted); font-size: 14px; margin-top: -10px; }
.paytypes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.paytypes span { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12.5px; font-weight: 600; background: var(--bg); }
.big-ico { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; }
.big-ico svg { width: 36px; height: 36px; stroke-width: 2.4; }
.big-ico.ok { background: #DCFCE7; color: var(--ok); }
.big-ico.no { background: #FEE4E2; color: var(--danger); }
.big-ico.wait { background: var(--brand-soft); color: var(--brand-ink); }
.center { text-align: center; }
.items-mini { display: grid; gap: 6px; font-size: 14px; }
.items-mini div { display: flex; justify-content: space-between; gap: 10px; }
.items-mini span:first-child { min-width: 0; }
.test-badge { background: #FEF0C7; color: #93370D; border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 600; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: rot .8s linear infinite; margin: 0 auto; }
@keyframes rot { to { transform: rotate(360deg); } }

.pd-photo { border-radius: 16px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--brand-soft); position: relative; }
.pd-photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.pd-photo .noimg { font-size: 80px; }
.pd-desc { color: var(--muted); white-space: pre-line; margin: 0; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 80; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; }

/* ---------- сторінка політики ---------- */
.doc { max-width: 760px; padding-top: 8px; padding-bottom: 60px; }
.doc h1 { font-size: clamp(24px, 5vw, 32px); line-height: 1.2; margin: 8px 0 6px; letter-spacing: -.015em; }
.doc h2 { font-size: 18px; margin: 26px 0 8px; }
.doc p, .doc li { color: #3C433E; }
.doc ul { padding-left: 20px; }
.doc .meta { color: var(--muted); font-size: 13.5px; }
.doc .card-box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }

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

/* кнопка «У кошик» у картці товару в шторці — на всю ширину */
.sheet .buy .add, .sheet .buy .stepper { width: 100%; height: 50px; font-size: 16px; }
.sheet .buy .stepper button { height: 50px; }
.lot-info { display: block; font-size: 12.5px; color: var(--muted, #6b6b6b); margin: 2px 0; }
.price b small { font-size: 12px; font-weight: 600; opacity: .7; }
