/* KRISTAL SHOP — минималистичный светлый стиль по шаблонам:
   много воздуха, чёрно-белая база, неоновый голубой акцент, чёрные кнопки. */

:root {
  --ink: #141414;
  --ink-soft: #555;
  --muted: #8a8a86;
  --paper: #ffffff;
  --bg: #f6f6f4;
  --card-bg: #f1f1ee;
  --line: #e6e6e2;
  --accent: #D20408;
  --danger: #b3402e;
  --ok: #2e7d4f;
  --radius: 10px;
  --header-h: 64px;
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* Чтобы появление вертикального скролла не сдвигало баннер влево-вправо */
  scrollbar-gutter: stable;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  /* Место под шапку сразу, до JS — иначе hero «прыгает» вниз */
  min-height: calc(var(--header-h) + 1px);
}
.header-inner {
  display: flex; align-items: center; gap: 16px 20px;
  height: var(--header-h);
}
.logo {
  display: flex; align-items: center;
  flex-shrink: 0; margin-right: auto;
  line-height: 0;
}
.logo-img {
  display: block;
  height: 34px;
  width: auto;
  max-width: min(220px, 48vw);
}
.main-nav {
  display: flex; align-items: center; gap: 28px; flex-shrink: 0;
}
.main-nav > a {
  position: relative;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); padding: 6px 0; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.main-nav > a:hover,
.main-nav > a.active { color: var(--ink); border-color: var(--accent); }
.main-nav > a.cart-link {
  border-bottom-color: transparent;
  padding-right: 12px;
}
.cart-link__text {
  display: inline-block;
  padding-bottom: 6px;
  margin-bottom: -6px;
  border-bottom: 2px solid transparent;
}
.cart-link:hover .cart-link__text,
.cart-link.active .cart-link__text {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.cart-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--ink); color: #fff;
  font-size: .66rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  min-width: 17px; height: 17px; border-radius: 999px;
  display: inline-grid; place-items: center;
  padding: 0 5px;
  line-height: 1;
  box-sizing: border-box;
}
.cart-badge.is-empty { background: var(--ink); }
.cart-badge.has-items { background: var(--accent); color: #fff; }

.header-actions {
  display: flex; align-items: center; gap: 28px; font-size: .9rem; flex-shrink: 0;
  margin-left: 8px;
}
.header-actions__link {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); padding: 6px 0; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.header-actions__link:hover,
.header-actions__link.active { color: var(--ink); border-color: var(--accent); }

.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 8px;
  margin-left: 6px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); flex-shrink: 0;
}
.nav-burger span {
  display: block; height: 2px; width: 100%;
  background: var(--ink); border-radius: 1px;
  transition: transform .2s, opacity .2s;
}
.nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-drawer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 12px 0 16px;
}
.nav-drawer[hidden] { display: none !important; }
.nav-drawer__inner {
  display: flex; flex-direction: column; gap: 4px;
}
.nav-drawer__inner a {
  display: block; padding: 12px 0;
  font-size: .9rem; font-weight: 600;
  color: var(--ink-soft); border-bottom: 1px solid var(--line);
}
.nav-drawer__inner a:last-child { border-bottom: none; }
.nav-drawer__inner a:hover,
.nav-drawer__inner a.active { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  border-bottom: 2px solid var(--accent);
  padding: 11px 26px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: #333; border-color: #333; border-bottom-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.btn-outline {
  background: transparent; color: var(--ink);
  border-color: var(--ink); border-bottom-color: var(--accent);
}
.btn.btn-outline:hover {
  background: var(--ink); color: #fff;
  border-color: var(--ink); border-bottom-color: var(--accent);
}
.btn.btn-small { padding: 8px 18px; font-size: .74rem; }
.btn.btn-danger {
  background: var(--danger); border-color: var(--danger);
  border-bottom-color: var(--accent);
}
.btn.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 84px 0 88px; text-align: center;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.01em; }
.hero p { color: var(--ink-soft); max-width: 520px; margin: 14px auto 30px; }
.hero .crumbs { margin-top: 26px; }
.crumbs { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }

