/* ==========================================================================
   flamee — стили
   Монохром: бумага, чернила, серая подложка под товар. Один акцент — ember.
   ========================================================================== */

:root {
  --paper: #ffffff;
  --ink: #000000;
  --plate: #efefec;
  --glass-top: rgba(255, 255, 255, .42);
  --glass-bottom: rgba(255, 255, 255, .22);
  --glass-blur: 10px;
  --graphite: #5e5e5e;
  --line: #dadada;
  --ember: #c93518;

  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Archivo Black", var(--font-text);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --d-fast: 160ms;
  --d-mid: 320ms;
  --d-slow: 800ms;

  --gutter: 12px;
  --bar-h: 32px;
  --nav-h: 60px;
  --logo-h: 18px;

  --z-header: 50;
  --z-hero-logo: 60;
  --z-overlay: 90;
  --z-drawer: 100;
  --z-toast: 110;
}

@media (min-width: 768px) {
  :root { --gutter: 16px; --nav-h: 68px; --logo-h: 22px; }
}

/* --- База ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.on-dark :focus-visible { outline-color: var(--paper); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: fixed; left: 8px; top: 8px; z-index: 200;
  padding: 10px 14px; background: var(--ink); color: var(--paper);
  transform: translateY(-160%); transition: transform var(--d-fast);
}
.skip-link:focus { transform: none; }

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.num { font-variant-numeric: tabular-nums; }

/* --- Логотип (PNG как маска — красится через currentColor) --------------- */

.logo {
  display: block;
  aspect-ratio: 1138 / 266;
  background-color: currentColor;
  -webkit-mask: url("../assets/flamee-logo.png") center / contain no-repeat;
  mask: url("../assets/flamee-logo.png") center / contain no-repeat;
}

/* --- Шапка --------------------------------------------------------------- */

.announce {
  height: var(--bar-h);
  display: grid; place-items: center;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  font-size: 12px;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.header {
  position: sticky; top: 0; z-index: var(--z-header);
  height: var(--nav-h);
  padding: 6px 8px;
  color: var(--ink);
  transition: color var(--d-mid) var(--ease-out);
}
@media (min-width: 768px) { .header { padding: 8px var(--gutter); } }

.header__inner {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
}

/* Стекло как в iOS: плавающая «таблетка» с лёгким тоном, размытием,
   усиленным цветом фона и бликами по краям */
.header__inner::before,
.header__inner::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  transition: opacity var(--d-mid) var(--ease-out);
}
.header__inner::before {
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.8) brightness(1.06);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.8) brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -1px 0 rgba(255,255,255,.3),
    inset 0 0 0 1px rgba(255,255,255,.35),
    0 10px 30px rgba(0,0,0,.12),
    0 1px 3px rgba(0,0,0,.08);
}
/* Блик сверху, как преломление света в толстом стекле */
.header__inner::after {
  background:
    radial-gradient(120% 140% at 20% -40%, rgba(255,255,255,.55), transparent 55%),
    radial-gradient(80% 120% at 90% 140%, rgba(255,255,255,.25), transparent 60%);
  mix-blend-mode: soft-light;
}
.header__inner > * { position: relative; }

/* Где размытие не поддерживается, стекло плотное, чтобы текст читался */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .header__inner::before { background: rgba(255,255,255,.94); }
}

.header__home { justify-self: center; display: grid; place-items: center; min-height: 44px; padding: 0 6px; }
.header__home .logo { height: var(--logo-h); }

