/* =========================================================
   М-Бар Mini App — красно-чёрная тема
   ========================================================= */
:root {
  --red: #E10600;
  --red-2: #ff2a1f;
  --red-dark: #8e0400;
  --bg: #0a0a0a;
  --bg-2: #141414;
  --bg-3: #1c1c1c;
  --card: rgba(24,24,24,.92);
  --border: #2a2a2a;
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --ok: #2ecc71;
  --warn: #f39c12;
  --danger: #ff3b30;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px rgba(225,6,0,.12);
  --nav-h: 68px;
  --top-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  overscroll-behavior-y: contain;
}

body {
  background:
    linear-gradient(180deg, rgba(10,10,10,.82), rgba(10,10,10,.72) 40%, rgba(10,10,10,.85)),
    url('/static/img/Fon.png') center top / cover no-repeat fixed;
  background-color: var(--bg);
  padding: var(--top-h) 0 calc(var(--nav-h) + env(safe-area-inset-bottom)) 0;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--top-h);
  background: linear-gradient(180deg, rgba(0,0,0,.95), rgba(0,0,0,.75));
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  z-index: 50;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; filter: drop-shadow(0 0 6px rgba(225,6,0,.6)); }
.brand-title {
  font-weight: 900;
  letter-spacing: 2px;
  font-size: 18px;
  background: linear-gradient(180deg, #ff6a3d, var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 12px rgba(225,6,0,.35);
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 18px;
}
.icon-btn:active { transform: scale(.96); }

/* ---------- views ---------- */
.view { display: none; padding: 14px 14px 18px; }
.view.active { display: block; }
.view-title { margin: 4px 0 12px; font-size: 22px; letter-spacing: .5px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(225,6,0,.88), rgba(142,4,0,.80));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(400px 200px at 100% 0%, rgba(255,255,255,.15), transparent 60%);
  pointer-events: none;
}
.hero h1 { margin: 4px 0 6px; font-size: 22px; font-weight: 900; letter-spacing: .5px; }
.hero p  { margin: 0; color: rgba(255,255,255,.9); font-size: 14px; }
.hero-crown { font-size: 22px; opacity: .9; }
.badge-row { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  background: rgba(0,0,0,.45);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.15);
}
.badge-danger { background: #000; border-color: var(--red); color: var(--red-2); }

/* ---------- search ---------- */
.search-wrap { margin: 8px 0 10px; }
.search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.search:focus { border-color: var(--red); }

/* ---------- category tabs ---------- */
.cat-tabs {
  display: flex; gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 2px 8px;
  margin: 0 -14px;
  padding-left: 14px; padding-right: 14px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
}
.cat-tab.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 16px rgba(225,6,0,.35);
}

