/* =====================================================================
   app.css — «СОЛОДЪ» веб-редизайн
   Utility-CSS в стиле tailwind, но без сборки.
   ===================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--tx);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, picture, video, svg { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: var(--acc); text-decoration: none; transition: color .15s; }
a:hover { color: var(--price); }
input, select, textarea, button { font-family: inherit; }

::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* Скрываем скроллбар у горизонтальных лент */
.hrow { scrollbar-width: none; -ms-overflow-style: none; }
.hrow::-webkit-scrollbar { display: none; }

/* ---------- Иконки Material Symbols ---------- */
.msr {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
  /* Для screen reader'ов: не читать имена лигатур ("add_shopping_cart" и т.п.). */
  speak: none;
}
/* Атрибут выставляем на JS (см. js/v2/app.js). */

/* ---------- Layout ---------- */
.container {
  width: 100%;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
@media (min-width: 1600px) {
  .container { padding-left: 48px; padding-right: 48px; }
}
@media (min-width: 2000px) {
  .container { padding-left: 72px; padding-right: 72px; }
}
.container-narrow {
  max-width: 640px;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.stack { display: flex; flex-direction: column; }
.row { display: flex; flex-direction: row; }
.grid { display: grid; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 auto; min-width: 0; }
.flex-none { flex: 0 0 auto; }
.gap-2 { gap: 6px; }
.gap-3 { gap: 10px; }
.gap-4 { gap: 14px; }
.gap-5 { gap: 18px; }
.gap-6 { gap: 22px; }
.gap-8 { gap: 30px; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-60 { z-index: 60; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.hidden { display: none !important; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.min-h-screen { min-height: 100vh; }

/* Утилиты видимости работают только на скрытие (display:none !important),
   а показ реализуется собственным display компонента. Так они не ломают
   flex-контейнеры и sticky-хедеры. */
.hide-mobile { display: none !important; }
.hide-mobile-flex { display: none !important; }
@media (min-width: 900px) {
  .hide-mobile { display: revert !important; }
  .hide-mobile-flex { display: revert !important; }
  .hide-desktop { display: none !important; }
  .hide-desktop-flex { display: none !important; }
}

/* ---------- Типографика ---------- */
h1, h2, h3, h4 { margin: 0; color: var(--tx); font-weight: 700; line-height: 1.15; }
h1 { font-size: var(--h1); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-2xs { font-size: 11px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 17px; }
.text-xl { font-size: 20px; }
.font-500 { font-weight: 500; }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.tracking-wide { letter-spacing: .04em; }
.tracking-wider { letter-spacing: .12em; }
.tracking-widest { letter-spacing: .18em; }
.tx { color: var(--tx); }
.tx2 { color: var(--tx2); }
.tx-acc { color: var(--acc); }
.tx-price { color: var(--price); }
.tx-ok { color: var(--ok); }
.tx-danger { color: var(--danger); }
.tx-outline { color: var(--outline); }
.leading-tight { line-height: 1.15; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.65; }

/* ---------- Surfaces ---------- */
.bg-page { background: var(--bg); }
.bg-s1 { background: var(--s1); }
.bg-s2 { background: var(--s2); }
.bg-s3 { background: var(--s3); }
.bg-s4 { background: var(--s4); }
.bg-acc { background: var(--acc); }
.border-line { border: 1px solid var(--line); }
.border-t-line { border-top: 1px solid var(--line); }
.border-b-line { border-bottom: 1px solid var(--line); }
.rounded { border-radius: var(--r); }
.rounded-md { border-radius: var(--r-md); }
.rounded-sm { border-radius: var(--r-sm); }
.rounded-pill { border-radius: var(--r-pill); }
.rounded-full { border-radius: 9999px; }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Плейсхолдеры-штриховка */
.stripe { background-image: var(--stripe); }
.stripe-acc { background-image: var(--stripe-acc); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .15s, border-color .15s, background .15s, transform .15s;
  background: transparent;
  color: var(--tx);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn-primary {
  background: var(--acc);
  color: var(--onacc);
}
.btn-primary:hover { color: var(--onacc); filter: brightness(1.08); }
.btn-secondary {
  background: var(--s4);
  color: var(--tx);
}
.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--tx);
}
.btn-outline:hover { border-color: var(--acc); }
.btn-ghost {
  background: transparent;
  color: var(--tx2);
}
.btn-ghost:hover { background: var(--s2); color: var(--tx); }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon {
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  color: var(--tx2);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  flex: 0 0 auto;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--s2); color: var(--tx); }
.btn-icon-cart { width: 52px; height: 52px; }
.btn-icon-cart .msr { font-size: 30px; }
.btn-icon-acc {
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--acc);
  color: var(--onacc);
}
.btn-icon-check {
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--s4);
  border-color: var(--acc);
  color: var(--acc);
}

/* ---------- Инпуты ---------- */
/* Единый сброс UA-стилей: убираем нативные рамки/тени/appearance у всех
   текстовых инпутов, чтобы не было «двойной рамки» поверх .field. */
input, textarea, select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-clip: padding-box;
}
.field {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--tx);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
/* Единое состояние фокуса: только смена цвета границы + мягкая подсветка,
   без нативного outline (он давал вторую рамку поверх border). */
.field:focus,
.field:focus-visible {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(199, 123, 84, .25);
}
.field::placeholder { color: var(--tx2); opacity: .8; }
.field-with-icon { padding-left: 42px; }
.field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tx2);
  font-size: 19px;
  pointer-events: none;
}

