[hidden] { display: none !important; }
/* ===== Тема. Чтобы поменять дизайн — начните с этих переменных ===== */
:root {
  --bg: #17181c;
  --surface: #222328;
  --surface-2: #2c2d33;
  --text: #f4f4f5;
  --muted: #9a9ba3;
  --accent: #3b82f6;
  --accent-text: #fff;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 18px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
body.locked { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ----- Шапка ----- */
.header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.header-row { display: flex; align-items: center; justify-content: center; position: relative; height: 60px; }
.brand { text-align: center; }
.brand h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface); }
.header .icon-btn { position: absolute; right: -6px; }
.search { display: none; padding-bottom: 10px; }
.search.open { display: block; }
.search input { width: 100%; }

/* ----- Чипсы категорий ----- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--surface); font-size: 15px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip.active { background: var(--text); color: var(--bg); }
.chip.icon { width: 40px; padding: 0; justify-content: center; }

/* ----- Сетка товаров ----- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 12px; padding-bottom: 24px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 24px 18px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card { display: flex; flex-direction: column; min-width: 0; }
.card-img { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: pointer; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card-img:hover img { transform: scale(1.03); }
.badge { position: absolute; left: 8px; top: 8px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.fav { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.75); }
.fav svg { width: 18px; height: 18px; fill: #c7c7cc; }
.fav.on svg { fill: #ef4444; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.price { font-size: 18px; font-weight: 700; }
.old { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.card-title { margin: 4px 0 10px; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.card .btn { margin-top: auto; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ----- Кнопки и поля ----- */
.btn { height: 44px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; width: 100%; transition: opacity .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.lg { height: 54px; font-size: 17px; border-radius: 14px; }
.btn.ghost { background: var(--surface-2); color: var(--text); }

.input { height: 50px; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--surface-2); color: var(--text); padding: 0 14px; font: inherit; font-size: 16px; outline: none; width: 100%; }
textarea.input { height: 80px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--accent); }
.input.err { border-color: var(--danger); }
.field { margin-bottom: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.4; margin: 12px 0 14px; }
.check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }
.form-error { color: var(--danger); font-size: 14px; min-height: 20px; margin-bottom: 8px; }

/* ----- Нижнее окно (bottom sheet) ----- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); padding: 0 16px calc(16px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.sheet.open { transform: none; }
@media (min-width: 720px) {
  .sheet { bottom: 50%; border-radius: 22px; transform: translateY(60%) scale(.98); opacity: 0; pointer-events: none; transition: transform .25s, opacity .2s; max-height: 88vh; }
  .sheet.open { transform: translateY(50%); opacity: 1; pointer-events: auto; }
}
.sheet-handle { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 0 8px; background: var(--surface); z-index: 2; }
.sheet-handle h3 { margin: 0; font-size: 18px; }

.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; border-radius: var(--radius); scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; scroll-snap-align: center; border-radius: var(--radius); background: var(--surface-2); }
.dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 4px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-2); }
.dots span.on { background: var(--text); }
.p-title { font-size: 20px; margin: 8px 0 6px; line-height: 1.25; }
.p-desc { color: #d4d4d8; font-size: 15px; line-height: 1.5; white-space: pre-line; }
.note { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 12px 0; }
.opt-label { font-size: 14px; color: var(--muted); margin: 14px 0 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-width: 48px; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--surface-2); font-weight: 600; }
.opt.on { background: var(--text); color: var(--bg); }
.sticky-buy { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 0; margin-top: 12px; }

.mini { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 10px; margin-bottom: 14px; }
.mini img { width: 56px; height: 70px; object-fit: cover; border-radius: 10px; }
.mini b { display: block; font-size: 15px; margin-bottom: 4px; }

/* ----- Нижняя навигация ----- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid rgba(255,255,255,.06); display: flex; justify-content: center; }
.tabbar .tab { flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: var(--muted); position: relative; }
.tabbar .tab svg { width: 26px; height: 26px; fill: currentColor; }
.tabbar .tab.active { color: var(--accent); }
.tab .count { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

/* ----- Подвал ----- */
.footer { color: var(--muted); font-size: 13px; line-height: 1.6; padding: 24px 0 32px; border-top: 1px solid rgba(255,255,255,.06); margin-top: 8px; }
.footer a { color: var(--muted); }
.footer .links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }

/* ----- Простые страницы (заказ, оферта) ----- */
.page { max-width: 640px; margin: 0 auto; padding: 32px 16px 48px; }
.page h1 { font-size: 26px; }
.page p, .page li { line-height: 1.6; color: #d4d4d8; }
.status-card { background: var(--surface); border-radius: var(--radius); padding: 28px 20px; text-align: center; }
.status-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; font-size: 36px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--surface-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { aspect-ratio: 3/4; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ----- Выбор пункта выдачи ----- */
.pickup { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 14px; }
.pickup.err { border-color: var(--danger); }
.pickup b { display: block; font-size: 15px; font-weight: 600; }
.pickup small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.3; }
.pickup.chosen b { color: var(--success); }
.pickup-icon { font-size: 22px; }
#pvzSheet { max-width: 900px; }
#delivery-widget { border-radius: 14px; overflow: hidden; background: #fff; min-height: 300px; }
.fee-note { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