.nav { display: flex; gap: 2px; }
.nav a, .tools button, .tools a {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 8px;
}
.nav a:first-child { margin-left: -8px; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.tools { justify-self: end; display: flex; align-items: center; margin-right: -4px; }

.link-ul {
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: background-size var(--d-mid) var(--ease-out);
}
@media (hover: hover) {
  .nav a:hover .link-ul, .tools button:hover .link-ul, .link-ul:hover { background-size: 100% 1px; }
}

.cart-count {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center;
  border-radius: 9px;
  background: var(--ink); color: var(--paper);
  font-size: 10px; font-weight: 700;
}
.cart-count[data-count="0"] { background: transparent; color: inherit; border: 1px solid currentColor; }
.cart-count.is-bump { animation: bump 420ms var(--ease-out); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.35); background: var(--ember); color: #fff; } 100% { transform: scale(1); } }

.burger { display: none; }

@media (max-width: 899px) {
  .nav { display: none; }
  .burger { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
  .tools .tools__search-text { display: none; }
}

/* Шапка поверх hero на главной */
.page-home .header { position: fixed; left: 0; right: 0; top: 0; color: var(--paper); }
.page-home .header:not(.is-solid) .header__inner::before,
.page-home .header:not(.is-solid) .header__inner::after { opacity: 0; }
.page-home .header .cart-count[data-count="0"] { border-color: currentColor; }
.page-home .header.is-solid { color: var(--ink); }
.page-home .header .header__home { visibility: hidden; }
.page-home .header.is-docked .header__home,
.page-home.no-morph .header .header__home { visibility: visible; }
.page-home .announce { display: none; }

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: #1b1b1b;
  color: var(--paper);
}

/* На телефоне фото горизонтальное: укорачиваем экран, чтобы оба человека были в кадре */
@media (max-width: 767px) and (orientation: portrait) {
  .hero { height: auto; min-height: 0; aspect-ratio: 1 / 1.72; max-height: 100svh; }
  .hero .hero-logo { top: calc(min(100svh, 172vw) / 2); }
}

.hero__media { position: absolute; inset: 0; }
.hero__media img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: 48% 50%;
  transform-origin: 50% 60%;
}
/* Плёночное зерно поверх фото: статичная SVG-текстура, ничего не анимируется */
.hero__media::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0  1 0 0 0 0  1 0 0 0 0  0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
  opacity: .35;
  pointer-events: none;
}
.hero__media::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.18) 16%, rgba(0,0,0,.06) 32%, rgba(0,0,0,.12) 65%, rgba(0,0,0,.5) 100%);
}

.hero-logo {
  position: fixed;
  left: 50%; top: 50%;
  z-index: var(--z-hero-logo);
  width: min(44vw, 480px);
  color: var(--paper);
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform;
  translate: -50% -50%;
  transition: color var(--d-mid) var(--ease-out);
}
.hero-logo.is-dark { color: var(--ink); }
.hero-logo.is-gone { visibility: hidden; }
.hero-logo .logo { width: 100%; }

.no-morph .hero-logo { position: absolute; }

/* Логотип уезжает в шапку синхронно со скроллом (без JS на каждый кадр) */
@supports (animation-timeline: scroll()) {
  .hero-logo.is-linked {
    animation: logo-dock linear both;
    animation-timeline: scroll(root block);
  }
}
@keyframes logo-dock {
  from { transform: none; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
  to { transform: translate(var(--dock-x), var(--dock-y)) scale(var(--dock-s)); }
}

.hero__foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: end; gap: 16px;
  padding: 0 var(--gutter) calc(20px + env(safe-area-inset-bottom));
}
.hero__season { font-size: 13px; max-width: 22ch; }
.hero__foot .btn { flex: none; }
@media (max-width: 420px) { .hero__foot .btn { padding: 0 14px; } }
.hero__season strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 6vw, 56px); line-height: 1; letter-spacing: -.01em; margin-bottom: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid currentColor;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  position: relative; overflow: hidden; isolation: isolate;
  transition: color var(--d-mid) var(--ease-out);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--ink);
  transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform var(--d-mid) var(--ease-out);
}
.btn--light::before { background: var(--paper); }
@media (hover: hover) {
  .btn:hover { color: var(--paper); }
  .btn--light:hover { color: var(--ink); }
  .btn:hover::before { transform: scaleY(1); }
}
.btn:active { transform: scale(.98); }
.btn--solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--solid::before { background: #2b2b2b; }
@media (hover: hover) { .btn--solid:hover { color: var(--paper); } }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Интро: фото медленно «оседает», логотип проявляется шторкой */
.js .hero__media img { animation: settle 2200ms var(--ease-out) both; }
.js .hero-logo .logo { animation: fade 1400ms 200ms var(--ease-out) both; }
.js .hero__foot, .js .page-home .header__inner { animation: fade 700ms 1000ms var(--ease-out) both; }
@keyframes settle { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* --- Секции -------------------------------------------------------------- */

main { display: block; }
.section { padding: 56px 0; }
@media (min-width: 768px) { .section { padding: 88px 0; } }

.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter); margin-bottom: 16px;
}
.section__title { display: flex; align-items: baseline; gap: 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.section__title .count { font-weight: 500; color: var(--graphite); }

.chips {
  display: flex; gap: 6px; padding: 0 var(--gutter) 16px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 18px;
  font-size: 13px; white-space: nowrap;
  transition: background-color var(--d-fast), color var(--d-fast), border-color var(--d-fast);
}
@media (hover: hover) { .chip:hover { border-color: var(--ink); } }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* --- Сетка товаров ------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 2px;
}
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.grid.grid--duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .grid--duo .card__info { font-size: 14px; padding: 14px 16px 0; } }

