:root {
  /* Тёмная — фирменная тема по умолчанию (матовый пол зала, а не бумага) */
  --bg: #121316;
  --ink: #FFFFFF;
  --ink-soft: #9DA1AE;
  --accent: #F0B23E;
  --accent-2: #7FBF74;
  --line: #2B2E36;
  --paper: #1B1D22;
  --radius: 10px;
  --danger: #FF6B5E;
  --success: #7FBF74;
  --header-bg: rgba(18, 19, 22, 0.9);
  --shimmer: #262931;
  --card-shadow: none;
  color-scheme: dark;

  /* Фиксированные цвета бренда — не меняются между темами. Нужны для
     элементов вроде золотых бейджей или контрастных плашек,
     где текст обязан оставаться читаемым вне зависимости от темы
     страницы (--ink/--bg, наоборот, специально "переключаются"). */
  --navy: #121316;
  --cream: #FFFFFF;

  /* Единая кривая анимации для всех "появлений" на сайте (скролл-реveal
     секций, hero-визуал, карточки каталога). Обычный "ease" ускоряется в
     начале и конце примерно одинаково — глазу это читается как немного
     механическое, "по умолчанию из браузера" движение. Эта кривая (мягкий
     старт, плавное затухание к концу — так называемый "ease-out-expo")
     ощущается куда спокойнее и дороже: именно такую используют в motion-
     дизайне топовые продуктовые сайты (Stripe, Linear и т.п.). Меняется
     здесь в одном месте — сразу для всех анимаций появления на сайте. */
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  /* Белая тема: страница и карточки — оба чисто белые (#FFFFFF), поэтому
     границы (--line) сделаны заметно контрастнее, чем были на бежевом
     фоне, и у карточек появилась собственная тень (--card-shadow) —
     иначе на одинаково белом фоне контуры карточек просто исчезают. */
  --bg: #FFFFFF;
  --ink: #15171C;
  --ink-soft: #5B5F6B;
  --accent: #D9932A;
  --accent-2: #4F8F49;
  --line: #DDDDE3;
  --paper: #FFFFFF;
  --danger: #D9483A;
  --success: #3F7A3A;
  --header-bg: rgba(255, 255, 255, 0.92);
  --shimmer: #EFEFF2;
  --card-shadow: 0 1px 2px rgba(20,20,25,0.04), 0 6px 16px rgba(20,20,25,0.05);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* На телефонах (iOS Safari, Android Chrome) любой тап по кнопке/ссылке/лейблу
   по умолчанию на долю секунды подсвечивает элемент системным синим —
   это никак не настраивается через обычные цвета сайта и не совпадает
   с чёрно-золотой темой сайта. Убираем эту подсветку везде и заменяем
   её на собственное (уже настроенное через :active ниже) поведение. */
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
/* Отступ под "прилипающую" шапку — иначе переход по ссылке из меню
   подводит секцию точно под шапку, и её заголовок оказывается перекрыт. */
#catalog, #about, #info, #contact { scroll-margin-top: 90px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  /* Бегущая строка — декоративный элемент бренда, а не резкая анимация,
     поэтому её не выключаем вместе с остальным движением на странице. */
  .marquee { animation-duration: var(--marquee-duration, 22s) !important; animation-iteration-count: infinite !important; }

  /* Отклик на "добавить в корзину" — короткое (≤0.6с) подтверждение действия,
     не автоплей и не декорация, поэтому тоже оставляем как есть. */
  .cart-trigger.bump { animation-duration: .6s !important; animation-iteration-count: 1 !important; }
  .cart-trigger.bump::after { animation-duration: .6s !important; animation-iteration-count: 1 !important; }
  .cart-badge.pop { animation-duration: .6s !important; animation-iteration-count: 1 !important; }
  .add-btn.added { animation-duration: .5s !important; animation-iteration-count: 1 !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Название товара, описание, тексты настроек — всё это вводит админ
     через панель управления, без каких-либо ограничений. Если туда попадёт
     одно очень длинное "слово" без пробелов (ссылка, случайный набор
     символов, склеенный текст) — по умолчанию браузer не переносит его на
     новую строку, а раздвигает весь блок (и всю модалку/карточку вместе с
     ним) по ширине, пока слово не поместится целиком. Это свойство
     наследуется всеми элементами страницы разом, поэтому одной строкой
     защищает весь сайт: если слово не помещается — оно переносится, макет
     остаётся целым, ничего никуда не растягивается. */
  overflow-wrap: anywhere;
  word-break: break-word;
}

a { color: inherit; text-decoration: none; }
/* Некоторые кнопки в коде задавали свой цвет только для :hover/.active, а
   в обычном состоянии полагались на то, что браузер сам возьмёт цвет
   текста родителя. В тёмной теме (color-scheme: dark в самом верху файла)
   Safari на iPhone в такой ситуации подставляет свой системный синий —
   отсюда синие "+", бургер-меню, фильтры категорий и т.п. Раньше это было
   точечно поправлено у 3-4 кнопок, теперь фиксируем на уровне всех
   button-элементов сразу, чтобы больше не всплывало в других местах
   сайта или админки. */
button { color: inherit; font-family: inherit; }
img, svg { display: block; max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
@media(max-width: 480px) { .wrap { padding: 0 44px; } }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 500;
}

h1, h2, h3 { font-family: 'Oswald', sans-serif; line-height: 1.05; letter-spacing: 0.01em; text-transform: uppercase; font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 15px;
  padding: 14px 26px; border-radius: var(--radius);
  border: 1.5px solid var(--ink); cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { transform: translateY(-2px); background: var(--ink); color: var(--bg); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #FFF; }
.btn-danger:hover { background: #E5493C; border-color: #E5493C; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--navy); }
.btn-accent:hover { background: #FFC868; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; }

/* HEADER & NAV */
header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s ease;
}
header.scrolled { box-shadow: 0 6px 20px rgba(0,0,0,0.28); }
nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; transition: padding .25s ease; gap: 12px; }
header.scrolled nav { padding: 12px 0; }
.logo { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: 0.02em; white-space: nowrap; }

.nav-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.nav-links { display: flex; gap: 32px; font-size: 14px; font-weight: 500; }
.nav-links a { position: relative; padding: 4px 0; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 1.5px; background: var(--accent);
  transition: width .25s ease;
}
.nav-links a:hover::after { width: 100%; }

.theme-toggle {
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 50%; color: var(--ink);
  width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1; cursor: pointer; transition: transform .18s ease, background .18s ease, color .18s ease;
}
.theme-toggle:hover { transform: translateY(-2px); background: var(--ink); color: var(--bg); }

.cart-trigger {
  position: relative; background: var(--paper); border: 1.5px solid var(--ink); color: var(--ink);
  padding: 9px 16px; border-radius: var(--radius); font-weight: 600; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; gap: 8px; transition: transform .18s ease, padding .2s ease, gap .2s ease;
  white-space: nowrap; flex-shrink: 0;
}
.cart-trigger:hover { transform: translateY(-2px); background: var(--ink); color: var(--bg); }
.cart-trigger.bump { animation: cartBump .6s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes cartBump {
  0% { transform: scale(1) rotate(0); }
  40% { transform: scale(1.26) rotate(-6deg); }
  65% { transform: scale(0.95) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}
/* Кольцо, расходящееся от иконки корзины — весь отклик сосредоточен на ней,
   ничего никуда не "летит" и не отвлекает взгляд в сторону. */
.cart-trigger::after {
  content: ''; position: absolute; inset: -3px; border-radius: calc(var(--radius) + 3px);
  border: 2px solid var(--accent); opacity: 0; pointer-events: none;
}
.cart-trigger.bump::after { animation: cartRing .6s ease-out; }
@keyframes cartRing {
  0% { opacity: .9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.4); }
}
.cart-badge {
  background: var(--accent); color: var(--navy); font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  display: inline-block; white-space: nowrap; flex-shrink: 0;
}
.cart-badge.pop { animation: badgePop .6s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes badgePop {
  0% { transform: scale(1); background: var(--accent); }
  35% { transform: scale(1.9); background: var(--ink); color: var(--bg); }
  100% { transform: scale(1); background: var(--accent); color: var(--navy); }
}

.burger { display: none; background: none; border: none; color: var(--ink); font-size: 24px; cursor: pointer; padding: 4px; flex-shrink: 0; }

.mobile-menu {
  display: none; position: fixed; top: 65px; left: 0; width: 100%; background: var(--bg);
  border-bottom: 1px solid var(--line); padding: 20px 28px; z-index: 45; flex-direction: column; gap: 16px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.mobile-menu.active { display: flex; }
@media(max-width: 820px) {
  .nav-links { display: none; }
  .burger { display: block; }
}
/* На узких телефонах .wrap получает увеличенный боковой отступ (44px,
   см. правило ниже) ради читаемых секций контента — но в шапке при таком
   отступе логотипу, переключателю темы, кнопке корзины и бургеру
   переставало хватать места, и всё сминалось/переносилось по буквам
   (сработала общая защита overflow-wrap: anywhere в body). Для шапки на
   таких экранах используем свой, более узкий отступ и компактную кнопку
   корзины (без текстовой подписи, только иконка и счётчик) — так же,
   как это принято в мобильных версиях большинства интернет-магазинов. */
@media(max-width: 560px) {
  header .wrap { padding: 0 18px; }
  .logo { font-size: 18px; }
  .nav-right { gap: 10px; }
  .theme-toggle { width: 34px; height: 34px; font-size: 14px; }
  .cart-trigger { padding: 8px 10px; gap: 6px; }
  .cart-label { display: none; }
  .burger { font-size: 21px; }
}

/* HERO */
.hero { position: relative; overflow: hidden; padding: 80px 0 60px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 50px; align-items: center; }
@media(max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 {
  font-family: 'Russo One', 'Oswald', sans-serif; font-weight: 400; text-transform: uppercase;
  font-size: clamp(32px, 5vw, 60px); line-height: 1.06; letter-spacing: 0; margin: 18px 0 22px;
}
.hero p { font-size: 17px; color: var(--ink-soft); max-width: 440px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* СОЦСЕТИ — заполняются через админку (Instagram / Telegram-канал).
   Пока поле не заполнено, соответствующая иконка (или весь блок, если не
   заполнено ни одно) скрыта атрибутом [hidden] — см. renderSettings() в site.js. */
.hero-social {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 30px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 20px 8px 22px; box-shadow: 0 10px 26px rgba(0,0,0,0.25);
}
[data-theme="light"] .hero-social { box-shadow: 0 10px 26px rgba(21,23,28,0.08); }
.hero-social[hidden] { display: none; }
.hero-social-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-soft); white-space: nowrap;
}
.hero-social-icons { display: flex; gap: 9px; }
.social-icon-btn {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); border: none; color: var(--navy);
  box-shadow: 0 5px 14px rgba(240,178,62,0.32);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), background .18s ease, color .18s ease, box-shadow .22s ease;
}
.social-icon-btn[hidden] { display: none; }
.social-icon-btn svg { width: 19px; height: 19px; }
.social-icon-btn:hover {
  transform: translateY(-3px) scale(1.08); background: var(--ink); color: var(--bg);
  box-shadow: 0 12px 26px rgba(0,0,0,0.35);
}
.social-icon-btn-sm { width: 33px; height: 33px; box-shadow: 0 4px 10px rgba(240,178,62,0.28); }
.social-icon-btn-sm svg { width: 15.5px; height: 15.5px; }
.foot-social { display: flex; align-items: center; gap: 10px; }
.foot-social[hidden] { display: none; }

.hero-visual {
  position: relative; aspect-ratio: 16/11; border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 15% 0%, #24262E 0%, transparent 55%),
    linear-gradient(155deg, #1B1D22 0%, #121316 100%);
  border: 1px solid var(--line);
  clip-path: polygon(8% 0, 100% 0, 100% 92%, 92% 100%, 0 100%, 0 8%);
  display: flex; align-items: center; justify-content: center;
  animation: rise .9s var(--ease-premium) both; padding: 40px 40px 76px;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.hero-visual svg { width: 74%; }
.hero-visual img { width: 100%; height: auto; max-height: 100%; object-fit: contain; opacity: 0; transition: opacity .5s ease; }
.hero-visual img.loaded { opacity: 1; }
.hero-tag {
  position: absolute; bottom: 20px; left: 20px; right: 20px; background: var(--paper); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: var(--radius); font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.04em; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  width: fit-content; max-width: calc(100% - 40px);
}
@media(max-width: 460px) { .hero-tag { font-size: 10.5px; padding: 8px 12px; } .hero-social { padding: 7px 16px 7px 18px; gap: 11px; } .hero-social-label { font-size: 10.5px; } }

/* MARQUEE */
.marquee-wrap { border-top: 1px solid var(--navy); border-bottom: 1px solid var(--navy); background: var(--navy); overflow: hidden; }
.marquee {
  display: flex; width: max-content; white-space: nowrap;
  animation: scroll var(--marquee-duration, 22s) linear infinite;
}
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee span {
  color: var(--cream); font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 15px;
  padding: 16px 34px; letter-spacing: 0.06em; text-transform: uppercase;
}

/* SECTION */
.section { padding: 80px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }

/* CATEGORY FILTERS */
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.cat-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.cat-btn {
  background: var(--paper); border: 1px solid var(--line); padding: 8px 18px; color: var(--ink);
  border-radius: 999px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: all .18s ease; font-family: 'Inter', sans-serif;
}
.cat-btn:hover, .cat-btn.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.catalog-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.search-field {
  position: relative; display: flex; align-items: center;
}
.search-field .search-icon {
  position: absolute; left: 12px; color: var(--ink-soft); font-size: 15px; pointer-events: none;
}
.search-field input {
  padding: 9px 14px 9px 32px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 13.5px; background: var(--paper); color: var(--ink);
  width: 200px; transition: border-color .18s ease, width .25s ease;
}
.search-field input:focus { outline: none; border-color: var(--ink); width: 230px; }
.sort-select {
  padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 13.5px; background: var(--paper); color: var(--ink);
  cursor: pointer;
}
.sort-select:focus { outline: none; border-color: var(--ink); }
@media(max-width: 560px) { .search-field input, .search-field input:focus { width: 100%; } .catalog-controls { width: 100%; } .search-field { flex: 1; } }

/* CATALOG GRID */
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media(max-width: 860px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media(max-width: 560px) { .catalog-grid { grid-template-columns: 1fr; } }

/* Раньше весь каталог целиком появлялся одним плоским "морганием" (opacity
   0 -> 1 на всю сетку сразу) — на глаз это читается как рывок, особенно
   когда карточек много. Вместо этого каждая карточка сама мягко всплывает
   и проявляется по отдельности, с небольшой задержкой одна за другой
   (задаётся через --card-delay прямо в разметке, см. site.js) — получается
   спокойное "каскадное" появление, как в топовых интернет-магазинах, а не
   единовременная вспышка. */
@keyframes cardEnter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .22s ease, box-shadow .22s ease;
  display: flex; flex-direction: column; position: relative; cursor: pointer;
  box-shadow: var(--card-shadow); min-width: 0;
  animation: cardEnter .6s var(--ease-premium) both;
  animation-delay: var(--card-delay, 0ms);
}
.card:hover { transform: translateY(-5px); box-shadow: 0 16px 32px rgba(0,0,0,0.35); }
.card-media {
  aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
  background: var(--bg); border-bottom: 1px solid var(--line); position: relative; overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.07); }
.card-media svg { width: 44%; transition: transform .35s ease; }
.card:hover .card-media svg { transform: scale(1.06); }

/* ФОТО-КАРУСЕЛЬ ТОВАРА — используется и в карточке каталога, и в быстром
   просмотре. Слайды едут через transform на общем "треке" (.gallery-track),
   поэтому переключение плавное и не требует перерисовки DOM. */
.gallery { position: relative; width: 100%; height: 100%; touch-action: pan-y; overflow: hidden; }
.gallery-track { display: flex; width: 100%; height: 100%; transition: transform .4s cubic-bezier(.4,0,.2,1); }
.gallery-slide { flex: 0 0 100%; width: 100%; height: 100%; overflow: hidden; }
/* Фото товаров грузятся лениво (loading="lazy") и часто весят больше
   мегабайта — без этого правила они на медленном интернете резко
   "выскакивают" на пустом месте, как только докачаются. Вместо этого
   картинка плавно проявляется из полупрозрачной, когда действительно
   готова показаться (класс .loaded добавляется в site.js по событию
   onload) — глазу это ощущается как единый плавный процесс, а не рывок. */
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: transform .35s ease, opacity .45s ease; }
.gallery-slide img.loaded { opacity: 1; }
.card:hover .gallery-slide img { transform: scale(1.07); }

.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; z-index: 4;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1; cursor: pointer; padding: 0;
  opacity: 0; transition: opacity .18s ease, background .15s ease, color .15s ease, transform .15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.card:hover .gallery-arrow { opacity: 1; }
.qv-media .gallery-arrow { opacity: 1; } /* в быстром просмотре стрелки видны всегда */
@media (hover: none) { .gallery-arrow { opacity: 1; } }
.gallery-arrow:hover { background: var(--ink); color: var(--bg); transform: translateY(-50%) scale(1.08); }
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

.gallery-dots {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; gap: 5px; padding: 5px 7px; border-radius: 999px; background: rgba(0,0,0,0.4);
}
.gallery-dot {
  width: 5px; height: 5px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: rgba(255,255,255,0.5); transition: transform .15s ease, background .15s ease;
}
.gallery-dot.active { background: #FFF; transform: scale(1.5); }

.qv-trigger {
  position: absolute; bottom: 10px; left: 50%; transform: translate(-50%, 12px);
  background: var(--ink); color: var(--bg); border: none; padding: 8px 16px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; font-family: 'Inter', sans-serif;
  opacity: 0; transition: opacity .2s ease, transform .2s ease; cursor: pointer; z-index: 2;
  white-space: nowrap;
}
.card:hover .qv-trigger { opacity: 1; transform: translate(-50%, 0); }
@media(hover: none) {
  .qv-trigger { opacity: 1; transform: translate(-50%, 0); bottom: 10px; }
}

.card-badge {
  position: absolute; top: 12px; left: 12px; background: var(--accent); color: var(--navy);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 4px 10px; border-radius: 999px; font-weight: 700;
  z-index: 2;
}
.card-badge-stock {
  left: auto; right: 12px; background: var(--paper); color: var(--ink-soft);
  border: 1px solid var(--line);
}
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex-grow: 1; justify-content: space-between; }
.card-body .eyebrow { margin-bottom: 6px; }
.card-body h3 { font-size: 17px; font-weight: 600; font-family: 'Inter', sans-serif; margin-bottom: 8px; line-height: 1.3; }
.card-body p.desc { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.card-foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; gap: 10px; }
.price { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700; display: block; }
.stock-note { display: block; font-size: 11px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.add-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--ink); color: var(--ink);
  background: transparent; font-size: 18px; cursor: pointer; transition: .18s ease;
  display: flex; align-items: center; justify-content: center;
}
.add-btn:hover { background: var(--ink); color: var(--bg); transform: scale(1.08); }
.add-btn.added { background: var(--accent-2); border-color: var(--accent-2); color: var(--cream); animation: addBtnPop .5s ease; }
@keyframes addBtnPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ABOUT SECTION REDESIGN (THEME REACTIVE) */
.about {
  background: var(--bg); color: var(--ink); position: relative; padding: 90px 0; overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background 0.3s ease, color 0.3s ease;
}
.about-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 54px; align-items: flex-start; }
@media(max-width: 960px) { .about-grid { grid-template-columns: 1fr; gap: 40px; } }
/* Раньше этот блок на телефоне принудительно центрировался — плашка,
   заголовок и текст съезжали в центр, хотя на компьютере всё стоит по
   левому краю. Теперь на телефоне текст выровнен точно так же, как на
   компьютере (по левому краю) — только сам блок остаётся внутри общих
   боковых отступов страницы (.wrap), поэтому текст не липнет к краям
   экрана. */

.section-tag-pill {
  display: inline-block; background: rgba(240, 178, 62, 0.14); color: var(--accent);
  border: 1px solid rgba(240, 178, 62, 0.35); padding: 6px 14px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 700;
  letter-spacing: 1px; margin-bottom: 18px; text-transform: uppercase;
}
.section-tag-pill.light-pill {
  background: var(--paper); color: var(--ink); border-color: var(--line);
}

.about-content h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; color: var(--ink); line-height: 1.25; margin-bottom: 14px; letter-spacing: -0.01em; }
@media(max-width: 480px) { .about-content h2 { font-size: clamp(22px, 7vw, 28px); } }
.about-lead { font-size: 16.5px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 26px; max-width: 620px; font-weight: 400; }

.about-cards-grid { display: flex; flex-direction: column; gap: 14px; margin-bottom: 30px; }
.about-card-item {
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px; transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.about-card-item:hover {
  border-color: var(--ink); box-shadow: 0 12px 28px rgba(0,0,0,0.25);
  transform: translateY(-2px);
}
.aci-header { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 6px; }
.aci-badge {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 700;
  color: var(--ink-soft); letter-spacing: 0.8px; text-transform: uppercase;
}
.aci-badge-gold { color: var(--accent); }
.about-card-item h3 { font-size: 16.5px; font-weight: 700; color: var(--ink); font-family: 'Inter', sans-serif; }
.about-card-item p { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin: 0; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
@media(max-width: 560px) { .stat-row { grid-template-columns: 1fr; } }
.stat {
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 18px 14px; text-align: center;
  box-shadow: var(--card-shadow);
}
.stat b { display: block; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 28px; color: var(--accent); margin-bottom: 2px; letter-spacing: 0.01em; }
.stat span { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

.about-badge-card {
  background: linear-gradient(145deg, var(--paper) 0%, var(--bg) 100%);
  border: 1.5px solid rgba(240, 178, 62, 0.3); border-radius: var(--radius);
  padding: 40px 30px; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.28);
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 420px; transition: background 0.3s ease, border-color 0.3s ease;
}
[data-theme="light"] .about-badge-card {
  background: var(--paper); border-color: var(--line); box-shadow: 0 16px 36px rgba(21,23,28,0.06);
}

.badge-top {
  position: relative; z-index: 1; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 2px; color: var(--accent); font-weight: 700;
  text-transform: uppercase; margin-bottom: 24px;
}
.badge-center { position: relative; z-index: 1; }
.badge-logo-text {
  font-family: 'Russo One', 'Oswald', sans-serif; font-size: clamp(26px, 3.2vw, 34px);
  color: var(--ink); letter-spacing: 0.5px; line-height: 1.1; margin-bottom: 6px; text-transform: uppercase;
}

.badge-sub { font-size: 11px; font-weight: 600; letter-spacing: 2px; color: var(--ink-soft); margin-bottom: 20px; }

.badge-divider { width: 60px; height: 2px; background: var(--accent); margin: 0 auto 20px; opacity: 0.85; }
.badge-tag {
  display: inline-block; background: rgba(240, 178, 62, 0.15); color: var(--accent);
  padding: 5px 14px; border-radius: 999px; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700; margin-bottom: 8px; letter-spacing: 0.5px;
}
.badge-event { font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.02em; }

.badge-years { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--accent-2); font-weight: 600; }
.badge-footer {
  position: relative; z-index: 1; display: flex; justify-content: space-between;
  gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-soft); flex-wrap: wrap; justify-content: center; font-weight: 500;
}

/* INFO / DELIVERY SECTION REDESIGN */
.info-section { padding: 90px 0; background: var(--bg); }
.text-center { text-align: center; }
.section-head.text-center { margin-bottom: 44px; display: flex; flex-direction: column; align-items: center; }
.section-subtext { font-size: 16px; color: var(--ink-soft); margin-top: 6px; max-width: 500px; }

.delivery-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 36px; }
@media(max-width: 980px) { .delivery-cards-grid { grid-template-columns: 1fr 1fr; } }
@media(max-width: 640px) { .delivery-cards-grid { grid-template-columns: 1fr; gap: 20px; } }