/* Убираем спиннеры у number */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Убираем нативный «крестик» у search + иконку лупы в WebKit */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* ---------- Чипы / пилюли ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx2);
  white-space: nowrap;
  transition: all .15s;
  cursor: pointer;
}
.chip:hover { border-color: var(--acc); color: var(--tx); }
.chip.is-active {
  background: var(--acc);
  color: var(--onacc);
  border-color: var(--acc);
}
.badge {
  display: inline-flex;
  align-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--acc);
  color: var(--onacc);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  justify-content: center;
}
.badge-pill {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--acc);
  color: var(--onacc);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}

/* ---------- Header ---------- */
.header-desktop {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(26, 18, 17, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-desktop-inner {
  width: 100%;
  padding: 14px var(--pad);
  display: flex;
  align-items: center;
  gap: 24px;
}
@media (min-width: 1600px) { .header-desktop-inner { padding-left: 48px; padding-right: 48px; } }
@media (min-width: 2000px) { .header-desktop-inner { padding-left: 72px; padding-right: 72px; } }
.header-search { width: 320px; max-width: 320px; flex: 0 0 320px; }
@media (min-width: 1600px) { .header-search { width: 380px; max-width: 380px; flex-basis: 380px; } }
.header-mobile {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(26, 18, 17, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
  color: var(--tx);
  text-decoration: none;
}
.brand-mark {
  display: block;
  height: 52px;
  width: auto;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-text {
  display: inline-flex;
  flex-direction: column;
}
.brand--mobile { gap: 10px; }
.brand--mobile .brand-mark { height: 40px; }
@media (min-width: 1600px) {
  .brand-mark { height: 60px; }
}
.brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--tx);
}
.brand-sub {
  font-size: 10px;
  color: var(--tx2);
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-top: 8px;
}
.brand--mobile .brand-name {
  font-size: 17px;
  letter-spacing: .05em;
}
.brand--mobile .brand-sub {
  font-size: 8px;
  letter-spacing: .16em;
  margin-top: 6px;
}
@media (min-width: 1600px) {
  .brand-name { font-size: 25px; }
  .brand-sub { font-size: 11px; }
}
.nav-link {
  position: relative;
  padding: 8px 4px;
  margin: 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tx2);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: .01em;
  transition: color .18s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: var(--acc);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
}
.nav-link:hover { color: var(--tx); }
.nav-link.is-active { color: var(--tx); }
.nav-link.is-active::after { transform: scaleX(1); }

/* ---------- Footer / mobile bottom nav ---------- */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 50px;
  background: var(--s1);
}
.footer-inner {
  width: 100%;
  padding: 36px var(--pad);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}
@media (min-width: 1600px) { .footer-inner { padding-left: 48px; padding-right: 48px; } }
@media (min-width: 2000px) { .footer-inner { padding-left: 72px; padding-right: 72px; } }
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr; padding: 28px 20px; }
  .footer { margin-bottom: 64px; }
}
.footer-legal {
  border-top: 1px solid var(--line);
  padding: 16px var(--pad);
  width: 100%;
  font-size: 11px;
  color: var(--tx2);
  opacity: .7;
  line-height: 1.6;
}
@media (min-width: 1600px) { .footer-legal { padding-left: 48px; padding-right: 48px; } }
@media (min-width: 2000px) { .footer-legal { padding-left: 72px; padding-right: 72px; } }
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 38;
  background: var(--s1);
  border-top: 1px solid var(--line);
  display: flex;
  height: 64px;
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--tx2);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
}
.bottom-nav a.is-active { color: var(--acc); }
.bottom-nav .msr { font-size: 24px; }
@media (min-width: 900px) { .bottom-nav { display: none; } }

