/* Общие стили: тёмный премиум + янтарный акцент */
:root {
  --bg: #0c0c0f;
  --bg-soft: #131318;
  --card: #17171d;
  --card-2: #1d1d24;
  --line: #26262e;
  --text: #f2f0ea;
  --muted: #9a97a3;
  --accent: #f5b93c;
  --accent-ink: #1a1206;
  --ok: #4ade80;
  --danger: #f87171;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
/* Тёмный скроллбар под премиум-тему */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2c2c35; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3d3d49; }
* { scrollbar-width: thin; scrollbar-color: #2c2c35 var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; width: 100%;
  outline: none; transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { font-size: 13px; color: var(--muted); display: block; margin: 14px 0 6px; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(12,12,15,.78);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; gap: 22px; height: 66px; }
.logo { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.topbar nav { display: flex; gap: 18px; margin-left: 8px; }
.topbar nav a { color: var(--muted); font-size: 14px; transition: color .2s; }
.topbar nav a:hover { color: var(--text); }
.cart-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 14px;
  transition: transform .15s ease, box-shadow .2s;
}
.cart-pill:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(245,185,60,.35); }
.cart-pill .count {
  background: var(--accent-ink); color: var(--accent);
  border-radius: 999px; min-width: 22px; height: 22px;
  display: grid; place-items: center; font-size: 12px; padding: 0 6px;
  transition: transform .25s;
}
.cart-pill .count.bump { transform: scale(1.35); }