.del-card {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px; transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex; flex-direction: column; justify-content: space-between; position: relative;
  box-shadow: var(--card-shadow);
}
.del-card:hover {
  transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0,0,0,0.3);
  border-color: var(--ink);
}
.del-step {
  position: absolute; top: 20px; right: 24px; font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700; color: var(--line);
}
.del-card-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.del-icon {
  font-size: 32px; width: 56px; height: 56px; border-radius: var(--radius);
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 1px solid var(--line);
}
.del-badge {
  display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.5px; margin-bottom: 4px;
}
.badge-green { background: rgba(127, 191, 116, 0.16); color: var(--accent-2); }
.badge-gold { background: rgba(240, 178, 62, 0.16); color: var(--accent); }
.badge-backorder { background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft); padding: 2px 9px; }
.del-card-backorder { border-style: dashed; }


.del-card h3 { font-size: 20px; font-weight: 700; font-family: 'Inter', sans-serif; color: var(--ink); }
.del-desc { font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 20px; }

.del-check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--line); padding-top: 16px; }
.del-check-list li { font-size: 13.5px; color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.check-mark { color: var(--accent-2); font-weight: 800; font-size: 15px; }

.payment-bar {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 28px; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; box-shadow: var(--card-shadow);
}
.pay-title { font-size: 14.5px; font-weight: 600; color: var(--ink); font-family: 'Inter', sans-serif; }
.pay-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pay-pill {
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 600;
  background: var(--bg); border: 1px solid var(--line); padding: 7px 14px;
  border-radius: 999px; color: var(--ink);
}
.info-card h3 { font-size: 18px; font-weight: 600; font-family: 'Inter', sans-serif; margin-bottom: 10px; }
.info-card p { color: var(--ink-soft); font-size: 14.5px; }
.pay-badges { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pay-badges span {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; border: 1px solid var(--line);
  padding: 6px 10px; border-radius: var(--radius); color: var(--ink-soft);
}

/* CONTACT / FOOTER (THEME REACTIVE) */
.contact {
  background: var(--paper); color: var(--ink);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background 0.3s ease, color 0.3s ease;
}
.contact-inner { text-align: center; padding: 75px 0; }
.contact h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; margin-bottom: 18px; color: var(--ink); }
@media(max-width: 480px) { .contact h2 { font-size: clamp(24px, 8vw, 32px); max-width: 320px; margin-left: auto; margin-right: auto; } }
.contact p { color: var(--ink-soft); max-width: 520px; margin: 0 auto 32px; font-size: 16px; line-height: 1.6; }
.contact .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--navy); font-weight: 700; }
.contact .btn-primary:hover { transform: translateY(-2px); background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: 0 10px 28px rgba(0,0,0,0.3); }
[data-theme="light"] .contact .btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
[data-theme="light"] .contact .btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--navy); box-shadow: 0 10px 28px rgba(21,23,28,0.12); }