/* ---------- Cards ---------- */
.card {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .15s, transform .15s;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  position: relative;
}
.card:hover { border-color: var(--acc); transform: translateY(-2px); }
.card-media {
  aspect-ratio: 3 / 4;
  background: var(--s2);
  background-image: var(--stripe);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35));
}
/* Для «плоских» товаров (наборы, торты) — заполняющий кроп поверх контейн-стилей. */
.card-media.is-cover { padding: 0; }
.card-media.is-cover img { object-fit: cover; filter: none; }
.card-media-placeholder {
  color: var(--tx2);
  opacity: .5;
  font-size: 12px;
  font-family: ui-monospace, monospace;
}
.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 6px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tx);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card-meta {
  font-size: 12px;
  color: var(--tx2);
}
.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.price {
  font-size: 18px;
  font-weight: 700;
  color: var(--price);
  line-height: 1;
}
.price-old {
  font-size: 12px;
  color: var(--tx2);
  text-decoration: line-through;
  margin-left: 4px;
}
.price-lg { font-size: 34px; }

.badge-corner {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--acc);
  color: var(--onacc);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge-corner-alt { background: var(--acc2); color: #fff; }

.stock-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--tx2);
}
.stock-line .msr { font-size: 15px; }

/* ---------- Hero (главная) ---------- */
.hero {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  height: var(--heroH);
  background: var(--s2);
  background-image: var(--stripe-acc);
  margin-top: var(--pad);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(26, 18, 17, .92) 0%, rgba(26, 18, 17, .55) 45%, rgba(26, 18, 17, .1) 100%);
}
.hero-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px var(--heroPad) 40px;
  max-width: 640px;
}
@media (min-width: 900px) {
  .hero-body { gap: 14px; padding: 0 var(--heroPad); justify-content: center; }
}
.hero-title {
  font-size: var(--heroTitle);
  font-weight: 700;
  color: var(--tx);
  line-height: 1.15;
}
@media (min-width: 900px) {
  .hero-title { line-height: 1.05; }
}
.hero-sub {
  font-size: var(--heroSub);
  color: var(--tx2);
  max-width: 440px;
  line-height: 1.4;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* CTA на баннере: компактно на моб, крупнее на десктопе */
.hero-cta {
  align-self: flex-start;
  padding: 10px 18px;
  font-size: 14px;
}
@media (min-width: 900px) {
  .hero-cta { padding: 15px 26px; font-size: 16px; }
}

/* ---------- Hero carousel (несколько баннеров) ---------- */
.hero-carousel {
  position: relative;
  margin-top: var(--pad);
}
.hero-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  border-radius: var(--r);
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-carousel .hero-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  margin-top: 0;
}

.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 3;
}
.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(237, 224, 219, .35);
  cursor: pointer;
  transition: background .2s, width .2s;
}
.hero-dot:hover { background: rgba(237, 224, 219, .6); }
.hero-dot.is-active {
  background: var(--acc);
  width: 18px;
  border-radius: 3px;
}
@media (min-width: 900px) {
  .hero-dot { width: 24px; height: 4px; border-radius: 2px; }
  .hero-dot.is-active { width: 36px; border-radius: 2px; }
}

/* Стрелки prev/next (только десктоп) */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(237, 224, 219, .25);
  background: rgba(26, 18, 17, .55);
  color: var(--tx);
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background .15s, border-color .15s;
}
.hero-arrow:hover {
  background: rgba(26, 18, 17, .85);
  border-color: var(--acc);
  color: var(--acc);
}
.hero-arrow .msr { font-size: 26px; }
.hero-arrow--prev { left: 14px; }
.hero-arrow--next { right: 14px; }
@media (min-width: 900px) {
  .hero-arrow { display: inline-flex; }
  /* Освобождаем место слева/справа под стрелки, чтобы текст не наезжал */
  .hero-carousel .hero-body {
    padding-left: calc(var(--heroPad) + 56px);
    padding-right: calc(var(--heroPad) + 56px);
    max-width: 720px;
  }
}

/* Мини-лейбл над заголовком баннера — тонкий, без «капсулы» */
.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--acc);
  font-weight: 600;
  opacity: .9;
}
@media (min-width: 900px) {
  .hero-eyebrow { font-size: 13px; }
}