/* Catalog page banner — same mega title position/size as home SHOP */
.hero-catalog {
  position: relative;
  overflow: hidden;
  min-height: clamp(180px, 24vw, 280px);
  padding: 0;
  text-align: left;
  border-bottom: none;
  background: #eef1f4;
}
.hero-catalog__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right 78%;
}
.hero-catalog__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.22) 0%, rgba(0,0,0,.1) 42%, transparent 72%),
    linear-gradient(180deg, rgba(0,0,0,.06) 0%, rgba(0,0,0,.16) 100%);
}
.hero-catalog__stage {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 0 clamp(12px, 2.2vw, 28px);
  pointer-events: none;
  overflow: visible;
  line-height: 0;
}
.hero-catalog__mega {
  display: block;
  margin: 0;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
  font-size: var(--mega-title-size, 16vw);
  font-weight: 800;
  line-height: .78;
  letter-spacing: -.06em;
  color: #fff;
  text-transform: uppercase;
  transform: translateY(0.04em);
  opacity: 0;
}
.hero-catalog__mega.is-fit {
  opacity: 1;
  transition: opacity .35s ease;
}
.hero-catalog + .section {
  position: relative;
  z-index: 2;
  background: var(--paper);
  /* как home-strip под SHOP: полукруглая «полка» */
  border-radius: 22px 22px 0 0;
  margin-top: -10px;
  box-shadow: 0 -8px 28px rgba(0,0,0,.04);
}

/* Home hero — Stuffus-style: mega title fills the banner width */
.hero-home {
  position: relative;
  overflow: hidden;
  /* Ниже «на весь экран»: компактное окно под SHOP */
  min-height: clamp(200px, 28vw, 380px);
  padding: 0;
  text-align: left;
  background: #eef0f3;
  border-bottom: none;
}
.hero-home__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.12);
}
/* Плавный «выезд» внутри окна баннера */
html.motion-on .hero-home__media {
  will-change: transform;
  animation: hero-ken 5.5s cubic-bezier(.16, .75, .18, 1) both;
}
.hero-home::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.22) 55%, rgba(0,0,0,.38) 100%),
    linear-gradient(90deg, rgba(0,0,0,.18) 0%, transparent 45%);
}
.hero-home__stage {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 0 clamp(12px, 2.2vw, 28px);
  pointer-events: none;
  overflow: hidden;
  line-height: 0;
}
.hero-home__mega {
  display: block;
  margin: 0;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
  font-size: var(--mega-title-size, 20vw);
  font-weight: 800;
  line-height: .85;
  letter-spacing: -.06em;
  color: #fff;
  text-transform: uppercase;
}
html.motion-on .hero-home__mega {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  transition: opacity .85s ease, transform .85s ease;
}
html.motion-on .hero-home__mega.is-fit {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Narrow transition panel under hero (like Stuffus search strip) */
.home-strip {
  position: relative;
  z-index: 2;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  margin-top: -10px;
  padding: 20px 0;
  box-shadow: 0 -8px 28px rgba(0,0,0,.04);
}
html.motion-on .home-strip {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity .7s ease .05s, transform .7s ease .05s;
}
html.motion-on .home-strip.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.home-strip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  flex-wrap: wrap;
}
.home-strip__lead {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}
.home-strip__search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 280px;
  max-width: 480px;
  margin-left: auto;
}
.home-strip__search input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.home-strip__search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