footer { padding: 36px 0; border-top: 1px solid var(--line); }
.foot-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.foot-row .eyebrow { color: var(--ink-soft); }
.foot-links { display: flex; gap: 22px; font-size: 13px; color: var(--ink-soft); }
.foot-links a.admin-link { color: var(--line); }

/* CART DRAWER */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px);
  z-index: 90; opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.drawer-overlay.active { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; top: 0; right: -420px; width: 100%; max-width: 420px; height: 100vh; height: 100dvh;
  background: var(--paper); z-index: 100; box-shadow: -10px 0 30px rgba(0,0,0,0.15);
  display: flex; flex-direction: column; transition: right .3s ease;
}
.cart-drawer.active { right: 0; }
.drawer-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.drawer-head h3 { font-size: 20px; }
.drawer-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--ink); transition: color .15s ease, transform .15s ease; }
.drawer-close:hover, .drawer-close:active { color: var(--accent); transform: scale(1.08); }

.drawer-body { padding: 20px 24px; flex-grow: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: none; display: flex; flex-direction: column; gap: 16px; }
.cart-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.cart-item-info h4 { font-size: 15px; font-weight: 600; }
.cart-item-info span { font-size: 13px; color: var(--ink-soft); font-family: 'JetBrains Mono', monospace; }
.cart-item-stock { display: block; font-size: 11px; color: var(--accent); font-weight: 600; font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.cart-item-ctrl { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.qty-btn { width: 28px; height: 28px; border: 1px solid var(--ink); background: none; color: var(--ink); cursor: pointer; border-radius: 50%; font-weight: 700; transition: background .15s ease, color .15s ease; }
.qty-btn:hover, .qty-btn:active { background: var(--ink); color: var(--bg); }
.cart-remove-btn {
  width: 28px; height: 28px; border: 1px solid var(--line); background: none; cursor: pointer;
  border-radius: 50%; color: var(--ink-soft); font-size: 14px; transition: .18s ease;
  display: flex; align-items: center; justify-content: center;
}
.cart-remove-btn:hover, .cart-remove-btn:active { background: var(--danger); border-color: var(--danger); color: #FFF; }
.cart-empty { text-align: center; color: var(--ink-soft); margin-top: 40px; }
.cart-empty svg { width: 54px; margin: 0 auto 14px; opacity: .5; }

/* CHECKOUT FORM (внутри cart-drawer) */
.checkout-form { display: flex; flex-direction: column; gap: 18px; }
.cf-group { display: flex; flex-direction: column; gap: 6px; }
.cf-group label { font-size: 13px; font-weight: 600; }
.cf-group input[type="text"], .cf-group input[type="tel"], .cf-group textarea {
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 14px; background: var(--bg); color: var(--ink);
  resize: vertical;
}
.cf-group input:focus, .cf-group textarea:focus { outline: none; border-color: var(--ink); }
.cf-backorder-note {
  background: rgba(240, 178, 62, 0.12); border: 1px solid rgba(240, 178, 62, 0.35);
  border-radius: var(--radius); padding: 12px 14px; font-size: 13px; line-height: 1.5; color: var(--ink);
}
.cf-radio-list { display: flex; flex-direction: column; gap: 8px; }
.cf-radio {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: var(--radius); font-size: 13.5px; cursor: pointer; transition: border-color .18s ease;
}
.cf-radio:has(input:checked) { border-color: var(--ink); background: var(--paper); }
/* accent-color задаёт цвет "родного" переключателя браузера — но на части
   телефонов (особенно старый Android/iOS) он не поддерживается и вместо
   него показывается системный синий кружок, который не попадает в
   черно-золотую гамму сайта. Поэтому дополнительно рисуем переключатель
   полностью сами (appearance: none + точка через ::before) — тогда цвет
   везде гарантированно совпадает с сайтом, независимо от браузера. */
.cf-radio input {
  appearance: none; -webkit-appearance: none; accent-color: var(--ink);
  width: 18px; height: 18px; flex-shrink: 0; margin: 0; position: relative;
  border: 1.5px solid var(--ink-soft); border-radius: 50%; background: transparent;
  transition: border-color .15s ease;
}
.cf-radio input:checked { border-color: var(--ink); }
.cf-radio input:checked::before {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--ink);
}
.cf-radio-main { display: flex; flex-direction: column; gap: 2px; }
.cf-radio-title { font-weight: 600; color: var(--ink); }
.cf-radio-meta { font-size: 11.5px; color: var(--ink-soft); font-family: 'JetBrains Mono', monospace; }
.cf-error { color: var(--danger); font-size: 13px; min-height: 16px; }
.cf-actions { display: flex; gap: 10px; }

/* ORDER SUCCESS */
.order-success { text-align: center; margin-top: 30px; padding: 0 6px; }
.order-success-icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent-2); color: var(--cream);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
  margin: 0 auto 18px;
}
.order-success h4 { font-size: 19px; font-weight: 700; font-family: 'Inter', sans-serif; margin-bottom: 10px; }
.order-success p { color: var(--ink-soft); font-size: 14px; line-height: 1.55; }