/* ---------- Категории на главной ----------
   Тот же .cat-tile, что и в каталоге, но со своей сеткой:
   максимум 6 в ряд на десктопе, ужимаемся до 4, 3, 2. */
.home-cats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 600px)  { .home-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px)  { .home-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1400px) { .home-cats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; } }

/* ---------- Списки товаров на главной ----------
   Мобильно (<900px): две секции стеком, каждая — горизонтальный скролл.
   Десктоп (≥900px): секции в одну строку, внутри auto-fill грид карточек. */
.home-lists {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.home-list-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.home-list-track::-webkit-scrollbar { display: none; }
.home-list-track > .card {
  flex: 0 0 220px;
  scroll-snap-align: start;
}
@media (min-width: 900px) {
  .home-list-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    overflow: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
  }
  .home-list-track > .card { flex: none; }
}
/* Очень широкий десктоп: Новинки и Хиты плечом к плечу, внутри каждой — 4 в ряд.
   Итого до 8 карточек товаров в одной строке главной. */
@media (min-width: 1400px) {
  .home-lists {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
  }
  .home-list-track { gap: 14px; }
}

/* ---------- Category hero (в листинге) ---------- */
.cat-hero {
  position: relative;
  height: var(--catHeroH);
  background: var(--s2);
  background-image: var(--stripe-acc);
  display: flex;
  align-items: flex-end;
}
.cat-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 18, 17, .96), rgba(26, 18, 17, .35));
}
.cat-hero-body {
  position: relative;
  width: 100%;
  padding: 0 var(--pad) 20px;
}
@media (min-width: 1600px) { .cat-hero-body { padding-left: 48px; padding-right: 48px; } }
@media (min-width: 2000px) { .cat-hero-body { padding-left: 72px; padding-right: 72px; } }

/* ---------- Category tile (сетка каталога и главной) ----------
   Картинки категорий — PNG без фона (см. remove_bg_category_images).
   Поэтому object-fit: contain + воздух по краям + drop-shadow. */
.cat-tile {
  cursor: pointer;
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
  background: var(--s2);
  transition: border-color .15s;
  display: block;
  color: inherit;
  text-decoration: none;
}
.cat-tile:hover { border-color: var(--acc); color: inherit; }
.cat-tile-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 18px 18px 64px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .45));
}
.cat-tile-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26, 18, 17, .95) 0%, rgba(26, 18, 17, .2) 55%, transparent 100%);
}
.cat-tile-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px;
}
.cat-tile-title { font-size: 17px; font-weight: 700; color: var(--tx); }
.cat-tile-count { font-size: 12px; color: var(--tx2); margin-top: 3px; }

/* ---------- Grids ----------
   min-width: 0 нужен на flex/grid-детях, иначе длинный контент (например,
   не переносимое название товара) распирает колонку и весь грид. */
.grid-catalog { display: grid; grid-template-columns: var(--catCols); gap: 14px; }
.grid-products { display: grid; grid-template-columns: var(--prodCols); gap: 14px; }
.grid-listing { display: grid; grid-template-columns: var(--listCols); gap: 24px; align-items: start; }
.grid-product-detail { display: grid; grid-template-columns: var(--pdCols); gap: var(--pdGap); align-items: start; }
.grid-catalog > *,
.grid-products > *,
.grid-listing > *,
.grid-product-detail > * { min-width: 0; }

/* ---------- Sticky filters sidebar ---------- */
.filters-side {
  position: sticky;
  top: 92px;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
}
@media (max-width: 899px) { .filters-side { display: none; } }

/* ---------- Filter panel ---------- */
.filter-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-group {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.filter-group:first-of-type { border-top: 0; padding-top: 4px; }
.filter-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--tx);
}
.check-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border: 1px solid var(--outline);
  border-radius: 6px;
  background: transparent;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: all .15s;
}
.check-row input[type="checkbox"]:checked {
  background: var(--acc);
  border-color: var(--acc);
}
.check-row input[type="checkbox"]:checked::after {
  content: "";
  width: 12px; height: 6px;
  border-left: 2px solid var(--onacc);
  border-bottom: 2px solid var(--onacc);
  transform: rotate(-45deg) translate(1px, -1px);
}
.check-row .count { color: var(--tx2); font-size: 12px; margin-left: auto; }
.check-row.is-zero { opacity: .4; }
.check-row.is-zero .count { color: var(--tx2); }