@keyframes hero-ken {
  0%   { transform: scale(1.18) translate3d(3%, 0, 0); }
  100% { transform: scale(1) translate3d(0, 0, 0); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (max-width: 720px) {
  .hero-home__media { object-position: 68% center; }
  .home-strip { border-radius: 18px 18px 0 0; margin-top: -8px; padding: 16px 0; }
  .home-strip__search { max-width: none; margin-left: 0; width: 100%; }
  .hero-catalog + .section { border-radius: 18px 18px 0 0; margin-top: -8px; }
}

/* ---------- Product grid ---------- */
.section { padding: 56px 0; }
/* Главная: меньше воздуха между поиском и «Топ / Новинки» */
.home-strip + .section {
  padding-top: 20px;
  padding-bottom: 48px;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 28px;
}
html.motion-on .section-title {
  animation: fade-up .75s ease both;
}
/* accent-line: под заголовками секций */
.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin-top: 12px;
  background: var(--accent);
}

.home-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.home-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0 0 12px;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.home-tab:hover { color: var(--ink); }
.home-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
html.motion-on .home-tabs {
  animation: fade-up .75s ease both;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }

.product-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .22s ease, transform .22s ease;
}
html.motion-on .product-card {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity .55s ease,
    transform .55s ease,
    box-shadow .22s ease;
}
html.motion-on .product-card.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.product-card:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  transform: translate3d(0, -4px, 0);
}
.product-image {
  /* Фото WB: 900×1200 → 3:4, без обрезки */
  aspect-ratio: 3 / 4; background: var(--card-bg);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.product-image img { width: 100%; height: 100%; object-fit: contain; }
.product-image .no-image { color: var(--muted); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.product-info { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-name { font-size: .95rem; font-weight: 600; line-height: 1.35; }
.product-name a:hover { color: var(--ink); }
.product-price { font-weight: 800; font-size: 1.05rem; }
.product-actions { margin-top: auto; display: flex; gap: 10px; padding-top: 8px; }
.stock-note { font-size: .78rem; color: var(--muted); }
.stock-note.out { color: var(--danger); }

.badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 4px;
}

/* ---------- Catalog layout (WB-style bar + infinite scroll) ---------- */
.catalog-section { padding-top: 28px; }
.catalog-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.catalog-heading__title {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -.01em;
}
/* accent-line: под заголовком каталога */
.catalog-heading__title::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin-top: 10px;
  background: var(--accent);
}
.catalog-heading__count {
  color: var(--muted);
  font-size: .95rem;
}

.catalog-bar {
  position: sticky;
  top: 64px;
  z-index: 30;
  margin-bottom: 22px;
  padding: 10px 0;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
}
.catalog-bar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.catalog-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 500;
}
.catalog-chip__ico { opacity: .55; font-size: .85rem; }
.catalog-chip__chev { opacity: .45; font-size: .75rem; margin-left: 2px; }
.catalog-chip--select {
  padding-right: 10px;
}
.catalog-chip--select select {
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  outline: none;
  max-width: 160px;
  cursor: pointer;
}
.catalog-chip--btn {
  cursor: pointer;
  max-width: min(280px, 70vw);
}
.catalog-chip--btn #cat-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-chip--btn[aria-expanded="true"] {
  border-color: var(--accent);
  background: #fff;
}

.catalog-cat { position: relative; }
.catalog-cat__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: min(320px, 88vw);
  max-height: min(420px, 60vh);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.12);
  padding: 8px;
}
.catalog-cat__back,
.catalog-cat__list button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: .92rem;
  cursor: pointer;
}
.catalog-cat__back:hover,
.catalog-cat__list button:hover {
  background: var(--bg);
  color: var(--ink);
}
.catalog-cat__back.is-active,
.catalog-cat__list button.is-active {
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--ink);
  font-weight: 600;
}
.catalog-cat__list { list-style: none; margin: 0; padding: 0; }
.catalog-cat__empty {
  padding: 14px;
  color: var(--muted);
  font-size: .9rem;
}