/* ---------- Герой ---------- */
.hero { position: relative; overflow: hidden; padding: 44px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 640px;
  background:
    radial-gradient(560px 300px at 78% 18%, rgba(245,185,60,.16), transparent 65%),
    radial-gradient(420px 260px at 12% 30%, rgba(120,90,255,.10), transparent 65%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero .hero-visual {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  display: grid; grid-template-columns: repeat(2, 116px); gap: 12px;
  pointer-events: none;
}
.hero .hero-visual .hv {
  height: 116px; border-radius: 20px; display: grid; place-items: center; font-size: 50px;
  border: 1px solid var(--line);
  animation: float 5.5s ease-in-out infinite;
}
.hero .hero-visual .hv:nth-child(1) { background: linear-gradient(160deg, hsl(28 45% 16%), hsl(28 55% 9%)); animation-delay: 0s; }
.hero .hero-visual .hv:nth-child(2) { background: linear-gradient(160deg, hsl(25 45% 16%), hsl(25 55% 9%)); animation-delay: -1.4s; }
.hero .hero-visual .hv:nth-child(3) { background: linear-gradient(160deg, hsl(42 45% 16%), hsl(42 55% 9%)); animation-delay: -2.8s; }
.hero .hero-visual .hv:nth-child(4) { background: linear-gradient(160deg, hsl(340 45% 16%), hsl(340 55% 9%)); animation-delay: -4.2s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 980px) { .hero .hero-visual { display: none; } }
.hero h1 {
  font-size: clamp(38px, 5.6vw, 68px);
  line-height: .98; letter-spacing: -.045em; font-weight: 850;
  max-width: 12ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { color: var(--muted); font-size: clamp(15px, 1.7vw, 17px); max-width: 44ch; margin-top: 14px; line-height: 1.5; }
.hero .cta-row { display: flex; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border-radius: 999px; padding: 15px 28px; font-weight: 700; font-size: 15px;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(245,185,60,.35); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.hero .badges { display: flex; gap: 26px; margin-top: 22px; color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.hero .badges b { color: var(--text); font-weight: 700; }

/* ---------- Секции ---------- */
.section { padding: 54px 0; }
.section h2 { font-size: clamp(26px, 3.6vw, 42px); letter-spacing: -.03em; font-weight: 800; }
.section .sub { color: var(--muted); margin-top: 8px; font-size: 15px; }

/* ---------- Каталог ---------- */
.cats { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 30px; }
.cat-chip {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  transition: all .2s;
}
.cat-chip:hover { color: var(--text); border-color: var(--accent); }
.cat-chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); border-color: #34343e; box-shadow: var(--shadow); }
.card .art {
  height: 168px; display: grid; place-items: center; font-size: 74px;
  position: relative; overflow: hidden;
}
.card .art::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(220px 120px at 50% 100%, rgba(255,255,255,.10), transparent 70%);
}
.card .art .emo { filter: drop-shadow(0 12px 18px rgba(0,0,0,.35)); transition: transform .25s; }
.card:hover .art .emo { transform: scale(1.12) rotate(-4deg); }
.card .badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 999px; padding: 5px 11px;
}
.card .body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.card .desc { color: var(--muted); font-size: 13px; line-height: 1.45; flex: 1; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.price { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.stock-note { font-size: 12px; color: var(--muted); }
.stock-note.low { color: var(--accent); }
.add-btn {
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 10px 16px; font-weight: 700; font-size: 14px;
  transition: all .18s; white-space: nowrap;
}
.add-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.add-btn:disabled { opacity: .35; cursor: not-allowed; }
.add-btn:disabled:hover { background: var(--card-2); color: var(--text); border-color: var(--line); }

/* ---------- Корзина (drawer) ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 90;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--bg-soft); border-left: 1px solid var(--line); z-index: 100;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.32,.72,.35,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer header { padding: 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer header h2 { font-size: 20px; font-weight: 800; }
.drawer .close-x { background: var(--card); border: 1px solid var(--line); color: var(--muted); width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
.drawer .close-x:hover { color: var(--text); border-color: var(--accent); }
.drawer .items { flex: 1; overflow-y: auto; padding: 16px 22px; }
.cart-row { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-row .thumb { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; flex-shrink: 0; }
.cart-row .info { flex: 1; min-width: 0; }
.cart-row .info b { font-size: 14.5px; display: block; }
.cart-row .info span { font-size: 13px; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 700; }
.qty button:hover { border-color: var(--accent); }
.qty b { min-width: 20px; text-align: center; }
.drawer footer { padding: 20px 22px; border-top: 1px solid var(--line); }
.total-line { display: flex; justify-content: space-between; font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.wide { width: 100%; justify-content: center; }
.empty-note { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 14.5px; }

/* ---------- Форма оформления ---------- */
.checkout-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.radio-cards label {
  margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 13px;
  cursor: pointer; color: var(--text); font-size: 14px; display: flex; gap: 9px; align-items: center;
  transition: border-color .2s;
}
.radio-cards input { width: auto; accent-color: var(--accent); }
.radio-cards label:has(input:checked) { border-color: var(--accent); background: rgba(245,185,60,.07); }

/* ---------- Экран успеха ---------- */
.success-wrap { max-width: 560px; margin: 0 auto; padding: 90px 22px; text-align: center; }
.success-ico {
  width: 84px; height: 84px; margin: 0 auto 26px; border-radius: 50%;
  background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.35);
  display: grid; place-items: center; font-size: 38px;
}
.success-wrap h1 { font-size: 34px; letter-spacing: -.02em; margin-bottom: 12px; }
.success-wrap p { color: var(--muted); line-height: 1.6; }
.order-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 26px 0; text-align: left; }
.order-card .line { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14.5px; }
.order-card .line span { color: var(--muted); }
.order-card .line.total { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 14px; font-weight: 800; font-size: 17px; }

/* ---------- Админка ---------- */
.admin-body { background: #0a0a0d; }
.admin-top { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.admin-top h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; font-weight: 850; }
.live-dot { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ok); font-weight: 600; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74,222,128,.5);} 50% { opacity: .6; box-shadow: 0 0 0 6px rgba(74,222,128,0);} }
.live-dot.off { color: var(--danger); }
.live-dot.off::before { background: var(--danger); animation: none; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 26px 0; }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 14px; } .kpi .value { font-size: 22px; } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-size: 30px; font-weight: 850; letter-spacing: -.02em; margin-top: 6px; transition: color .3s; }
.kpi .value.flash { color: var(--accent); }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.admin-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--accent), #b57f14); min-height: 3px; transition: height .6s cubic-bezier(.32,.72,.35,1); position: relative; }
.bar:hover { filter: brightness(1.15); }
.bar .tip { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; opacity: 0; transition: opacity .2s; }
.bar:hover .tip { opacity: 1; }
.bar-col .day { font-size: 11.5px; color: var(--muted); }