.card { min-width: 0; }
.card__plate { position: relative; }
.card__media {
  position: relative; display: block;
  aspect-ratio: 3 / 4;
  background: var(--plate);
  overflow: hidden;
}
.card__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity 600ms var(--ease-out), transform 1200ms var(--ease-out);
}
.card__media .alt { opacity: 0; }
@media (hover: hover) {
  .card:hover .card__media .alt.is-loaded { opacity: 1; }
  .card:hover .card__media img { transform: scale(1.03); }
}

.card__badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
}
.card__badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ember); }
.card__badge[data-badge="restock"]::before { background: var(--ink); }
.card__badge[data-badge="soldout"]::before { background: var(--graphite); }

.card__add {
  position: absolute; right: 0; bottom: 0; z-index: 3;
  width: 44px; height: 44px; display: grid; place-items: center;
}
.card__add svg { width: 14px; height: 14px; transition: transform var(--d-mid) var(--ease-out); }
.card.is-picking .card__add svg { transform: rotate(45deg); }

.card__sizes {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: 8px 48px 8px 8px;
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transform: translateY(101%);
  transition: transform var(--d-mid) var(--ease-out), visibility 0s linear var(--d-mid);
  visibility: hidden;
}
.card.is-picking .card__sizes { transform: none; visibility: visible; transition: transform var(--d-mid) var(--ease-out); }
.card__sizes button {
  min-width: 36px; min-height: 36px; padding: 0 6px;
  font-size: 12px; font-weight: 600;
}
@media (hover: hover) { .card__sizes button:not([disabled]):hover { text-decoration: underline; text-underline-offset: 3px; } }
.card__sizes button[disabled] { color: #a3a3a3; text-decoration: line-through; cursor: not-allowed; }

.card__info { display: flex; justify-content: space-between; gap: 8px; padding: 10px 10px 0; font-size: 12px; }
.card__name { min-width: 0; }
.card__name span { display: block; color: var(--graphite); }
.price-sale { color: var(--ember); }
.price-old { color: var(--graphite); font-size: .9em; margin-left: 4px; }
.card__price .price-old { display: block; margin: 2px 0 0; text-align: right; }
.card__price { flex: none; }

/* Плавная загрузка изображений: подложка → фото */
.js .fade-img { opacity: 0; }
.js .fade-img.is-loaded { opacity: 1; }
.js .card__media .alt.is-loaded { opacity: 0; }

/* --- Появление при скролле ----------------------------------------------- */

.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* --- Лукбук -------------------------------------------------------------- */

.look { display: grid; gap: 2px; }
@media (min-width: 768px) { .look { grid-template-columns: 1fr 1fr; } }
.look__item { position: relative; display: block; overflow: hidden; background: #1b1b1b; color: var(--paper); aspect-ratio: 4 / 5; }
.look__item img {
  position: absolute; left: 0; top: -8%; width: 100%; height: 116%; object-fit: cover;
  filter: grayscale(1);
  will-change: transform;
}
.look__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: end; gap: 12px;
  padding: 16px var(--gutter);
  background: linear-gradient(0deg, rgba(0,0,0,.45), transparent);
}
.look__cap h2 { font-weight: 800; font-size: clamp(24px, 3.4vw, 44px); line-height: 1; letter-spacing: -.02em; }

/* --- Категории ----------------------------------------------------------- */

.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 2px; }
@media (min-width: 900px) { .cats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cat__media { aspect-ratio: 3 / 4; background: var(--plate); overflow: hidden; }
.cat__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1200ms var(--ease-out), opacity 600ms var(--ease-out); }
@media (hover: hover) { .cat:hover .cat__media img { transform: scale(1.04); } }
.cat__name { display: flex; justify-content: space-between; padding: 10px 10px 0; font-size: 12px; }
.cat__name span:last-child { color: var(--graphite); }

