/* ===== Темы SushiWay =====
   gold    — Золото (по умолчанию, значения в base.css :root)
   glass   — iOS-стекло: светлые полупрозрачные панели с размытием
   emerald — Изумруд: глубокий зелёный с мятным акцентом
   Тема ставится атрибутом <html data-theme="…">. */

/* ---------- iOS-стекло ---------- */
html[data-theme="glass"] {
  --bg: #f2f4fa;
  --bg-rgb: 244, 246, 252;
  --bg-deep: #e9edf6;
  --bar: rgba(255, 255, 255, .62);
  --field: rgba(255, 255, 255, .72);
  --surface: rgba(255, 255, 255, .52);
  --surface-hi: rgba(255, 255, 255, .62);
  --surface-top: rgba(255, 255, 255, .78);
  --track: rgba(120, 120, 128, .18);
  --off: rgba(120, 120, 128, .32);
  --on-accent: #ffffff;
  --accent-rgb: 255, 106, 61;
  --accent2-rgb: 255, 90, 54;
  --line: rgba(60, 60, 67, .13);
  --line-strong: rgba(60, 60, 67, .24);
  --ink: #1c1c1e;
  --muted: #5d5e66;
  --dim: #8a8a91;
  --gold: #ff5f3a;
  --gold-hi: #ff9a62;
  --copper: #ff6a3d;
  --gold-grad: linear-gradient(100deg, #ff5a36 0%, #ff8a4f 50%, #ff5a36 100%);
  --btn-grad: linear-gradient(180deg, #ff9563 0%, #ff6a3d 55%, #f9542f 100%);
  --ok: #34c759;
  --warn: #ff9f0a;
  --danger: #ff3b30;
  --shadow: 0 14px 34px rgba(31, 38, 80, .14);
  --serif: -apple-system, 'SF Pro Display', 'Helvetica Neue', system-ui, sans-serif;
  --sans: -apple-system, 'SF Pro Text', 'Helvetica Neue', system-ui, 'Segoe UI', sans-serif;
  --pattern: none;
  --page-bg:
    radial-gradient(55% 40% at 8% 0%, #ffd6c4 0%, transparent 70%),
    radial-gradient(50% 40% at 100% 18%, #c7e1ff 0%, transparent 70%),
    radial-gradient(60% 45% at 30% 100%, #e2d6ff 0%, transparent 70%),
    radial-gradient(45% 35% at 95% 85%, #ffe3b8 0%, transparent 70%),
    #f2f4fa;
  --blur: blur(22px) saturate(180%);
  color-scheme: light;
}
html[data-theme="glass"] body,
html[data-theme="glass"] body .app { background: var(--page-bg); background-attachment: fixed; }
@media (min-width: 600px) { html[data-theme="glass"] .app { background: transparent; } }
/* Стекло: размытие под полупрозрачными панелями */
html[data-theme="glass"] :is(.appbar, .cats, .tabbar, .checkout-bar, .search, .cat, .round-btn, .card, .tile, .order-card, .form-card,
  .totals, .set-promo, .bento-card, .sheet, .seg, .chip-btn, .stepper.dark, .review, .nudge, .pause-banner,
  .a-top, .a-tabs, .order, .m-item, .rv, .kpi, .card, .login-card, .filters button, .toast, .icon-btn, .btn:not(.btn-gold)) {
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
html[data-theme="glass"] :is(.card, .tile, .order-card, .form-card, .set-promo, .bento-card, .order, .kpi, .login-card) {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 10px 30px rgba(31, 38, 80, .08);
  border-color: rgba(255, 255, 255, .7);
}
html[data-theme="glass"] .sheet { background: rgba(250, 251, 255, .82); border-color: rgba(255, 255, 255, .8); }
html[data-theme="glass"] dialog::backdrop { background: rgba(30, 34, 50, .28); }
html[data-theme="glass"] .serif, html[data-theme="glass"] :is(h1, h2, h3) { letter-spacing: -.02em; }
html[data-theme="glass"] .card-media, html[data-theme="glass"] .dish-hero { background: #1b1a1f; }
html[data-theme="glass"] .leaflet-tile-pane { filter: none; }
html[data-theme="glass"] .map-frame iframe { filter: none; }
html[data-theme="glass"] .cart-orb { box-shadow: 0 8px 22px rgba(255, 106, 61, .4), 0 0 0 5px rgba(255, 255, 255, .7); }
html[data-theme="glass"] .tab-dot { box-shadow: 0 0 0 2px #fff; }
html[data-theme="glass"] .orb-count { background: #fff; color: var(--gold); border-color: var(--gold); }
html[data-theme="glass"] .banner::after { background: linear-gradient(90deg, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .6) 45%, rgba(255, 255, 255, 0) 100%); }
html[data-theme="glass"] body.has-host-badge::after { background: rgba(255, 255, 255, .7); }

/* ---------- Изумруд ---------- */
html[data-theme="emerald"] {
  --bg: #04120d;
  --bg-rgb: 4, 18, 13;
  --bg-deep: #020a07;
  --bar: #05150f;
  --field: #061811;
  --surface: #0a1f17;
  --surface-hi: #0d261c;
  --surface-top: #113024;
  --track: #173a2c;
  --off: #24493a;
  --on-accent: #02160f;
  --accent-rgb: 52, 211, 153;
  --accent2-rgb: 16, 185, 129;
  --line: rgba(52, 211, 153, .2);
  --line-strong: rgba(52, 211, 153, .46);
  --ink: #e8f6ee;
  --muted: #9cc3b1;
  --dim: #6c9382;
  --gold: #6ee7b7;
  --gold-hi: #d1fae5;
  --copper: #10b981;
  --gold-grad: linear-gradient(100deg, #0f9f72 0%, #6ee7b7 30%, #ecfdf5 48%, #5fd6a8 64%, #0b8a62 100%);
  --btn-grad: linear-gradient(180deg, #8ff0c6 0%, #34d399 45%, #0f9f72 100%);
  --ok: #6ee7b7;
  --warn: #fbbf24;
  --danger: #f87171;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60' viewBox='0 0 120 60'%3E%3Cg fill='none' stroke='%2334d399' stroke-width='1.2' opacity='.12'%3E%3Cpath d='M0 60a60 60 0 0 1 120 0M12 60a48 48 0 0 1 96 0M24 60a36 36 0 0 1 72 0M36 60a24 24 0 0 1 48 0M48 60a12 12 0 0 1 24 0'/%3E%3Cpath d='M-60 30a60 60 0 0 1 120 0M-48 30a48 48 0 0 1 96 0M-36 30a36 36 0 0 1 72 0M-24 30a24 24 0 0 1 48 0M-12 30a12 12 0 0 1 24 0'/%3E%3Cpath d='M60 30a60 60 0 0 1 120 0M72 30a48 48 0 0 1 96 0M84 30a36 36 0 0 1 72 0M96 30a24 24 0 0 1 48 0M108 30a12 12 0 0 1 24 0'/%3E%3C/g%3E%3C/svg%3E");
  --page-bg: radial-gradient(60% 50% at 50% 0%, rgba(16, 185, 129, .16), transparent 70%), var(--pattern), #020a07;
  color-scheme: dark;
}

/* ---------- Переключатель тем ---------- */
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.theme-opt { position: relative; display: grid; gap: 8px; justify-items: center; padding: 10px 6px 12px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; }
.theme-opt[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
.theme-opt i { display: block; width: 100%; height: 54px; border-radius: 11px; border: 1px solid rgba(128, 128, 128, .25); }
.theme-opt .sw-gold { background: radial-gradient(circle at 70% 70%, #e2b57a 0 14px, transparent 15px), linear-gradient(135deg, #221a13, #0e0c0a); }
.theme-opt .sw-glass { background: radial-gradient(circle at 70% 70%, #ff6a3d 0 14px, transparent 15px), linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.5)), linear-gradient(135deg, #ffd6c4, #c7e1ff 60%, #e2d6ff); }
.theme-opt .sw-emerald { background: radial-gradient(circle at 70% 70%, #34d399 0 14px, transparent 15px), linear-gradient(135deg, #113024, #04120d); }