.drawer-foot { padding: 20px 24px; border-top: 1px solid var(--line); background: var(--bg); }
.total-row { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; margin-bottom: 16px; font-family: 'JetBrains Mono', monospace; }

/* SCROLL REVEAL */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-premium), transform .7s var(--ease-premium); }
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

/* SKELETON LOADING */
.skel-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skel-media { aspect-ratio: 1/1; background: var(--line); }
.skel-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.skel-line { height: 12px; border-radius: 3px; background: var(--line); }
.skel-line.w60 { width: 60%; }
.skel-line.w80 { width: 80%; }
.skel-line.w40 { width: 40%; height: 20px; margin-top: 6px; }
.skel-media, .skel-line {
  position: relative; overflow: hidden;
  background: linear-gradient(90deg, var(--line) 25%, var(--shimmer) 50%, var(--line) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Пока заголовок/подзаголовок героя ещё не пришли с сервера — показываем
   мерцающую плашку на месте текста, а не слово "Загрузка…". Как только JS
   впишет реальный текст, элемент перестаёт быть :empty и заглушка исчезает
   сама — без лишнего кода на стороне JS. */
#heroTitle:empty {
  display: block; width: min(90%, 620px); height: 4.6em; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--line) 25%, var(--shimmer) 50%, var(--line) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
#heroSub:empty {
  display: block; width: min(70%, 440px); height: 4.4em; margin-bottom: 34px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--line) 25%, var(--shimmer) 50%, var(--line) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}