/* --- Манифест ------------------------------------------------------------ */

.manifest {
  display: grid; gap: 32px;
  padding: 0 var(--gutter);
}
@media (min-width: 900px) { .manifest { grid-template-columns: 1fr 1fr; align-items: end; } }
.manifest__text {
  font-size: clamp(26px, 3.6vw, 52px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.02em;
  max-width: 18ch;
  text-wrap: balance;
}
.manifest__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.manifest__facts div { padding: 14px 12px 0 0; }
.manifest__facts dt { font-family: var(--font-display); font-size: clamp(28px, 4vw, 48px); line-height: 1; }
.manifest__facts dd { margin-top: 8px; font-size: 13px; color: var(--graphite); max-width: 20ch; }

/* --- Подвал -------------------------------------------------------------- */

.footer { padding: 56px var(--gutter) calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.footer__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; margin-bottom: 64px; }
@media (min-width: 900px) { .footer__cols { grid-template-columns: 2fr 1fr 1fr; } }
.footer__lead { grid-column: 1 / -1; font-size: 15px; max-width: 34ch; }
@media (min-width: 900px) { .footer__lead { grid-column: auto; } }
.footer h2 { margin-bottom: 12px; }
.footer li a { display: inline-flex; min-height: 32px; align-items: center; font-size: 14px; }
@media (hover: hover) { .footer li a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.footer__mark { color: var(--ink); }
.footer__mark .logo { width: 120px; }
@media (min-width: 768px) { .footer__mark .logo { width: 150px; } }
/* Логотип в подвале просто плавно проявляется, как на первом экране */
.js .footer__mark.reveal { transform: none; }
.js .footer__mark.reveal.is-in { transition: opacity 1400ms var(--ease-out); }
.footer__legal { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; font-size: 12px; color: var(--graphite); }

/* --- Каталог ------------------------------------------------------------- */

.page-head { padding: 24px var(--gutter) 16px; display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(32px, 6vw, 72px); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.page-head h1 .count { font-family: var(--font-display); font-weight: 400; font-size: .4em; vertical-align: top; margin-left: 6px; color: var(--graphite); letter-spacing: 0; }

.sort { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sort select {
  min-height: 40px; padding: 0 28px 0 10px;
  border: 1px solid var(--line); border-radius: 0; background: var(--paper);
  font: inherit; color: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23000'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

.empty { padding: 64px var(--gutter); text-align: center; color: var(--graphite); }
.empty .btn { margin-top: 16px; color: var(--ink); }

/* --- Товар --------------------------------------------------------------- */

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px var(--gutter); font-size: 12px; color: var(--graphite); }
.crumbs a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.crumbs a:hover { color: var(--ink); text-decoration-color: currentColor; }

.pdp { display: grid; }
@media (min-width: 900px) {
  .pdp { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr) 48px; gap: 0 32px; padding-right: var(--gutter); align-items: start; }
}

.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--plate); }
.gallery::-webkit-scrollbar { display: none; }
.gallery figure { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 3 / 4; position: relative; overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: opacity 600ms var(--ease-out); }
@media (min-width: 900px) {
  .gallery { display: grid; gap: 2px; overflow: visible; background: none; }
  .gallery figure { background: var(--plate); }
}

.gallery-count { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; }
.gallery-count span { width: 18px; height: 2px; background: var(--line); transition: background-color var(--d-mid); }
.gallery-count span.is-on { background: var(--ink); }
@media (min-width: 900px) { .gallery-count { display: none; } }

.pdp__panel { padding: 20px var(--gutter) 32px; }
@media (min-width: 900px) {
  .pdp__panel { position: sticky; top: calc(var(--bar-h) + var(--nav-h) + 24px); padding: 24px 0 48px; }
}
.pdp__title { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.pdp__title h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.pdp__price { font-size: 16px; flex: none; }
.pdp__color { margin-top: 6px; font-size: 13px; color: var(--graphite); }
.swatches__row { display: flex; gap: 8px; margin-top: 10px; }
.swatch { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid transparent; border-radius: 50%; transition: border-color var(--d-fast); }
.swatch span { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.swatch[aria-current="true"] { border-color: var(--ink); }
@media (hover: hover) { .swatch:not([aria-current]):hover { border-color: var(--line); } }

.sizes { margin-top: 24px; border: 0; padding: 0; }
.sizes legend { display: flex; justify-content: space-between; width: 100%; margin-bottom: 10px; font-size: 13px; }
.sizes legend a { text-decoration: underline; text-underline-offset: 3px; }
.sizes__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.size { position: relative; }
.size input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.size span {
  display: grid; place-items: center; min-height: 48px;
  border: 1px solid var(--line); font-size: 13px; font-weight: 600;
  transition: border-color var(--d-fast), background-color var(--d-fast), color var(--d-fast);
}
@media (hover: hover) { .size input:not(:disabled):hover + span { border-color: var(--ink); } }
.size input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.size input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.size input:disabled + span { color: #a3a3a3; background: repeating-linear-gradient(135deg, transparent 0 6px, #f2f2f2 6px 7px); cursor: not-allowed; }
.sizes__error { min-height: 20px; margin-top: 8px; font-size: 13px; color: var(--ember); }

.pdp__model { margin-top: 4px; font-size: 13px; color: var(--graphite); }
.pdp__buy { margin-top: 16px; }
.pdp__pay { margin-top: 12px; font-size: 13px; color: var(--graphite); }

.acc { margin-top: 28px; border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  min-height: 48px; font-size: 13px; font-weight: 600;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary svg { width: 12px; height: 12px; transition: transform var(--d-mid) var(--ease-out); }
.acc details[open] summary svg { transform: rotate(45deg); }
.acc__body { padding: 0 0 16px; font-size: 14px; color: #2a2a2a; max-width: 60ch; }
.acc__body p + p { margin-top: 8px; }
.size-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.size-table th, .size-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }

.index { display: none; }
@media (min-width: 900px) {
  .index { display: grid; gap: 6px; position: sticky; top: calc(var(--bar-h) + var(--nav-h) + 24px); padding-top: 24px; justify-items: end; }
  .index a { display: grid; place-items: center; min-width: 28px; min-height: 28px; font-size: 12px; color: var(--graphite); }
  .index a.is-on { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
}

.pairs { margin-top: 28px; }
.pairs h2 { margin-bottom: 10px; }
.pairs__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.pairs__row a { display: block; }
.pairs__row .card__media { aspect-ratio: 3 / 4; }
.pairs__row p { padding: 6px 0 0; font-size: 12px; }

/* Липкая кнопка покупки на телефоне */
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 8px; align-items: center;
  padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform var(--d-mid) var(--ease-out);
}
.buybar.is-on { transform: none; }
.buybar__info { flex: 1; min-width: 0; font-size: 12px; }
.buybar__info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) { .buybar { display: none; } }

/* --- Корзина ------------------------------------------------------------- */

.scrim {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: rgba(0,0,0,.4);
  opacity: 0; visibility: hidden;
  transition: opacity var(--d-mid) var(--ease-out), visibility 0s linear var(--d-mid);
}
.scrim.is-on { opacity: 1; visibility: visible; transition: opacity var(--d-mid) var(--ease-out); }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-drawer);
  width: min(440px, 100%);
  display: flex; flex-direction: column;
  background: var(--paper);
  transform: translateX(100%); visibility: hidden;
  transition: transform 260ms var(--ease-in), visibility 0s linear 260ms;
}
.drawer.is-on { transform: none; visibility: visible; transition: transform 480ms var(--ease-out); }
.drawer__head { display: flex; justify-content: space-between; align-items: center; min-height: var(--nav-h); padding: 0 var(--gutter); border-bottom: 1px solid var(--line); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; margin-right: -8px; }
.icon-btn svg { width: 16px; height: 16px; }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px var(--gutter); }
.drawer__foot { padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.drawer__total { display: flex; justify-content: space-between; margin-bottom: 4px; font-weight: 700; }
.drawer__note { margin-bottom: 14px; font-size: 12px; color: var(--graphite); }

.line { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line__media { aspect-ratio: 3 / 4; background: var(--plate); overflow: hidden; }
.line__media img { width: 100%; height: 100%; object-fit: cover; }
.line__top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.line__meta { font-size: 12px; color: var(--graphite); margin-top: 2px; }
.line__ctrl { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); }
.qty button { width: 36px; height: 36px; display: grid; place-items: center; }
.qty output { min-width: 24px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.line__rm { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; min-height: 36px; }

.cart-empty { padding: 48px 0; text-align: center; color: var(--graphite); }
.cart-empty .btn { margin-top: 16px; color: var(--ink); }

/* --- Мобильное меню ------------------------------------------------------ */

.menu {
  position: fixed; inset: 0; z-index: var(--z-drawer);
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  visibility: hidden; opacity: 0;
  transition: opacity 200ms var(--ease-in), visibility 0s linear 200ms;
}
.menu.is-on { visibility: visible; opacity: 1; transition: opacity 300ms var(--ease-out); }
.menu__head { display: flex; justify-content: space-between; align-items: center; min-height: var(--nav-h); padding: 0 var(--gutter); }
.menu__head .icon-btn { margin: 0 -8px 0 0; }
.menu__head .logo { height: var(--logo-h); }
.menu__links { padding: 16px var(--gutter); }
.menu__links a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 30px; font-weight: 700; letter-spacing: -.02em;
}
.menu__links a span { font-size: 12px; font-weight: 500; color: var(--graphite); letter-spacing: 0; }
.menu.is-on .menu__links li { animation: menu-in 600ms var(--ease-out) both; animation-delay: calc(80ms + var(--i) * 45ms); }
@keyframes menu-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.menu__foot { margin-top: auto; display: flex; gap: 20px; padding: 16px var(--gutter) calc(24px + env(safe-area-inset-bottom)); font-size: 14px; }

/* --- Поиск --------------------------------------------------------------- */

.search {
  position: fixed; left: 0; right: 0; top: 0; z-index: var(--z-drawer);
  max-height: 100dvh; overflow-y: auto;
  background: var(--paper);
  transform: translateY(-100%); visibility: hidden;
  transition: transform 260ms var(--ease-in), visibility 0s linear 260ms;
}
.search.is-on { transform: none; visibility: visible; transition: transform 480ms var(--ease-out); }
.search__bar { display: flex; align-items: center; gap: 8px; padding: 8px var(--gutter); border-bottom: 1px solid var(--ink); }
.search__bar label { flex: 1; }
.search__bar input {
  width: 100%; min-height: 52px; border: 0; outline: 0; background: none;
  font: inherit; font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--ink);
}
.search__bar input::placeholder { color: #9a9a9a; }
.search__results { padding: 16px var(--gutter) 32px; }
.search__results .grid { gap: 20px 2px; }
@media (min-width: 900px) { .search__results .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.search__hint { font-size: 13px; color: var(--graphite); margin-bottom: 12px; }

/* --- Тост ---------------------------------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: var(--z-toast);
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 12px 16px;
  background: var(--ink); color: var(--paper); font-size: 13px;
  translate: -50% 0;
  transform: translateY(calc(100% + 24px)); opacity: 0;
  transition: transform 220ms var(--ease-in), opacity 220ms var(--ease-in);
}
.toast.is-on { transform: none; opacity: 1; transition: transform 420ms var(--ease-out), opacity 420ms var(--ease-out); }
.toast button { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; min-height: 32px; }
.has-buybar .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }

/* --- Переходы между страницами (View Transitions, где поддерживаются) ---- */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 220ms var(--ease-in) both vt-out; }
::view-transition-new(root) { animation: 420ms var(--ease-out) both vt-in; }
::view-transition-group(product-media) { animation-duration: 560ms; animation-timing-function: var(--ease-out); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* --- Меньше движения ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .look__item img { transform: none !important; }
  @view-transition { navigation: none; }
}
