:root {
  /* Фирменная палитра (2026-08-28) — снята напрямую с реального лого/аватарки канала
     Telegram чайной (t.me/totsamiy_slon_live), а не придумана заново: бордово-красный фон +
     светло-жёлтый акцент (цвет обводки слоника на лого). Проверено на контраст (WCAG AA):
     белый текст на brand-red — 5.8:1; тёмный текст на кремовых поверхностях — 12–16:1.
     Карточки/модалки — тёплый кремовый (как страница меню на красной скатерти), а не белый.*/
  --brand-red: #c62020;
  --brand-red-dim: #a51c1c;
  --brand-gold: #fbd17b;
  --brand-gold-deep: #cf9a3d;
  --cream: #fdf6ec;
  --cream-dim: #f5e9d6;
  --ink: #3a0f0f;
  --ink-soft: #8a5a4a;

  --bg: var(--cream);
  --text: var(--ink);
  --hint: var(--ink-soft);
  --link: var(--brand-gold-deep);
  --button: var(--brand-red-dim);
  --button-text: #ffffff;
  --secondary-bg: var(--cream-dim);

  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  /* Фирменный красный фон (2026-08-28) — тон в тон с логотипом/каналом чайной, лёгкий
     градиент для глубины, а не плоская заливка. Карточки поверх — кремовые, читаются как
     светлые плитки меню на красной скатерти. */
  background: linear-gradient(180deg, var(--brand-red) 0%, var(--brand-red-dim) 100%);
  color: var(--cream);
  padding-bottom: 24px;
  overscroll-behavior: contain; /* не даём случайному "потяни-обнови" перекрыть каталог */
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  background: var(--brand-red);
  z-index: 6;
  border-bottom: 1px solid rgba(251,209,123,0.25);
}
.topbar h1 { font-family: var(--font-heading); font-weight: 600; font-size: 19px; margin: 0; letter-spacing: .01em; color: var(--brand-gold); }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-btn {
  position: relative;
  border: none;
  background: var(--secondary-bg);
  border-radius: 999px;
  padding: 10px 14px;
  min-height: 44px;
  font-size: 15px;
  cursor: pointer;
  color: var(--text);
}
.cart-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 4px;
  background: var(--button);
  color: var(--button-text);
  border-radius: 999px;
  font-size: 11px;
  line-height: 18px;
  margin-left: 2px;
}

/* --- Табы категорий --- */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 61px;
  background: var(--brand-red);
  z-index: 5;
  border-bottom: 1px solid rgba(251,209,123,0.25);
}
.category-tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,0.12);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  min-height: 40px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tab.active {
  border-color: var(--tab-accent, var(--button));
  background: var(--tab-accent, var(--button));
  color: #fff;
}

.catalog {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 16px;
}
.catalog-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--hint);
  font-size: 13.5px;
  padding: 40px 0;
}

.card {
  background: var(--secondary-bg);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border-top: 3px solid var(--card-accent, transparent);
}
.card-photo-wrap { position: relative; }
.badge-soon {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 1;
}
.card-photo {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--secondary-bg);
  object-fit: cover;
  display: block;
}
.card-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hint);
  font-size: 12px;
  text-align: center;
  padding: 8px;
  aspect-ratio: 1/1;
}
.card-body { padding: 10px 10px 12px; }
.card-cat { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 3px; }
.card-name { font-family: var(--font-heading); font-size: 14.5px; font-weight: 600; line-height: 1.3; margin: 0 0 4px; color: var(--card-accent, var(--text)); }
.card-price { font-size: 12.5px; color: var(--hint); margin: 0; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  z-index: 20;
}
.modal.hidden { display: none; }
.modal-sheet {
  background: var(--bg);
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 18px 18px 0 0;
  padding: 20px 16px 28px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: var(--secondary-bg);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  color: var(--text);
}

.detail-photos-wrap { position: relative; }
.detail-photos-wrap .badge-soon { top: 12px; right: 12px; }
.detail-photos {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
}
.detail-photos img {
  height: 240px;
  border-radius: 12px;
  flex-shrink: 0;
}
.detail-photos .placeholder {
  height: 240px;
  width: 100%;
  background: var(--secondary-bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hint);
  font-size: 13px;
  text-align: center;
  padding: 10px;
  flex-shrink: 0;
}