/* ---------- catalog grid ---------- */
.catalog { margin-top: 12px; }
.cat-section { margin-bottom: 20px; }
.cat-section h2 {
  margin: 6px 0 10px;
  font-size: 18px; font-weight: 800; letter-spacing: .5px;
  display: flex; align-items: center; gap: 8px;
}
.cat-section h2 .dot { width: 8px; height: 8px; background: var(--red); border-radius: 2px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card-p {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s, border-color .15s;
}
.card-p:active { transform: scale(.98); }
.card-p .ph {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #222 center/cover no-repeat;
}
.card-p .tag {
  position: absolute; top: 8px; left: 8px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.card-p .body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-p .title { font-weight: 700; font-size: 14px; line-height: 1.25; }
.card-p .desc  { font-size: 12px; color: var(--muted); min-height: 28px; }
.card-p .meta  { display: flex; align-items: baseline; gap: 8px; }
.card-p .price { color: var(--red-2); font-weight: 900; font-size: 16px; }
.card-p .old   { color: var(--muted); text-decoration: line-through; font-size: 12px; }
.card-p .vol   { margin-left: auto; color: var(--muted); font-size: 12px; }

.card-p .buy   {
  margin-top: 6px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  letter-spacing: .5px;
  border-radius: 10px;
  font-size: 13.5px;
}
.card-p .buy:active { background: var(--red-dark); }

.card-p .qty-inline {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 0;
  margin-top: 6px;
}
.card-p .qty-inline button {
  background: var(--bg-3); color: #fff; border: 1px solid var(--border);
  font-weight: 900; font-size: 16px;
}
.card-p .qty-inline .q { text-align: center; line-height: 36px; background: var(--card); border: 1px solid var(--border); border-left: 0; border-right: 0; font-weight: 800; }
.card-p .qty-inline button:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.card-p .qty-inline button:last-child  { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }

/* ---------- cart ---------- */
.cart-list { display: flex; flex-direction: column; gap: 10px; }
.cart-item {
  display: grid; grid-template-columns: 64px 1fr auto;
  gap: 10px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cart-item .pic {
  width: 64px; height: 64px; border-radius: 10px;
  background: #222 center/cover no-repeat;
}
.cart-item .nm  { font-weight: 700; font-size: 14px; }
.cart-item .pr  { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cart-item .qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.cart-item .qty button {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bg-3); color: #fff; border: 1px solid var(--border);
  font-weight: 900;
}
.cart-item .qty .q { min-width: 24px; text-align: center; font-weight: 800; }
.cart-item .sub { align-self: center; color: var(--red-2); font-weight: 800; font-size: 15px; white-space: nowrap; }
.cart-item .del {
  background: transparent; border: 0; color: var(--muted); font-size: 18px; margin-left: 4px;
}

.cart-footer {
  position: sticky;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  margin-top: 14px;
  background: linear-gradient(180deg, rgba(10,10,10,0), rgba(10,10,10,.95) 30%);
  padding-top: 10px;
}
.cart-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
}
.cart-total b { color: var(--red-2); font-size: 18px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-emoji { font-size: 40px; margin-bottom: 8px; }
.empty p { margin: 0 0 14px; }

/* ---------- forms / checkout ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 14px; }
.field small { display: block; color: var(--muted); margin-top: 6px; font-size: 12px; }
.field .req { color: var(--red-2); }
.field .muted { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 15px;
  outline: none;
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--red); }

.segmented {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.seg-btn {
  padding: 11px 10px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}
.seg-btn.active {
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 16px rgba(225,6,0,.35);
}

.summary {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px 2px;
  margin-bottom: 14px;
}
.summary .line {
  display: flex; justify-content: space-between; padding: 6px 0;
  font-size: 13.5px; border-bottom: 1px dashed var(--border);
}
.summary .line:last-of-type { border-bottom: 0; }

/* ---------- buttons ---------- */
.btn {
  border: 0;
  padding: 13px 18px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: .5px;
  font-size: 15px;
  transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: 0 10px 24px rgba(225,6,0,.35);
}
.btn-primary:disabled { opacity: .6; }
.btn-outline { background: transparent; color: var(--red-2); border: 1px solid var(--red); }
.btn-ghost   { background: var(--bg-2); color: var(--text); border: 1px solid var(--border); }
.btn-block   { width: 100%; }

/* ---------- product detail ---------- */
.product-detail .ph { aspect-ratio: 16/10; border-radius: var(--radius-lg); background: #222 center/cover no-repeat; }
.product-detail h2 { margin: 12px 0 4px; font-size: 22px; }
.product-detail .desc { color: var(--muted); margin-bottom: 14px; }
.product-detail .priceRow { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.product-detail .priceRow .price { color: var(--red-2); font-size: 26px; font-weight: 900; }
.product-detail .priceRow .old   { color: var(--muted); text-decoration: line-through; }

/* ---------- success ---------- */
.success { text-align: center; padding: 30px 10px; }
.success-ring {
  width: 92px; height: 92px; margin: 0 auto 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--red-2), var(--red-dark));
  display: grid; place-items: center;
  font-size: 46px; color: #fff; font-weight: 900;
  box-shadow: 0 0 0 8px rgba(225,6,0,.15), 0 10px 30px rgba(225,6,0,.35);
}
.success h2 { margin: 6px 0 8px; }
.success b  { color: var(--red-2); font-size: 22px; }
.small { font-size: 12px; color: var(--muted); }

/* ---------- profile ---------- */
.profile-card {
  display: grid; grid-template-columns: 58px 1fr; gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
}
.avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  display: grid; place-items: center;
  font-size: 24px; font-weight: 900; color: #fff;
  box-shadow: 0 8px 16px rgba(225,6,0,.35);
}
.profile-name { font-size: 18px; font-weight: 800; }
.profile-handle { color: var(--muted); font-size: 13px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.card-title { margin: 2px 0 8px; font-size: 15px; letter-spacing: .3px; }
.info-row { padding: 6px 0; color: #e7e7e7; font-size: 14px; border-bottom: 1px dashed var(--border); }
.info-row:last-of-type { border-bottom: 0; }

.history { display: flex; flex-direction: column; gap: 8px; }
.history .row {
  display: grid; grid-template-columns: 1fr auto;
  padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 13.5px;
}
.history .row .code { font-weight: 800; }
.history .row .st  { color: var(--red-2); font-weight: 700; }
.history .row .sum { color: var(--muted); font-size: 12px; }
.history .row .order-preorder-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffcf70;
  background: rgba(255,159,10,.12);
  border: 1px solid rgba(255,159,10,.35);
  border-radius: 999px;
}

/* ---------- bottom nav ---------- */
.bottomnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10,10,10,.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(3, 1fr);
  z-index: 40;
}
.nav-btn {
  background: transparent; border: 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; font-weight: 700; position: relative;
}
.nav-btn .nav-ico { font-size: 20px; }
.nav-btn.active { color: var(--red-2); }
.nav-btn.active::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%;
  height: 3px; border-radius: 0 0 3px 3px; background: var(--red);
  box-shadow: 0 0 10px var(--red);
}
.cart-badge {
  position: absolute; top: 8px; right: calc(50% - 28px);
  background: var(--red); color: #fff; font-size: 10px; font-weight: 900;
  padding: 2px 6px; border-radius: 999px; min-width: 18px; text-align: center;
  border: 2px solid #0a0a0a;
}

.border-opt.selected {
  background: var(--red) !important; color: #fff !important;
  border-color: var(--red) !important;
}

/* ---------- contact popup ---------- */
.contact-popup { max-width: 320px; }
.contact-popup h3 { text-align: center; margin-bottom: 16px; }
.contact-info { display: flex; flex-direction: column; gap: 8px; }
.contact-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,.06); text-decoration: none; color: #eee;
  transition: background .15s;
}
.contact-row:active { background: rgba(225,6,0,.2); }
.contact-row span:first-child { font-size: 24px; }
.contact-row small { color: var(--muted); font-size: 12px; }
.contact-row b { color: var(--red-2); }

