/* ============================================================
   Витрина «Всё в цвет» — три варианта дизайна через data-style:
   viv   — «Всё в цвет»: светлый, яркие CMYK-акценты
   noir  — тёмный стрит-стиль с неоном
   kraft — тёплый крафт
   ============================================================ */
:root, html[data-style="viv"] {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #17151a;
  --muted: #6f6a75;
  --border: #e8e5ee;
  --accent: #e5397f;
  --accent-2: #00a6d6;
  --accent-3: #f5b800;
  --on-accent: #ffffff;
  --hero-bg: linear-gradient(120deg, #fce7f0 0%, #e0f5fc 55%, #fdf3d0 100%);
  --card-radius: 18px;
  --display: "Unbounded", sans-serif;
  --font: "Onest", sans-serif;
  --chip-on: #17151a;
}
/* Тёмная тема на палитре логотипа «Всё в цвет»: глубокий сине-чёрный фон (синий
   «В ЦВЕТ» #3A4594), CTA — фирменный градиент вихря #FF2638→#AE75E8, акценты из
   радуги: жёлтый #F5FF43, голубой #00CCEC, янтарный #FFBD2D. */
html[data-style="noir"] {
  --bg: #0f1016;
  --surface: #171923;
  --text: #f2f1f7;
  --muted: #8b8fa3;
  --border: #272b3a;
  --accent: #ff3d55;
  --accent-2: #00ccec;
  --accent-3: #ffbd2d;
  --on-accent: #ffffff;
  --hero-bg: radial-gradient(110% 150% at 12% 0%, #262357 0%, #161327 45%, #0f1016 100%);
  --card-radius: 14px;
  --chip-on: #f5ff43;
}
html[data-style="noir"] .btn-primary,
html[data-style="noir"] .cart-btn {
  background: linear-gradient(100deg, #ff2638 0%, #ae75e8 100%);
  color: #fff;
}
html[data-style="noir"] .btn-primary:hover { filter: brightness(1.08); }
html[data-style="noir"] .cart-count { background: #f5ff43; color: #14120f; }
html[data-style="noir"] .brand-dot {
  background: conic-gradient(#ff5945 0 14%, #ffbd2d 14% 28%, #f5ff43 28% 43%, #82e82d 43% 57%, #00c79f 57% 71%, #00ccec 71% 86%, #ae75e8 86% 100%);
}
html[data-style="noir"] .hero .hl {
  background: linear-gradient(92deg, #ff5945 0%, #ffbd2d 22%, #f5ff43 40%, #82e82d 56%, #00ccec 76%, #69dbff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-style="noir"] .chip.on { color: #14120f; }
html[data-style="noir"] .section-head a { color: #00ccec; }
html[data-style="noir"] .crumbs a { color: #00ccec; }
html[data-style="kraft"] {
  --bg: #f4ede2;
  --surface: #fffaf2;
  --text: #2e2113;
  --muted: #8a7a64;
  --border: #e3d5c0;
  --accent: #c96f2b;
  --accent-2: #5d7a4e;
  --accent-3: #a8552f;
  --on-accent: #fffaf2;
  --hero-bg: linear-gradient(120deg, #efe2cd 0%, #f7efe0 100%);
  --card-radius: 12px;
  --chip-on: #2e2113;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Шапка ---------- */
.topnav {
  display: flex; align-items: center; gap: 22px;
  padding: 14px 5vw;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .02em; display: flex; align-items: center; gap: 9px; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--accent-2) 0 25%, var(--accent) 25% 50%, var(--accent-3) 50% 75%, var(--text) 75% 100%); }
html[data-style="kraft"] .brand-dot { background: var(--accent); border-radius: 4px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); background: var(--bg); }
.nav-links a.active { color: var(--text); background: var(--bg); font-weight: 600; }
.nav-search { margin-left: auto; }
.nav-search input {
  border: 1.5px solid var(--border); background: var(--bg); color: var(--text);
  border-radius: 999px; padding: 9px 18px; width: 230px; font: inherit; font-size: 14px; outline: none;
}
.nav-search input:focus { border-color: var(--accent); }
.cart-btn { font-weight: 600; padding: 9px 18px; border-radius: 999px; background: var(--text); color: var(--bg); }
.cart-count { display: inline-block; min-width: 21px; text-align: center; background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: 12.5px; padding: 1px 6px; margin-left: 4px; }

/* ---------- Hero ---------- */
/* Компактный hero: подборки должны быть видны на первом экране.
   Контент hero живёт в том же контейнере (1440px по центру), что и секции ниже. */
.hero { padding: 2.5vh 0 3vh; background: var(--hero-bg); }
.hero-inner { display: flex; align-items: center; gap: 3vw; flex-wrap: wrap; max-width: 1440px; margin: 0 auto; padding: 0 5vw; box-sizing: border-box; }
.hero-logo { width: 150px; height: auto; margin-bottom: 0; flex-shrink: 0; }
.hero h1 { font-family: var(--display); font-size: clamp(26px, 3vw, 42px); line-height: 1.08; font-weight: 700; letter-spacing: -.01em; }
.hero .hl { color: var(--accent); }
.hero p { margin: 10px 0 16px; font-size: 15.5px; color: var(--muted); max-width: 520px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hero-grid .pcard:nth-child(3), .hero-grid .pcard:nth-child(4) { display: none; }
@media (min-width: 1100px) { .hero-grid .pcard:nth-child(3), .hero-grid .pcard:nth-child(4) { display: block; } .hero-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Карусели подборок (полная ширина, 5 компактных карточек в ряд) ---------- */
.hero-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.collections-row { display: flex; flex-direction: column; gap: 26px; padding-top: 2.5vh; padding-bottom: 2vh; }
.hero-text { min-width: 260px; }
.carousel { min-width: 0; }
.car-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.car-head h3 { font-family: var(--display); font-size: clamp(16px, 1.8vw, 21px); font-weight: 600; letter-spacing: .01em; }
.car-nav { display: flex; gap: 6px; }
.car-nav button {
  width: 30px; height: 30px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 17px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 2px;
}
.car-nav button:hover { border-color: var(--accent); color: var(--accent); }
.car-view { overflow: hidden; }
.car-track { display: flex; gap: 12px; transition: transform .45s cubic-bezier(.33,.8,.35,1); }
.carousel .pcard { flex: 0 0 calc((100% - 48px) / 5); min-width: 0; }
@media (max-width: 1100px) { .carousel .pcard { flex-basis: calc((100% - 24px) / 3); } }
@media (max-width: 720px) { .carousel .pcard { flex-basis: calc((100% - 12px) / 2); } }
.carousel .pcard-img { aspect-ratio: 4 / 3; }
.carousel .pcard-body { padding: 9px 11px 11px; gap: 4px; }
.carousel .pcard-name { font-size: 12.5px; -webkit-line-clamp: 1; min-height: auto; }
.carousel .pcard-sizes { display: none; }
.carousel .pcard-price { font-size: 14.5px; }
.carousel .pcard-badge { display: none; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 15px;
  border: none; border-radius: 999px; padding: 13px 26px; cursor: pointer;
  transition: transform .08s, filter .12s;
}
.btn-primary:hover { filter: brightness(.94); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .45; cursor: default; }
.btn-lg { width: 100%; padding: 16px; font-size: 16px; }
.btn-ghost { display: inline-flex; align-items: center; padding: 12px 20px; border-radius: 999px; border: 1.5px solid var(--text); font-weight: 600; font-size: 14.5px; }
.btn-ghost:hover { background: var(--text); color: var(--bg); }

/* ---------- Полоса преимуществ ---------- */
.strip { display: flex; gap: 3vw; flex-wrap: wrap; justify-content: center; padding: 16px 5vw; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 14.5px; color: var(--muted); font-weight: 500; }

/* ---------- Секции и сетка ---------- */
.section { padding: 4.5vh 5vw 6vh; max-width: 1440px; margin: 0 auto; }
.section-head { display: flex; align-items: baseline; gap: 16px; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h1, .section-head h2 { font-family: var(--display); font-weight: 600; font-size: clamp(21px, 2.6vw, 30px); }
.section-head a { color: var(--accent); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.muted { color: var(--muted); }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 17px; }
.empty a { color: var(--accent); font-weight: 600; }

/* ---------- Карточка товара в сетке ---------- */
.pcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-radius); overflow: hidden; transition: transform .12s, box-shadow .12s; display: flex; flex-direction: column; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.09); }
html[data-style="noir"] .pcard:hover { box-shadow: 0 14px 34px rgba(0,0,0,.5); }
.pcard-img { aspect-ratio: 3 / 4; position: relative; background: var(--bg); }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { display: grid; place-items: center; height: 100%; color: var(--muted); }
.pcard-badge { position: absolute; top: 10px; left: 10px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.pcard-badge.out { background: var(--text); color: var(--bg); }
.pcard-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.pcard-name { font-size: 14px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.pcard-sizes { display: flex; gap: 4px; flex-wrap: wrap; }
.pcard-sizes span { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.pcard-price { font-family: var(--display); font-weight: 600; font-size: 17px; margin-top: auto; }

/* ---------- Фильтры ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.filters-sep { width: 1px; height: 22px; background: var(--border); margin: 0 6px; }
.chip { border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 500; }
.chip:hover { border-color: var(--muted); color: var(--text); }
.chip.on { background: var(--chip-on); border-color: var(--chip-on); color: var(--bg); font-weight: 600; }

/* ---------- Страница товара ---------- */
.product { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr); gap: 4vw; }
.gallery-main { border-radius: var(--card-radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.gallery-main img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs img { width: 64px; height: 80px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; opacity: .75; }
.gallery-thumbs img.on { border-color: var(--accent); opacity: 1; }
.crumbs { color: var(--muted); font-size: 13.5px; margin-bottom: 10px; }
.crumbs a { color: var(--accent); }
.pinfo h1 { font-family: var(--display); font-size: clamp(20px, 2.2vw, 28px); font-weight: 600; line-height: 1.25; margin-bottom: 14px; }
.price-line { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.price { font-family: var(--display); font-size: 30px; font-weight: 700; }
.old-price { color: var(--muted); text-decoration: line-through; font-size: 17px; }
.sizes-label { font-weight: 600; margin-bottom: 8px; }
.sizes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.size-btn { min-width: 52px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.size-btn:hover { border-color: var(--text); }
.size-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.size-btn:disabled { opacity: .35; cursor: default; text-decoration: line-through; }
.stock-note { min-height: 22px; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.stock-note.ok { color: #14976b; }
.stock-note.low { color: #c96f2b; }
.pmeta { margin-top: 26px; display: grid; gap: 9px; color: var(--muted); font-size: 14.5px; }

/* ---------- Варианты принта (лента миниатюр + модалка «Все») ---------- */
.variants { margin-top: 22px; }
.variants-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-weight: 600; font-size: 14.5px; }
.variants-all { border: 1.5px solid var(--border); background: var(--surface); color: var(--accent-2, var(--accent)); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.variants-all:hover { border-color: var(--accent-2, var(--accent)); }
.variants-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.vthumb { flex: 0 0 62px; width: 62px; height: 78px; border-radius: 9px; overflow: hidden; border: 1.5px solid var(--border); background: var(--surface); transition: border-color .12s, transform .1s; }
.vthumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vthumb-more { display: grid; place-items: center; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.vthumb-more:hover { color: var(--text); }

.vmodal-overlay { position: fixed; inset: 0; background: rgba(8, 8, 14, .72); z-index: 90; display: grid; place-items: center; padding: 4vh 3vw; }
.vmodal-overlay[hidden] { display: none; }
.vmodal { background: var(--bg); border: 1px solid var(--border); border-radius: var(--card-radius); width: min(1120px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.vmodal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.vmodal-head h3 { font-family: var(--display); font-size: 18px; font-weight: 600; }
.vmodal-close { border: none; background: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.vmodal-close:hover { color: var(--text); }
.vmodal-grid { overflow-y: auto; padding: 20px 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: max-content; gap: 14px; }
.vmodal-grid .pcard-sizes { display: none; }
.vmodal-grid .pcard-img { flex-shrink: 0; }
/* Характеристики и описание — во всю ширину под фото и размерами */
.pdetails { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr); gap: 40px; margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--border); }
@media (max-width: 860px) { .pdetails { grid-template-columns: 1fr; } }
.pdetails h2 { font-family: var(--display); font-size: 17px; font-weight: 600; margin-bottom: 14px; }
.spec-grid { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 7px 18px; font-size: 14.5px; }
.spec-grid dt { color: var(--muted); }
.spec-grid dd { margin: 0; }
.pdesc { font-size: 15px; line-height: 1.65; color: var(--text); max-width: 720px; }

/* ---------- Корзина ---------- */
.cart-root { max-width: 760px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto auto auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 72px; height: 90px; object-fit: cover; border-radius: 10px; }
.cart-item .ci-name { font-weight: 500; font-size: 14.5px; }
.cart-item .ci-size { color: var(--muted); font-size: 13px; }
.ci-qty { display: flex; align-items: center; gap: 8px; }
.ci-qty button { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 16px; }
.ci-price { font-weight: 700; white-space: nowrap; }
.ci-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; }
.ci-del:hover { color: #e03131; }
.cart-total { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; font-family: var(--display); font-size: 21px; font-weight: 700; }
.cart-note { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* ---------- Подвал и переключатель стилей ---------- */
.footer { padding: 34px 5vw 44px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; display: grid; gap: 6px; background: var(--surface); }
.style-picker { position: fixed; left: 14px; bottom: 14px; z-index: 50; display: flex; gap: 6px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; font-size: 12.5px; color: var(--muted); box-shadow: 0 6px 20px rgba(0,0,0,.14); }
.style-picker button { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 12.5px; }
.style-picker button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

@media (max-width: 860px) {
  html, body { overflow-x: hidden; } /* страховка: ничто не должно распирать страницу вбок */
  .hero { grid-template-columns: 1fr; }
  .product { grid-template-columns: 1fr; }
  /* компактная шапка: бренд + корзина в строку, ссылки ниже, поиск на всю ширину */
  .topnav { padding: 10px 4vw; gap: 8px 10px; }
  .brand { font-size: 15px; }
  .cart-btn { order: 2; margin-left: auto; padding: 8px 14px; font-size: 14px; }
  .nav-links { order: 3; width: 100%; gap: 0; }
  .nav-links a { padding: 6px 10px; font-size: 13.5px; }
  .nav-search { order: 4; width: 100%; margin-left: 0; }
  .nav-search input { width: 100%; padding: 8px 14px; }
  .hero-logo { width: 110px; }
  .hero h1 { font-size: 24px; }
  .cart-item { grid-template-columns: 56px 1fr auto; grid-template-rows: auto auto; }
  .price { font-size: 24px; }
}