/* ================================================================
   QUICK VIEW MODAL — Desktop-first premium layout
   ─ Фото НИКОГДА не меняет размер от длины текста.
   ─ Ключевой фикс: min-height:0 / min-width:0 на grid-детях —
     без этого overflow:hidden в grid-ячейках не работает и
     ячейка растягивается под контент вместо обрезки.
   ================================================================ */
.quick-view {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.94);
  /* Десктоп: фиксированная высота окна — от неё напрямую зависит
     размер квадратного фото слева (flex-basis ниже равен ТОЙ ЖЕ
     формуле, поэтому ширина фото = высоте окна и рамка .qv-media
     всегда строго квадратная, без "воздуха"). Окно шире, а квадрат
     фото — умеренного размера (500px), чтобы текстовой колонке
     оставалось много места и она не выглядела зажатой. */
  width: min(1040px, calc(100vw - 48px));
  height: min(500px, 82vh);
  height: min(500px, 82dvh);
  /* overflow:hidden блокирует выход flex-детей ЗА рамку окна */
  overflow: hidden;
  background: var(--paper);
  border-radius: 20px;
  z-index: 101;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.04),
    0 8px 24px rgba(0,0,0,0.12),
    0 30px 80px rgba(0,0,0,0.28);
  /* Flexbox вместо grid: фото — фиксированная квадратная колонка
     (flex-basis = высоте окна), текст — гибкая колонка, которая
     скроллится сама, не раздувая контейнер (в отличие от grid
     auto-track, здесь ширина/высота фото не зависит от контента
     текста вообще). */
  display: flex;
  align-items: stretch;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s cubic-bezier(.34,1.3,.64,1);
}
.quick-view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* ── Мобильный вид (стопка: фото сверху, текст снизу со скроллом) ── */
@media(max-width: 700px) {
  .quick-view {
    flex-direction: column;
    width: calc(100% - 20px);
    height: 92vh;
    height: 92dvh;
    border-radius: 16px;
  }
}