/* ---------- schedule (profile) ---------- */
.schedule-card { overflow: hidden; }
.schedule { margin-bottom: 16px; }
.sch-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06);
}
.sch-row:last-child { border-bottom: none; }
.sch-day { font-weight: 600; color: #eee; }
.sch-time { font-weight: 700; color: var(--red-2); }
.sch-row.off .sch-day { color: var(--muted); }
.sch-row.off .sch-time { color: var(--muted); font-weight: 400; font-style: italic; }
.sch-events {
  margin: 12px 0; padding: 10px 14px;
  background: rgba(255,255,255,.04); border-radius: 10px;
}
.sch-event { padding: 4px 0; font-size: 13px; color: #ccc; }
.sch-event b { color: #fff; }
.sch-delivery {
  background: linear-gradient(135deg, rgba(225,6,0,.15), rgba(225,6,0,.05));
  border: 1px solid rgba(225,6,0,.3); border-radius: 10px;
  padding: 10px 14px; margin: 12px 0; font-size: 13px; color: #ccc;
}
.sch-delivery b { color: #fff; }
.sch-phone {
  text-align: center; font-size: 15px; font-weight: 700;
  color: var(--red-2); padding: 8px 0;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  background: #1f1f1f;
  border: 1px solid var(--red);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 10px 24px rgba(0,0,0,.5);
  z-index: 100;
  animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- consent overlay ---------- */
.consent-overlay[hidden] { display: none !important; }
.consent-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom);
}
.consent-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 18px 24px;
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slide-up .3s ease-out;
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.consent-icon { font-size: 32px; text-align: center; margin-bottom: 8px; }
.consent-box h3 { margin: 0 0 10px; font-size: 18px; text-align: center; }
.consent-text { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 16px; }
.consent-text p { margin: 6px 0; }
.consent-text ul { margin: 6px 0; padding-left: 18px; }
.consent-text li { margin: 3px 0; }
.consent-text b { color: var(--text); }
.consent-text .link { color: var(--red-2); text-decoration: underline; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; cursor: pointer; color: var(--text); }
.consent-check input[type="checkbox"] { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--red-2); }
.consent-links { font-size: 12px; color: var(--muted); }
.consent-blocked-box { text-align: center; }
.consent-overlay .btn-ghost { margin-top: 8px; }

/* ---------- legal modal ---------- */
.legal-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(6px);
  z-index: 210;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.legal-modal[hidden] { display: none; }
.legal-modal-content {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  display: flex; flex-direction: column;
}
.legal-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.legal-modal-header h3 { margin: 0; font-size: 16px; }
.legal-modal-body {
  padding: 16px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: #ddd;
}
.legal-modal-body h4 { margin: 0 0 10px; font-size: 16px; color: var(--text); }
.legal-modal-body h5 { margin: 14px 0 6px; font-size: 14px; color: var(--red-2); }
.legal-modal-body ul { padding-left: 18px; margin: 6px 0; }
.legal-modal-body li { margin: 3px 0; }
.legal-modal-body p { margin: 6px 0; }

/* ---------- hero carousel (welcome + banners) ---------- */
.hero-track {
  position: relative;
  width: 100%;
  min-height: 100%;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  padding: inherit;
}
.hero-slide.active { opacity: 1; pointer-events: auto; z-index: 2; }
.hero-slide:first-child { position: relative; }       /* default slide reserves height */
.hero-slide.banner-slide {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-slide.banner-slide::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(10,10,10,.85), rgba(10,10,10,.55) 60%, rgba(178,34,52,.55));
  z-index: 0;
}
.hero-slide.banner-slide .hero-text { position: relative; z-index: 1; }
.hero-dots {
  display: flex; justify-content: center; gap: 6px;
  padding: 8px 0 0;
}
.hero-dots .ind {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.hero-dots .ind.active {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  transform: scale(1.2);
}

/* ---------- border popup (pizza) ---------- */
.border-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in .15s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.border-popup {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 360px;
  width: 100%;
}
.border-popup h3 {
  margin: 0 0 14px;
  font-size: 16px;
  text-align: center;
}
.border-options {
  display: flex; flex-direction: column;
  gap: 8px;
}
.border-opt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.border-opt:hover, .border-opt:active {
  border-color: var(--red);
  background: rgba(178,34,52,.1);
}
.border-price {
  color: var(--red-2);
  font-size: 13px;
  font-weight: 700;
}
.cart-border {
  font-size: 11px;
  color: var(--red-2);
  font-weight: 600;
}

/* ---------- extras (sauces) ---------- */
.extras-block {
  margin-top: 18px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.extras-block h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.extras-list {
  display: flex; flex-direction: column;
  gap: 8px;
}
.extra-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.extra-pic {
  width: 44px; height: 44px;
  border-radius: 8px;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
}
.extra-body { min-width: 0; }
.extra-title {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.extra-meta { font-size: 12px; color: var(--muted); }
.extra-add {
  background: transparent;
  color: var(--red-2);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.extra-add:hover { background: rgba(178,34,52,.1); }
.extra-qty {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 2px 4px;
}
.extra-qty button {
  width: 24px; height: 24px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.extra-qty span {
  min-width: 18px;
  text-align: center;
  font-size: 13px; font-weight: 700;
}

/* ---------- pickup notice ---------- */
.pickup-notice {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}
.pickup-icon { font-size: 24px; }

/* ---------- legal links ---------- */
.legal-link { margin-bottom: 8px; text-align: left; font-size: 14px; }
.legal-link:last-child { margin-bottom: 0; }

/* ---------- closed overlay (ручное закрытие) ---------- */
.closed-overlay[hidden] { display: none !important; }
.closed-overlay {
  position: fixed; inset: 0;
  z-index: 550;                 /* поверх всего — обойти нельзя */
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(10,10,10,.85), rgba(10,10,10,.8) 45%, rgba(10,10,10,.92)),
    url('/static/img/Fon.png') center center / cover no-repeat;
  animation: fade-in .2s ease-out;
  overflow: hidden;
}
.closed-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
  max-width: 420px; width: 100%;
}
.closed-logo {
  width: 92px; height: 92px;
  border-radius: 24px;
  object-fit: cover;
  border: 2px solid var(--red);
  box-shadow: 0 12px 36px rgba(225,6,0,.45);
}
.closed-brand {
  font-size: 34px; font-weight: 900; letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 4px 22px rgba(225,6,0,.6);
}
.closed-status {
  font-size: 17px; font-weight: 700;
  color: var(--red-2);
  text-transform: uppercase; letter-spacing: 2px;
}
.closed-reason {
  max-width: 340px;
  margin-top: 4px;
  padding: 10px 16px;
  background: rgba(20,20,20,.6);
  border: 1px solid var(--red);
  border-radius: 12px;
  font-size: 14px; color: var(--text);
  line-height: 1.4;
}
.closed-hint {
  font-size: 14px; color: var(--muted);
  margin-top: 4px;
}
.closed-enter {
  margin-top: 14px;
  padding: 12px 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--red-2), var(--red-dark));
  color: #fff;
  font-size: 16px; font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(225,6,0,.4);
  transition: transform .1s;
}
.closed-enter:active { transform: scale(.97); }
@media (max-width: 360px) {
  .closed-brand { font-size: 28px; }
}

/* ---------- предзаказ: триггер в форме заказа ---------- */
.preorder-trigger {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(28,28,28,.95), rgba(18,18,18,.95));
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.preorder-trigger:hover { border-color: var(--red); }
.preorder-trigger:active { transform: scale(.99); }
/* Подсветка, когда время обязательно (вне рабочих часов) */
.preorder-trigger.preorder-required {
  border-color: var(--red-2);
  border-left-color: var(--red-2);
  box-shadow: 0 0 0 2px rgba(225,6,0,.35), 0 6px 20px rgba(225,6,0,.25);
  animation: pob-pulse 1.4s ease-in-out infinite;
}
@keyframes pob-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(225,6,0,.30), 0 6px 20px rgba(225,6,0,.18); }
  50%      { box-shadow: 0 0 0 3px rgba(225,6,0,.55), 0 8px 26px rgba(225,6,0,.35); }
}