.catalog-search {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  flex: 1 1 180px;
  max-width: 320px;
}
.catalog-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0 12px;
  height: 40px;
  outline: none;
  font: inherit;
}
.catalog-search__btn {
  border: none;
  border-left: 1px solid var(--line);
  background: transparent;
  padding: 0 14px;
  height: 40px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.catalog-search__btn:hover { color: var(--ink); background: #fff; }

.catalog-sentinel { height: 1px; }
.catalog-status {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  padding: 28px 0 8px;
}

/* ---------- Forms ---------- */
.form-card {
  max-width: 430px; margin: 60px auto; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 36px;
}
.form-card.wide { max-width: 560px; }
.form-card h1 { font-size: 1.45rem; margin-bottom: 6px; }
.form-card .sub { color: var(--muted); font-size: .9rem; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); outline: none; transition: border-color .15s;
}
.field input:focus, .field textarea:focus { border-color: var(--ink); background: #fff; }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.form-links { margin-top: 18px; font-size: .86rem; color: var(--ink-soft); text-align: center; }
.form-links a { text-decoration: underline; }

.alert { padding: 12px 16px; border-radius: 8px; font-size: .88rem; margin-bottom: 16px; display: none; }
.alert.error { background: #faece9; color: var(--danger); display: block; }
.alert.success { background: #eaf5ee; color: var(--ok); display: block; }

/* ---------- Tables (cart, orders, admin) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.qty-input { width: 64px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; text-align: center; }
.link-danger { color: var(--danger); font-size: .84rem; text-decoration: underline; background: none; border: none; }

.summary-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-top: 26px;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .95rem; }
.summary-row.total { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }

.status-pill {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--line); color: var(--ink-soft);
}
.status-pill.paid { color: var(--ok); border-color: #bfe0cc; background: #eaf5ee; }
.status-pill.pending { color: #8a6d1a; border-color: #ecdcae; background: #faf3dd; }
.status-pill.cancelled { color: var(--danger); border-color: #eccdc5; background: #faece9; }
.status-pill.shipped, .status-pill.delivered { color: #2b5c8a; border-color: #c3d9ec; background: #e9f2fa; }

/* ---------- Product page ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.product-detail .product-image { border-radius: var(--radius); border: 1px solid var(--line); }
.product-detail h1 { font-size: 1.7rem; margin-bottom: 10px; }
.product-detail .price { font-size: 1.6rem; font-weight: 800; margin: 14px 0 6px; }
.product-detail .desc { color: var(--ink-soft); margin: 18px 0 26px; white-space: pre-line; }
.qty-row { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }

/* Product gallery */
.gallery {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card-bg);
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
}
.gallery__viewport {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  cursor: grab;
}
.gallery__viewport:active { cursor: grabbing; }
.gallery__track {
  display: flex;
  height: 100%;
  transition: transform .28s ease;
  will-change: transform;
}
.gallery__slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.gallery__nav:hover { background: #fff; }
.gallery__nav.prev { left: 10px; }
.gallery__nav.next { right: 10px; }
.gallery__nav:disabled { opacity: .35; cursor: default; }
.gallery__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px 14px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.gallery__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--line);
  cursor: pointer;
}
.gallery__dot.is-active { background: var(--accent); }
@media (max-width: 900px) {
  .gallery__nav { display: none; }
}

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 36px; }
.pagination button {
  min-width: 38px; height: 38px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; color: var(--ink-soft);
}
.pagination button.current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  background: #161616;
  color: #b9b9b4;
  margin-top: 80px;
  /* accent-line: верх футера */
  border-top: 2px solid var(--accent);
}
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 56px 0 40px; }
.site-footer .logo {
  color: #fff;
  margin-right: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.site-footer .logo-img {
  height: 40px;
  max-width: min(260px, 70vw);
}
/* accent-line: под логотипом в футере */
.site-footer .logo::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent);
}
.site-footer h4 {
  color: #fff; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px;
}
.site-footer ul { list-style: none; }
.site-footer li { margin: 8px 0; font-size: .9rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #2c2c2c; padding: 18px 0; font-size: .8rem; color: #7d7d78; }
.footer-bottom__inner {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  align-items: center; justify-content: space-between;
}
.footer-bottom__links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer-bottom__links a:hover { color: #fff; }

/* ---------- Legal / info pages (YooKassa readiness) ---------- */
.legal-page { max-width: 920px; }
.legal-lead {
  color: var(--ink-soft);
  margin: -8px 0 28px;
  max-width: 62ch;
}
.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.legal-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.legal-card--wide { padding: 28px 30px; }
.legal-card h2 {
  font-size: 1.05rem;
  margin: 22px 0 10px;
}
.legal-card h2:first-child { margin-top: 0; }
.legal-card p { margin: 0 0 12px; color: var(--ink-soft); }
.legal-doc p { margin-bottom: 14px; }
.legal-dl { display: grid; gap: 12px; }
.legal-dl > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.legal-dl > div:last-child { border-bottom: none; padding-bottom: 0; }
.legal-dl dt {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.legal-dl dd { color: var(--ink); word-break: break-word; }
.legal-list { margin: 0 0 16px 1.15rem; color: var(--ink-soft); }
.legal-list li { margin: 6px 0; }
.legal-note {
  margin-top: 18px !important;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .88rem;
}
.legal-note code {
  font-size: .84rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
}
.field-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0 18px;
  font-size: .86rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.field-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--ink);
}
.field-check a { text-decoration: underline; }
@media (max-width: 720px) {
  .legal-grid { grid-template-columns: 1fr; }
  .legal-dl > div { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 999px;
  font-size: .88rem; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 70px 0; color: var(--muted); }
.empty-state .big { font-size: 1.2rem; color: var(--ink-soft); margin-bottom: 16px; }
.loading { text-align: center; color: var(--muted); padding: 50px 0; }
.grid > .loading,
.grid > .empty-state { grid-column: 1 / -1; }

@media (max-width: 860px) {
  .product-detail { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .main-nav { display: flex; gap: 18px; }
  .main-nav__home { display: none; }
  .nav-burger { display: inline-flex; }
  .header-actions__link { display: none; }
  .catalog-bar { top: var(--header-h); }
}
@media (max-width: 720px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .product-info { padding: 12px 12px 14px; }
  .product-name { font-size: .85rem; }
  .product-actions { flex-direction: column; gap: 8px; }
  .product-actions .btn { width: 100%; }
}
@media (max-width: 520px) {
  .header-inner { gap: 10px; }
  .logo-img { height: 28px; }
  .main-nav { gap: 14px; }
  .main-nav > a { font-size: .72rem; letter-spacing: .1em; }
}
