/* ===== SushiWay — общие стили (сайт и админка) ===== */
:root {
  /* Тема «Золото» (по умолчанию). Остальные темы — в css/themes.css */
  --bg: #0e0c0a;
  --bg-rgb: 14, 12, 10;
  --bg-deep: #070605;
  --bg-2: #15110e;
  --bar: #100d0a;
  --field: #120f0c;
  --surface: #15110e;
  --surface-hi: #1a1511;
  --surface-top: #221a13;
  --track: #2e241b;
  --off: #3e3226;
  --on-accent: #1d130a;
  --accent-rgb: 226, 181, 122;
  --accent2-rgb: 216, 132, 62;
  --card: #1a1511;
  --card-2: #221b15;
  --line: rgba(226, 181, 122, .22);
  --line-strong: rgba(226, 181, 122, .5);
  --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='%23e2b57a' 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(216, 132, 62, .12), transparent 70%), var(--pattern), #070605;
  --blur: none;
  --ink: #f4ead8;
  --muted: #b9a88d;
  --dim: #8a7b66;
  --gold: #e2b57a;
  --gold-hi: #fff0cf;
  --copper: #d8843e;
  --gold-grad: linear-gradient(100deg, #8d5b2a 0%, #e2b57a 30%, #fff0cf 48%, #dba566 64%, #a86a32 100%);
  --btn-grad: linear-gradient(180deg, #f3d39d 0%, #e2b57a 45%, #c58a48 100%);
  --ok: #7fc48a;
  --warn: #f0b45a;
  --danger: #ef7a6a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Фон-узор сейгайха */
.waves-bg { background-image: var(--pattern); }

.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.serif { font-family: var(--serif); }

/* ---- Кнопки ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform .15s, background .2s, border-color .2s, opacity .2s; -webkit-tap-highlight-color: transparent; }
.btn:hover { border-color: var(--gold); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-gold { background: var(--btn-grad); color: var(--on-accent); border-color: transparent; box-shadow: 0 8px 24px rgba(var(--accent2-rgb), .28), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-danger { border-color: rgba(239, 122, 106, .5); color: var(--danger); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); display: grid; place-items: center; color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---- Поля ---- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .field-label { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.input, .field input:not([type=radio]):not([type=checkbox]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--field); color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 72px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.err { color: var(--danger); font-size: 13px; min-height: 0; }
.err:empty { display: none; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 10px 8px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); transition: .2s; }
.seg input:checked + span { background: var(--btn-grad); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 2px solid var(--gold); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--track); border: 1px solid var(--line); position: relative; transition: .2s; flex: none; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked { background: var(--gold); }
.switch input:checked::after { left: 21px; background: var(--on-accent); }

/* ---- Диалоги (на телефоне — шторка снизу) ---- */
dialog { padding: 0; border: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(5, 4, 3, .72); backdrop-filter: blur(4px); }
.sheet { width: min(560px, 100vw); max-height: min(92vh, 900px); margin: auto auto 0; border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, var(--surface-hi), var(--field)); border: 1px solid var(--line); border-bottom: 0; box-shadow: var(--shadow); display: flex; flex-direction: column; }
dialog[open].sheet { animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; flex: 1; font: 700 28px/1.1 var(--serif); }
.sheet-body { padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { padding: 14px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: rgba(var(--bg-rgb), .6); }
@media (min-width: 700px) {
  .sheet { margin: auto; border-radius: 24px; border-bottom: 1px solid var(--line); }
}

/* ---- Тост ---- */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px); z-index: 100;
  padding: 12px 18px; border-radius: 999px; background: var(--surface-top); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.is-error { border-color: var(--danger); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.badge-gold { background: var(--btn-grad); color: var(--on-accent); }
.badge-line { border: 1px solid var(--line-strong); color: var(--gold); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(var(--accent-rgb), .25); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; justify-content: center; padding: 40px 0; }

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