/* ── Левая панель: фото ──
   Десктоп: flex-basis в точности равен высоте окна — значит
   ширина колонки = высоте, и с object-fit:cover получаем
   идеальный квадрат без пустот сверху/снизу.
   Мобильный: колонка на всю ширину, а высота — через aspect-ratio
   1:1 (тоже строгий квадрат, теперь по ширине). */
.qv-media {
  /* min-height:0 — ключевой фикс: без него flex-ячейка
     растягивается под контент, игнорируя overflow:hidden */
  min-height: 0;
  min-width: 0;
  flex: 0 0 min(500px, 82vh);
  flex: 0 0 min(500px, 82dvh);
  overflow: hidden;
  position: relative;
  background: var(--bg);
  display: flex;
  align-items: stretch;
  justify-content: center;
  border-right: 1px solid var(--line);
  border-radius: 20px 0 0 20px;
}
.qv-media .gallery { height: 100%; width: 100%; }
@media(max-width: 700px) {
  .qv-media {
    /* На мобильном квадрат берёт ширину модалки — фото на всю ширину,
       высота считается через aspect-ratio, а не flex-basis */
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-right: none;
    border-bottom: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
  }
  .qv-media::after { height: 50px; }
}
/* cover — фото заполняет строго квадратную рамку без полос сверху/снизу.
   Рамка теперь всегда квадратная, поэтому cover не "тянет" и не
   искажает фото — просто аккуратно кадрирует по центру. */