/* ---------- Range slider (двухручковый) ---------- */
.range-slider {
  position: relative;
  height: 32px;
  margin-top: 8px;
}
.range-slider .range-track {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 4px; background: var(--s3); border-radius: 4px;
  transform: translateY(-50%);
}
.range-slider .range-fill {
  position: absolute; top: 50%;
  height: 4px; background: var(--acc); border-radius: 4px;
  transform: translateY(-50%);
}
.range-slider input[type="range"] {
  position: absolute; left: 0; right: 0; top: 0;
  width: 100%; height: 32px;
  background: none; pointer-events: none;
  -webkit-appearance: none; appearance: none;
  margin: 0;
}
.range-slider input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 32px; }
.range-slider input[type="range"]::-moz-range-track { background: transparent; height: 32px; }
.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--acc); border: 2px solid var(--onacc);
  cursor: pointer; pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  margin-top: 6px;
}
.range-slider input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--acc); border: 2px solid var(--onacc);
  cursor: pointer; pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px; height: 24px;
  flex: 0 0 auto;
}
.switch input {
  opacity: 0;
  width: 0; height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--s4);
  border-radius: 24px;
  transition: .2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 20px; width: 20px;
  left: 2px; bottom: 2px;
  background: var(--tx);
  border-radius: 50%;
  transition: .2s;
}
.switch input:checked + .switch-slider { background: var(--acc); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); background: var(--onacc); }

.range-inputs { display: flex; gap: 8px; }
.range-inputs .field { padding: 10px 12px; }

/* ---------- Drawer / Modal ---------- */
.overlay-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--overlay);
  animation: fadeIn .15s ease;
}
.drawer-right {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 420px;
  max-width: 100%;
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  animation: slideInRight .22s ease;
  box-shadow: var(--shadow-lg);
}
.sheet-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 86vh;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: sheetUp .24s ease;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 899px) {
  .drawer-right { right: 0; left: 0; top: auto; bottom: 0; width: auto; max-height: 86vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; animation: sheetUp .24s ease; }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-title { font-size: 19px; font-weight: 700; color: var(--tx); }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }

/* Sort dropdown */
.sort-dropdown {
  position: absolute;
  top: 50px;
  left: 0;
  z-index: 20;
  background: var(--s3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  min-width: 200px;
  max-width: calc(100vw - 24px);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 900px) {
  .sort-dropdown { left: auto; right: 0; min-width: 220px; max-width: none; }
}
.sort-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--tx);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.sort-option:hover { background: var(--s4); color: var(--tx); }
.sort-option.is-active .msr { color: var(--acc); }

/* ---------- Cart drawer specifics ---------- */
.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}
.cart-item + .cart-item { border-top: 1px solid var(--line); }
.cart-item-img {
  flex: 0 0 72px;
  height: 84px;
  border-radius: 10px;
  background: var(--s1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cart-item-name { text-decoration: none; line-height: 1.3; }
.cart-item-name:hover { color: var(--acc); }
.cart-item-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
@media (max-width: 599px) {
  .cart-item-right { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
}
.qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--s4);
  color: var(--tx);
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qty-btn.plus { background: var(--acc); color: var(--onacc); }
.qty-btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.qty-btn-danger:hover { background: var(--s3); }
.qty-val { font-size: 14px; font-weight: 700; min-width: 16px; text-align: center; }

/* Регулировка количества в списке товаров чекаута */
.cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cart-qty form { display: inline-flex; }

/* ---------- Sticky mobile add-bar ---------- */
.pd-sticky {
  position: fixed;
  left: 0; right: 0;
  bottom: 64px;
  z-index: 35;
  background: var(--s3);
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
@media (min-width: 900px) { .pd-sticky { display: none; } }

/* ---------- 18+ modal ---------- */
.age-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.age-modal {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

/* ---------- Product detail ---------- */
/* Медиа-контейнер деталки: квадрат, тинт задаётся инлайн через drink_tint_media. */
.pd-media {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pd-media-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .45));
}

.pd-brand {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: .12em;
  text-decoration: none;
}
.pd-brand:hover { color: var(--tx); }
.pd-catlink {
  font-size: 13px;
  font-weight: 600;
  color: var(--acc);
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
}
.pd-catlink:hover { filter: brightness(1.1); }
.pd-title {
  font-size: var(--pdTitle);
  font-weight: 700;
  color: var(--tx);
  line-height: 1.1;
  margin: 4px 0 0;
}

.stock-line-lg { font-size: 14px; }
.stock-line-lg .msr { font-size: 18px; }

/* Чипы характеристик под ценой. */
.spec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.spec-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--s3);
  border: 1px solid var(--line);
  color: var(--tx);
  font-size: 13px;
  font-weight: 600;
}
.spec-chip .msr {
  font-size: 16px;
  color: var(--acc);
}