.feed { max-height: 430px; overflow-y: auto; }
.order-row { border-bottom: 1px solid var(--line); padding: 13px 0; animation: slideIn .45s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px);} to { opacity: 1; transform: none;} }
.order-row .or-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-row .oid { font-weight: 800; font-size: 14px; }
.order-row .osum { margin-left: auto; font-weight: 800; color: var(--accent); }
.order-row .ometa { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.order-row .oitems { font-size: 13px; color: var(--text); margin-top: 7px; line-height: 1.5; }
.status { font-size: 11.5px; font-weight: 800; letter-spacing: .03em; border-radius: 999px; padding: 4px 10px; text-transform: uppercase; }
.status.NEW { background: rgba(96,165,250,.15); color: #60a5fa; }
.status.PAID { background: rgba(245,185,60,.15); color: var(--accent); }
.status.COOKING { background: rgba(251,146,60,.15); color: #fb923c; }
.status.DELIVERING { background: rgba(167,139,250,.15); color: #a78bfa; }
.status.COMPLETED { background: rgba(74,222,128,.15); color: var(--ok); }
.status.CANCELLED { background: rgba(248,113,113,.15); color: var(--danger); }
.status-sel { margin-top: 8px; width: auto; padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }

.top-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; list-style: none; }
.top-list li:last-child { border: 0; }
.top-list .n { color: var(--muted); width: 18px; font-size: 12.5px; }
.top-list .q { margin-left: auto; color: var(--muted); font-size: 13px; }
.top-list .r { font-weight: 700; min-width: 80px; text-align: right; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.admin-table input, .admin-table select { padding: 7px 9px; font-size: 13px; border-radius: 8px; }
.admin-table input[type=number] { width: 86px; }
.mini-btn { background: var(--card-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; transition: all .18s; }
.mini-btn:hover { border-color: var(--accent); }
.mini-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.mini-btn.save { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.switch { position: relative; width: 38px; height: 22px; appearance: none; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; transition: background .2s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: all .2s; }
.switch:checked { background: rgba(245,185,60,.25); border-color: var(--accent); }
.switch:checked::after { left: 18px; background: var(--accent); }

.demo-ribbon {
  background: linear-gradient(90deg, rgba(245,185,60,.14), rgba(245,185,60,.05));
  border: 1px solid rgba(245,185,60,.35); color: var(--accent);
  border-radius: 12px; padding: 10px 16px; font-size: 13px; font-weight: 600;
  display: inline-flex; gap: 8px; align-items: center;
}

.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--card-2); border: 1px solid var(--accent); color: var(--text);
  border-radius: 12px; padding: 13px 20px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .3s; z-index: 200; box-shadow: var(--shadow);
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* Когда открыта корзина — тост уходит выше футера drawer */
body:has(.drawer.open) .toast { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
.drawer footer { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }

footer.site-foot { border-top: 1px solid var(--line); margin-top: 60px; padding: 34px 0 44px; color: var(--muted); font-size: 13.5px; }
footer.site-foot .container { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }

@media (max-width: 980px) {
  .topbar nav { display: none; }
  .hero { padding: 40px 0 36px; }
  .checkout-form .row2 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card .art { height: 120px; font-size: 54px; }
  .drawer { width: 100vw; }
  .hero h1 { font-size: clamp(38px, 10.5vw, 52px); }
}