.qv-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qv-media svg { width: 46%; }

/* ── Правая панель: текст (только она скроллится) ── */
.qv-info {
  /* min-height:0 — ключевой фикс: без него flex-элемент не может
     сжаться меньше высоты своего контента (и не будет скроллиться,
     а раздует всё окно). Высота больше не 100% (это ломало бы
     мобильную колонку, где фото уже занимает часть высоты) —
     flex:1 сам вычисляет оставшееся место и на десктопе (stretch
     по кросс-оси), и на мобильном (рост/сжатие по главной оси). */
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Кастомный тонкий скроллбар */
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding: 32px 30px 28px;
  display: flex;
  flex-direction: column;
}
.qv-info::-webkit-scrollbar { width: 4px; }
.qv-info::-webkit-scrollbar-track { background: transparent; }
.qv-info::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* Вертикальное центрирование когда текст короткий;
   при длинном тексте margin:auto схлопывается сам */
.qv-info-inner { margin: auto 0; width: 100%; }

@media(max-width: 700px) { .qv-info { padding: 20px 18px 24px; } }

/* Типографика правой панели */
.qv-info .eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.qv-info h3 {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  line-height: 1.25;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
@media(min-width: 701px) {
  .qv-info h3 { font-size: 20px; }
}
.qv-desc {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 20px;
}

/* Разделитель перед ценой */
.qv-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0 0 16px;
  opacity: 0.6;
}

.qv-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.qv-stock { font-size: 12px; font-weight: 600; color: var(--accent-2); margin-bottom: 18px; }
.qv-stock-out { color: var(--accent); }
.qv-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 5px 8px;
}
.qty-stepper .qty-btn { border: none; }
.qty-stepper span {
  min-width: 20px;
  text-align: center;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  /* Cache updated to v=1786700200 */
}
.qv-call { align-self: flex-start; }

/* ── Кнопка закрытия: работает на любом фоне (тёмная / светлая тема) ── */
.qv-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  /* Полупрозрачный тёмный фон — читается поверх любого фото
     и в тёмной, и в светлой теме */
  background: var(--paper);
  color: var(--ink);
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}
.qv-close:hover, .qv-close:active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: scale(1.08);
}

/* TOAST */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--ink); color: var(--bg); padding: 12px 24px; border-radius: 30px;
  font-size: 14px; font-weight: 600; z-index: 2000; box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  transition: transform .3s ease; pointer-events: none; border: 1px solid var(--accent);
}
.toast.active { transform: translateX(-50%) translateY(0); }

/* ===================== АДМИН-ПАНЕЛЬ (admin.html) ===================== */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar {
  background: var(--navy); color: var(--cream); padding: 16px 28px;
  display: flex; justify-content: space-between; align-items: center;
}
.admin-topbar h1 { font-size: 18px; color: var(--accent); }
.admin-topbar .logo-mini { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: 0.02em; text-transform: uppercase; }
.admin-topbar .logo-mini span { color: var(--accent); }

.login-screen {
  flex-grow: 1; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 34px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.login-card h2 { margin-bottom: 8px; font-size: 22px; }
.login-card p { color: var(--ink-soft); font-size: 14px; margin-bottom: 20px; }
.login-error { color: var(--danger); font-size: 13.5px; margin-top: 10px; min-height: 18px; }

.admin-tabs { display: flex; background: var(--navy); padding: 0 24px; overflow-x: auto; }
.tab-btn {
  background: transparent; color: var(--cream); opacity: 0.65; border: none; padding: 14px 20px;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; position: relative;
}
.tab-btn.active { color: var(--accent); opacity: 1; border-bottom-color: var(--accent); }
.tab-badge {
  display: inline-block; background: var(--danger); color: #FFF; font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: middle;
}

.admin-body { padding: 28px; flex-grow: 1; max-width: 1000px; margin: 0 auto; width: 100%; }
.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 14px; background: var(--bg);
}
.form-control:focus { border-color: var(--ink); outline: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { background: var(--paper); font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.img-preview {
  width: 130px; height: 130px; border: 1.5px dashed var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; overflow: hidden; margin-top: 10px;
  background: var(--bg); font-size: 12px; color: var(--ink-soft); text-align: center; padding: 6px;
  position: relative; cursor: pointer; transition: border-color .18s ease;
}
.img-preview:hover { border-color: var(--ink); }
.img-preview:focus-visible { outline-offset: 2px; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }

.photo-upload-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-soft);
  pointer-events: none;
}
.photo-upload-placeholder .icon { font-size: 24px; }

/* Круглая кнопка "+" — всегда видна: и чтобы добавить первое фото,
   и чтобы заменить уже загруженное. */
.photo-upload-add {
  position: absolute; bottom: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: var(--bg); border: 2px solid var(--paper); font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; cursor: pointer; line-height: 1; padding: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform .15s ease, background .15s ease, color .15s ease;
}
.photo-upload-add:hover { transform: scale(1.08); background: var(--accent); color: var(--navy); }

/* Кнопка-корзина — появляется только когда фото уже загружено. */
.photo-upload-remove {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--danger); color: #FFF; border: 2px solid var(--paper); font-size: 12.5px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; line-height: 1; padding: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform .15s ease, background .15s ease;
}
.photo-upload-remove:hover { transform: scale(1.08); background: #E5493C; }

.img-preview.uploading .photo-upload-add,
.img-preview.uploading .photo-upload-remove { opacity: .45; pointer-events: none; }
.photo-upload-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(18,19,22,0.55); color: #FFF; font-size: 11.5px; font-weight: 600;
}