/* ---------- плашка «только предзаказ» на главной ---------- */
.preorder-only-banner[hidden] { display: none !important; }
.preorder-only-banner {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 100%;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(225,6,0,.16), rgba(225,6,0,.08));
  border: 1px solid var(--red-2);
  color: #fff;
  cursor: pointer;
  text-align: center;
  transition: transform .1s, box-shadow .15s;
  box-shadow: 0 6px 20px rgba(225,6,0,.2);
}
.preorder-only-banner:active { transform: scale(.99); }
.pob-badge {
  font-size: 14px; font-weight: 900; letter-spacing: 1px;
  color: #fff;
  text-transform: uppercase;
}
.pob-text { font-size: 12px; color: rgba(255,255,255,.85); line-height: 1.35; }
.preorder-trigger-ico { font-size: 22px; }
.preorder-trigger-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.preorder-trigger-text b { font-size: 15px; color: #fff; }
.preorder-trigger-text small { font-size: 12px; color: var(--muted); margin-top: 2px; }
.preorder-trigger-arrow { font-size: 26px; color: var(--red-2); line-height: 1; }
.preorder-clear {
  margin-top: 8px;
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.preorder-clear:active { transform: scale(.99); }

/* ---------- предзаказ: плашка «звоните для дальнего срока» ---------- */
.preorder-call-notice {
  margin-top: 14px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  background: rgba(28,28,28,.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.preorder-call-notice a {
  color: var(--red-2);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.preorder-call-notice a:hover { text-decoration: underline; }

/* ---------- предзаказ: модалка ---------- */
.preorder-modal[hidden] { display: none !important; }
.preorder-modal {
  position: fixed; inset: 0;
  z-index: 600;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.66);
  backdrop-filter: blur(4px);
  animation: fade-in .18s ease-out;
}
.preorder-sheet {
  width: 100%; max-width: 480px;
  max-height: 92vh; overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(20,20,20,.98), rgba(12,12,12,.98)),
    url('/static/img/Fon.png') center top / cover no-repeat;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -14px 46px rgba(0,0,0,.6);
  animation: sheet-up .26s cubic-bezier(.16,1,.3,1);
}
@keyframes sheet-up { from { transform: translateY(30px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
.preorder-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.preorder-head h3 { margin: 0; font-size: 18px; font-weight: 800; color: #fff; }
.preorder-note {
  font-size: 13px; color: var(--muted);
  line-height: 1.45;
  padding: 10px 14px;
  background: rgba(225,6,0,.08);
  border: 1px solid rgba(225,6,0,.25);
  border-radius: 12px;
  margin-bottom: 16px;
}

/* Выбор дня: горизонтальные чипы (замена календаря) */
.date-chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.date-chips::-webkit-scrollbar { display: none; }
.date-chip {
  flex: 0 0 auto;
  min-width: 84px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(28,28,28,.92);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, transform .1s, background .15s;
}
.date-chip:hover { border-color: var(--red); }
.date-chip:active { transform: scale(.96); }
.date-chip.selected {
  background: linear-gradient(180deg, var(--red-2), var(--red-dark));
  border-color: var(--red-2);
  color: #fff;
}
.date-chip .dc-day { font-size: 14px; font-weight: 800; white-space: nowrap; }
.date-chip .dc-wd { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.date-chip.selected .dc-wd { color: rgba(255,255,255,.85); }

/* (устар.) Календарь — оставлены безопасные заглушки на случай кеша */
.cal { margin-bottom: 6px; }
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title {
  font-size: 16px; font-weight: 700; color: #fff;
  text-transform: capitalize; letter-spacing: .5px;
}
.cal-arrow {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(28,28,28,.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--red-2);
  font-size: 22px; font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.cal-arrow:hover { border-color: var(--red); }
.cal-arrow:active { transform: scale(.94); }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 15px; font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.disabled { color: #444; cursor: default; }
.cal-cell.available {
  background: rgba(28,28,28,.92);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, transform .1s, background .15s;
}
.cal-cell.available:hover { border-color: var(--red); }
.cal-cell.available:active { transform: scale(.93); }
.cal-cell.selected {
  background: linear-gradient(180deg, var(--red-2), var(--red-dark));
  border-color: var(--red-2);
  color: #fff; font-weight: 800;
  box-shadow: 0 6px 18px rgba(225,6,0,.45);
}

/* Выбор времени */
.preorder-time { margin-top: 18px; }
.preorder-time-head {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 12px;
}
.preorder-time-head span { font-size: 15px; font-weight: 700; color: #fff; }
.preorder-time-head small { font-size: 12px; color: var(--red-2); font-weight: 600; }
.time-gran {
  display: flex; gap: 8px;
  margin-bottom: 14px;
}
.gran-btn {
  flex: 1;
  padding: 10px 6px;
  background: rgba(28,28,28,.92);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 12.5px; font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.gran-btn:active { transform: scale(.97); }
.gran-btn.active {
  background: linear-gradient(180deg, var(--red-2), var(--red-dark));
  border-color: var(--red-2);
  color: #fff;
  box-shadow: 0 5px 16px rgba(225,6,0,.4);
}
.time-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;                      /* промежутки, чтобы не промазать */
  margin-bottom: 6px;
}
.slot-btn {
  padding: 12px 4px;
  background: rgba(28,28,28,.92);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all .12s;
}
.slot-btn:hover { border-color: var(--red); }
.slot-btn:active { transform: scale(.94); }
.slot-btn.selected {
  background: linear-gradient(180deg, var(--red-2), var(--red-dark));
  border-color: var(--red-2);
  color: #fff;
  box-shadow: 0 6px 18px rgba(225,6,0,.45);
}
.slots-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 14px;
}
.time-custom {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px;
  background: rgba(28,28,28,.6);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.time-custom label {
  width: 100%;
  font-size: 13px; color: var(--muted); font-weight: 600;
}
.time-custom input[type="time"] {
  flex: 1; min-width: 120px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
}
.time-custom .btn { flex: 0 0 auto; margin: 0; }

.preorder-footer {
  position: sticky; bottom: 0;
  margin-top: 18px;
  padding-top: 14px;
  background: linear-gradient(180deg, rgba(12,12,12,0), rgba(12,12,12,.96) 40%);
}
.preorder-selected {
  text-align: center;
  font-size: 14px; font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
@media (max-width: 360px) {
  .time-slots { grid-template-columns: repeat(3, 1fr); }
}