.detail-name { font-family: var(--font-heading); font-size: 20px; font-weight: 600; margin: 4px 0 8px; color: var(--text); }
.detail-notes { font-size: 13.5px; color: var(--hint); line-height: 1.55; margin-bottom: 16px; }

.variant-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
/* Один вариант (например, посуда — просто «шт») — на всю ширину, не прижат влево. */
.variant-grid.single { grid-template-columns: 1fr; }
.variant-opt {
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 10px 8px;
  min-height: 44px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.variant-opt.selected {
  border-color: var(--tab-accent, var(--button));
  background: var(--secondary-bg);
}
.variant-opt .variant-label { font-size: 13px; font-weight: 700; display: block; color: var(--text); }
.variant-opt .price { font-size: 12px; color: var(--hint); display: block; margin-top: 2px; }
.variant-opt.selected .price { color: var(--text); font-weight: 600; }

.bulk-box {
  border-top: 1px solid rgba(0,0,0,0.08);
  margin-top: 4px;
  padding-top: 14px;
}
.bulk-label { font-size: 12.5px; color: var(--hint); margin: 0 0 8px; }

.bulk-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.stepper-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--tab-accent, rgba(0,0,0,0.12));
  background: var(--bg);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.stepper-btn:disabled { opacity: 0.3; cursor: default; }
.bulk-input {
  width: 88px;
  min-height: 44px;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  border: 1.5px solid var(--tab-accent, rgba(0,0,0,0.12));
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  /* убираем нативные стрелки — своя пара +/- уже есть */
  -moz-appearance: textfield;
}
.bulk-input::-webkit-outer-spin-button,
.bulk-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bulk-unit { font-size: 13px; color: var(--hint); }

.bulk-price-row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.bulk-price-label { font-size: 12.5px; color: var(--hint); }
.bulk-price { font-family: var(--font-heading); font-size: 18px; font-weight: 600; color: var(--text); }

.bulk-prompt {
  background: var(--secondary-bg);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.bulk-prompt p { font-size: 12.5px; margin: 0 0 8px; color: var(--text); }
.bulk-prompt-actions { display: flex; gap: 8px; }
.bulk-prompt-btn {
  flex: 1;
  min-height: 40px;
  border-radius: 8px;
  border: none;
  background: var(--tab-accent, var(--button));
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.bulk-prompt-btn.ghost {
  background: transparent;
  border: 1.5px solid rgba(0,0,0,0.15);
  color: var(--text);
}

.variant-savings {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 700;
  color: #2f7a3d;
}

.add-btn, .submit-btn {
  width: 100%;
  border: none;
  background: var(--button);
  color: var(--button-text);
  padding: 14px;
  min-height: 48px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.add-btn:disabled { opacity: 0.4; }

.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.cart-row-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.cart-row-sub { font-size: 12px; color: var(--hint); }
.cart-row-right { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  border: none;
  background: var(--secondary-bg);
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}
.remove-btn { border: none; background: none; color: #b23a3a; font-size: 13px; cursor: pointer; min-height: 44px; }

.cart-total { font-size: 16px; font-weight: 700; margin: 14px 0; text-align: right; font-family: var(--font-heading); color: var(--text); }
.cart-empty { color: var(--hint); font-size: 13.5px; padding: 20px 0; text-align: center; }

.checkout-form { display: flex; flex-direction: column; gap: 12px; }
.consent-label {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 8px !important;
  font-size: 12px !important;
  color: var(--hint);
}
.consent-label input { margin-top: 2px; flex-shrink: 0; width: 18px; height: 18px; }
.consent-label a { color: var(--link); }
.checkout-form label { font-size: 12.5px; color: var(--hint); display: flex; flex-direction: column; gap: 4px; }
.checkout-form select,
.checkout-form input,
.checkout-form textarea {
  font-size: 14px;
  padding: 11px 10px;
  min-height: 44px;
  border-radius: 10px;
  border: 1.5px solid rgba(0,0,0,0.12);
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  .modal-sheet { transition: transform .18s ease; }
}