/* Редактор фото товара (до 3 шт.) — ряд плиток + плитка "добавить". */
.img-gallery-editor { position: relative; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; min-height: 20px; }
.img-gallery-editor.uploading { pointer-events: none; }
.img-gallery-editor.uploading .img-tile,
.img-gallery-editor.uploading .img-tile-add { opacity: .45; }
.img-gallery-editor.uploading::after {
  content: 'Загрузка…'; position: absolute; top: -20px; left: 0; font-size: 12px; font-weight: 600; color: var(--ink-soft);
}

.img-tile {
  position: relative; width: 130px; height: 130px; border-radius: var(--radius); overflow: hidden;
  border: 1.5px solid var(--line); background: var(--bg); flex-shrink: 0;
}
.img-tile img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; }
.img-tile-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2; background: var(--accent); color: var(--navy);
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 999px;
}
.img-tile-reorder { position: absolute; bottom: 6px; left: 6px; display: flex; gap: 4px; z-index: 2; }
.img-tile-reorder button {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.img-tile-reorder button:disabled { opacity: .3; cursor: default; }
.img-tile-reorder button:not(:disabled):hover { background: var(--ink); color: var(--bg); }

.img-tile-add {
  width: 130px; height: 130px; flex-shrink: 0; border: 1.5px dashed var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg); color: var(--ink-soft); font-size: 12px; text-align: center; padding: 6px;
  cursor: pointer; transition: border-color .18s ease;
}
.img-tile-add:hover { border-color: var(--ink); }
.img-tile-add .icon { font-size: 24px; }

.hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }

.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
@media(max-width: 600px) { .admin-stats { grid-template-columns: 1fr; } }
.admin-stat-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--card-shadow); }
.admin-stat-card b { display: block; font-family: 'Oswald', sans-serif; font-size: 26px; color: var(--accent-2); }
.admin-stat-card span { font-size: 12.5px; color: var(--ink-soft); font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: .04em; }

.admin-search { position: relative; max-width: 280px; }
.admin-search input {
  width: 100%; padding: 9px 14px 9px 32px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 13.5px; background: var(--paper);
}
.admin-search input:focus { outline: none; border-color: var(--ink); }
.admin-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-size: 15px; }
.admin-empty { text-align: center; color: var(--ink-soft); padding: 30px 0; font-size: 14px; }

.stock-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
.stock-toggle-btn {
  flex: 1; min-width: 200px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink-soft); font-family: 'Inter', sans-serif; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all .18s ease; text-align: left;
}
.stock-toggle-btn.active { border-color: var(--ink); color: var(--ink); background: var(--paper); }
.stock-toggle-btn[data-stock="false"].active { border-color: var(--accent); color: var(--accent); }

.stock-pill {
  display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.stock-pill-in { background: rgba(127, 191, 116, 0.16); color: var(--accent-2); }
.stock-pill-out { background: rgba(240, 178, 62, 0.16); color: var(--accent); }

/* ЗАКАЗЫ (админка) */
.order-card {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px; transition: border-color .18s ease, opacity .18s ease;
  box-shadow: var(--card-shadow);
}
.order-card-done { opacity: 0.6; }
.order-card-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--line);
}
.order-card-head-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.order-delete-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink-soft); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .18s ease; flex-shrink: 0;
}
.order-delete-btn:hover { background: var(--danger); border-color: var(--danger); color: #FFF; transform: scale(1.05); }
.order-id { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px; }
.order-date { font-size: 12.5px; color: var(--ink-soft); font-family: 'JetBrains Mono', monospace; }
.order-flag {
  background: rgba(240, 178, 62, 0.16); color: var(--accent); font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; font-family: 'JetBrains Mono', monospace;
}
.order-customer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; font-size: 14.5px; }
.order-customer a { color: var(--accent-2); font-family: 'JetBrains Mono', monospace; font-size: 13.5px; }
.order-delivery { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 10px; }
.order-items { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 4px; }
.order-items li { font-size: 13.5px; }
.order-item-flag { color: var(--accent); font-size: 11px; font-weight: 700; }
.order-comment { font-size: 13px; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
.order-total { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 15px; }

/* ===================== МОБИЛЬНЫЕ ДОРАБОТКИ ===================== */

/* Пока открыта корзина / быстрый просмотр / мобильное меню — страница
   за ними не должна прокручиваться (иначе на телефоне палец "проваливается"
   сквозь затемнение и скроллит фон вместо самой панели). Класс вешается/
   снимается из site.js через updateBodyScrollLock(). */
body.scroll-locked { overflow: hidden; }

@media (max-width: 640px) {
  /* iOS Safari автоматически зумит всю страницу при фокусе на поле ввода,
     если его font-size меньше 16px. Возвращаем 16px только на мобильных
     ширинах, чтобы не менять вёрстку на десктопе. */
  .form-control,
  #loginPassword,
  .cf-group input[type="text"],
  .cf-group input[type="tel"],
  .cf-group textarea,
  .search-field input,
  .sort-select,
  .admin-search input,
  .checkout-form input,
  .checkout-form textarea {
    font-size: 16px;
  }

  /* Чуть увеличиваем самые мелкие тач-цели (шаговый счётчик и удаление
     из корзины) — 28px по гайдлайнам Apple/Google маловато для пальца. */
  .qty-btn, .cart-remove-btn { width: 34px; height: 34px; }
}

/* Таблица товаров в админке на узком экране: обычная таблица с 7 колонками
   туда просто не влезает — превращаем каждую строку в карточку, где
   подписи колонок берутся из data-label (задаётся в renderProductsTable). */
@media (max-width: 760px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr {
    border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px;
    padding: 10px 14px; box-shadow: var(--card-shadow);
  }
  .admin-table td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 7px 0; border-bottom: 1px dashed var(--line); text-align: right;
  }
  .admin-table td:last-child { border-bottom: none; }
  .admin-table td[data-label]::before {
    content: attr(data-label); font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
    color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; text-align: left; flex-shrink: 0;
  }
  .admin-table td.admin-empty { display: block; text-align: center; border: none; padding: 24px 0; }
}