.pd-section { margin-top: 4px; }
.pd-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--tx);
  margin: 0 0 12px;
}
.pd-description {
  font-size: 15px;
  line-height: 1.65;
  color: var(--tx2);
}
.pd-description p { margin: 0 0 10px; }
.pd-description p:last-child { margin-bottom: 0; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--tx2);
  font-size: 13px;
  margin: 12px 0 20px;
}
.breadcrumbs a { color: var(--tx2); }
.breadcrumbs a:hover { color: var(--tx); }
.breadcrumbs .sep { opacity: .5; }
.breadcrumbs .current { color: var(--tx); }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  gap: 6px;
  margin-top: 24px;
  justify-content: center;
}
.pagination a, .pagination span {
  min-width: 40px; height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--s2);
  border: 1px solid var(--line);
  color: var(--tx2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.pagination a:hover { border-color: var(--acc); color: var(--tx); }
.pagination .current { background: var(--acc); color: var(--onacc); border-color: var(--acc); }

/* ---------- Utilities ---------- */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-3-4 { aspect-ratio: 3 / 4; }

/* HTMX indicators */
.htmx-indicator {
  opacity: 0;
  transition: opacity .2s ease-in;
}
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Focus для навигации с клавиатуры — только для не-форм-элементов.
   У инпутов/textarea/select своё focus-состояние (см. .field:focus), иначе
   получается двойная рамка: border от .field + outline от focus-visible. */
*:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible { outline: none; }

/* Скролл-паддинг под мобильный тап-бар */
@media (max-width: 899px) {
  body { padding-bottom: 64px; }
}

/* ---------- Формы: контактные поля v2 ---------- */
.form-control,
.address-form-control {
  width: 100%;
  padding: 10px 12px;
  background: var(--s1);
  color: var(--tx);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.3;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-control::placeholder,
.address-form-control::placeholder { color: var(--tx2); opacity: .8; }
.form-control:hover,
.address-form-control:hover { border-color: var(--outline); }
.form-control:focus,
.address-form-control:focus {
  outline: none;
  border-color: var(--acc);
  background: var(--s2);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--acc) 20%, transparent);
}
textarea.form-control { min-height: 96px; resize: vertical; }

/* Убираем белый фон автозаполнения Chrome/WebKit в тёмных инпутах */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active,
.address-form-control:-webkit-autofill,
.address-form-control:-webkit-autofill:hover,
.address-form-control:-webkit-autofill:focus,
.address-form-control:-webkit-autofill:active {
  -webkit-box-shadow: inset 0 0 0 1000px var(--s1);
  -webkit-text-fill-color: var(--tx);
  caret-color: var(--tx);
  border-radius: 10px;
  transition: background-color 9999s ease-in-out 0s;
}

/* Дата в самовывозе — крупнее и с иконкой календаря WebKit */
input.form-control[type="date"] { padding-right: 12px; }
input.form-control[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(var(--calendar-icon-invert, 0));
}
@media (prefers-color-scheme: dark) { :root { --calendar-icon-invert: 1; } }

/* Мобильная адаптация плитки товара в чекауте */
@media (max-width: 599px) {
  .cart-item { align-items: flex-start; gap: 10px; }
  .cart-item-img { flex: 0 0 64px; height: 76px; }
  .cart-item .flex-1 { min-width: 0; }
  .cart-item-name {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .cart-item-right { flex-direction: column; align-items: flex-end; gap: 8px; }
  .cart-item-right .price { font-size: 15px; white-space: nowrap; }
}

/* ---------- Checkout: сетка форма + сводка ---------- */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
.checkout-form { min-width: 0; }
.checkout-summary { min-width: 0; }
/* Кнопка «Оформить заказ» не растягивается на всю ширину */
.checkout-submit { width: 100%; }
@media (min-width: 900px) {
  .checkout-submit { width: auto; align-self: flex-start; min-width: 260px; }
}

@media (min-width: 900px) {
  .checkout-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
  /* Слева — форма, справа — сводка */
  .checkout-form    { grid-column: 1; grid-row: 1; }
  .checkout-summary { grid-column: 2; grid-row: 1; position: sticky; top: 84px; }
}
