/* ==========================================================================
   Рубин — витрина профессиональной косметики. Дизайн-токены и компоненты.
   Цвета, размеры и отступы — только через переменные ниже.
   ========================================================================== */
:root {
  /* палитра */
  --c-bg: #FAF7F5;          /* молочный фон */
  --c-surface: #FFFFFF;
  --c-powder: #F2DCE4;      /* пудрово-розовый */
  --c-lavender: #E8E0F2;    /* светло-лавандовый */
  --c-peach: #F6E3D8;       /* мягкий персиковый */
  --c-plum: #78566F;        /* приглушённый сливовый — основные кнопки (белый текст 6.3:1) */
  --c-plum-hover: #674A5F;
  --c-plum-active: #563E50;
  --c-plum-soft: #F1E8EE;   /* фон для активных пунктов */
  --c-text: #383238;        /* тёмный серо-коричневый (11.7:1 на фоне) */
  --c-muted: #6B6169;       /* второстепенный текст (5.6:1 на фоне) */
  --c-line: #E9E1E4;
  --c-line-strong: #D9CDD3;
  --c-success: #3E6B55;     /* «в наличии» (6.1:1) */
  --c-danger: #A13D4A;
  --c-overlay: rgba(56, 50, 56, .38);

  /* типографика */
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 22px; --fs-2xl: 28px; --fs-3xl: 34px;
  --lh: 1.45;

  /* размеры и отступы */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-pill: 999px;
  --container: 1240px;
  --header-h: 72px;

  /* тени и фокус */
  --sh-sm: 0 1px 2px rgba(56, 50, 56, .05), 0 1px 1px rgba(56, 50, 56, .03);
  --sh-md: 0 8px 24px rgba(56, 50, 56, .08);
  --sh-lg: 0 18px 50px rgba(56, 50, 56, .16);
  --focus: 0 0 0 3px #FAF7F5, 0 0 0 5px #78566F;

  /* движение */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: .15s; --t: .25s;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--c-bg); color: var(--c-text); font: 500 var(--fs-md)/var(--lh) var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; font-weight: 800; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: var(--r-sm); }
.skip { position: absolute; left: var(--sp-4); top: -60px; z-index: 100; background: var(--c-plum); color: #fff; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm); }
.skip:focus { top: var(--sp-2); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-5); }
@media (max-width: 767px) { .container { padding: 0 var(--sp-4); } }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-5);
  border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 700; font-size: var(--fs-md); white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--c-plum); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--c-plum-hover); }
.btn-primary:active:not(:disabled) { background: var(--c-plum-active); }
.btn-outline { background: var(--c-surface); border-color: var(--c-line-strong); color: var(--c-text); }
.btn-outline:hover:not(:disabled) { border-color: var(--c-plum); color: var(--c-plum); }
.btn-soft { background: var(--c-plum-soft); color: var(--c-plum); }
.btn-soft:hover:not(:disabled) { background: var(--c-powder); }
.btn-sm { min-height: 36px; padding: 0 var(--sp-4); font-size: var(--fs-sm); border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm);
  border: 0; background: transparent; color: var(--c-text); transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--c-plum-soft); color: var(--c-plum); }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 18px; height: 18px; }
.badge {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--c-plum); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.badge.bump { animation: bump .4s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }

/* ---------- шапка ---------- */
.header { position: sticky; top: 0; z-index: 40; background: rgba(250, 247, 245, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--c-line); }
.header-row { display: flex; align-items: center; gap: var(--sp-4); height: var(--header-h); }
.logo { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.logo-mark { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: linear-gradient(135deg, var(--c-powder), var(--c-lavender)); color: var(--c-plum); }
.logo-text b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.logo-text span { display: block; font-size: var(--fs-xs); color: var(--c-muted); }
.catalog-btn { flex: none; }
.search { position: relative; flex: 1; min-width: 0; }
.search-field { display: flex; align-items: center; gap: var(--sp-2); height: 46px; padding: 0 var(--sp-2) 0 var(--sp-4); background: var(--c-surface); border: 1.5px solid var(--c-line-strong); border-radius: var(--r-sm); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.search-field:focus-within { border-color: var(--c-plum); box-shadow: 0 0 0 3px rgba(120, 86, 111, .18); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; }
.search-field input:focus-visible { box-shadow: none; }   /* фокус показывает вся строка поиска, а не поле внутри неё */
.search-field input::placeholder { color: var(--c-muted); }
.search-field .btn { min-height: 36px; padding: 0 var(--sp-4); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--c-surface); border-radius: var(--r-md); box-shadow: var(--sh-lg); padding: var(--sp-2); z-index: 50; max-height: 70vh; overflow: auto; }
.suggest h4 { margin: var(--sp-2) var(--sp-3) var(--sp-1); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); }
.suggest a { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: 10px; }
.suggest a:hover, .suggest a[aria-selected="true"] { background: var(--c-plum-soft); }
.suggest img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--c-line); }
.suggest .s-meta { color: var(--c-muted); font-size: var(--fs-sm); margin-left: auto; white-space: nowrap; }
.suggest mark { background: var(--c-powder); color: inherit; border-radius: 3px; }
.header-icons { display: flex; align-items: center; gap: var(--sp-1); flex: none; }
.header-icons .label { display: none; }

/* мега-меню каталога */
.mega { position: fixed; inset: var(--header-h) 0 0 0; z-index: 35; background: var(--c-overlay); animation: fade var(--t) var(--ease); }
.mega-panel { background: var(--c-surface); box-shadow: var(--sh-lg); border-radius: 0 0 var(--r-lg) var(--r-lg); max-height: calc(100vh - var(--header-h) - 40px); overflow: hidden; display: grid; grid-template-columns: 300px 1fr; }
.mega-secs { border-right: 1px solid var(--c-line); padding: var(--sp-3); overflow: auto; }
.mega-secs button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 11px var(--sp-3); border: 0; border-radius: 10px; background: transparent; text-align: left; font-weight: 600; }
.mega-secs button:hover, .mega-secs button[aria-current="true"] { background: var(--c-plum-soft); color: var(--c-plum); }
.mega-secs .count { color: var(--c-muted); font-size: var(--fs-sm); font-weight: 500; }
.mega-subs { padding: var(--sp-5) var(--sp-6); overflow: auto; }
.mega-subs h3 { font-size: var(--fs-xl); margin-bottom: var(--sp-4); }
.mega-subs ul { list-style: none; margin: 0; padding: 0; columns: 2 240px; column-gap: var(--sp-6); }
.mega-subs li { break-inside: avoid; }
.mega-subs a { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 9px var(--sp-2); border-radius: 10px; }
.mega-subs a:hover { background: var(--c-plum-soft); color: var(--c-plum); }
.mega-subs a span { color: var(--c-muted); font-size: var(--fs-sm); }
.mega-foot { margin-top: var(--sp-5); display: flex; gap: var(--sp-3); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

/* нижнее меню (телефон) */
.tabbar { display: none; }

/* ---------- общие блоки ---------- */
main { min-height: 60vh; padding-bottom: var(--sp-7); }
.page { animation: fade .3s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.section { margin-top: var(--sp-7); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.section-head h2 { font-size: var(--fs-xl); }
.link { color: var(--c-plum); font-weight: 700; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--c-muted); }
.crumbs { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding: var(--sp-4) 0; font-size: var(--fs-sm); color: var(--c-muted); }
.crumbs a:hover { color: var(--c-plum); }
.crumbs .sep { opacity: .5; }
.chip { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 36px; padding: 0 var(--sp-4); border-radius: var(--r-pill); background: var(--c-surface); border: 1px solid var(--c-line); font-weight: 600; font-size: var(--fs-sm); transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast); }
.chip:hover { border-color: var(--c-plum); color: var(--c-plum); }
.chip[aria-pressed="true"] { background: var(--c-plum); border-color: var(--c-plum); color: #fff; }
.chip .count { color: inherit; opacity: .65; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.empty { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--c-muted); }
.empty .icon { width: 48px; height: 48px; margin: 0 auto var(--sp-3); color: var(--c-plum); opacity: .6; }
.note { background: var(--c-peach); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); }

/* ---------- главная ---------- */
.hero { margin-top: var(--sp-5); border-radius: var(--r-lg); padding: var(--sp-6) var(--sp-6); background: radial-gradient(120% 140% at 100% 0%, var(--c-lavender) 0%, transparent 55%), linear-gradient(120deg, var(--c-powder), var(--c-peach)); display: grid; grid-template-columns: 1fr auto; gap: var(--sp-5); align-items: center; overflow: hidden; }
.hero h1 { font-size: var(--fs-3xl); max-width: 640px; }
.hero p { margin: var(--sp-3) 0 var(--sp-5); max-width: 560px; color: #4A4249; font-size: var(--fs-lg); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: var(--sp-3); }
.hero-stat { background: rgba(255, 255, 255, .7); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }
.hero-stat b { display: block; font-size: var(--fs-xl); }
.hero-stat span { font-size: var(--fs-sm); color: var(--c-muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-4); }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-3); min-height: 168px; padding: var(--sp-4); border-radius: var(--r-lg); background: var(--c-surface); border: 1px solid var(--c-line); overflow: hidden; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: transparent; }
.tile b { position: relative; z-index: 1; font-size: var(--fs-md); max-width: 70%; }
.tile span { position: relative; z-index: 1; font-size: var(--fs-sm); color: var(--c-muted); }
.tile img { position: absolute; right: -6px; bottom: -6px; width: 104px; height: 104px; object-fit: contain; mix-blend-mode: multiply; transition: transform .5s var(--ease); }
.tile:hover img { transform: scale(1.06) rotate(-2deg); }
.tile::before { content: ""; position: absolute; right: -30px; bottom: -40px; width: 150px; height: 150px; border-radius: 50%; background: var(--tile-bg, var(--c-powder)); opacity: .8; }
.tile:nth-child(3n+2) { --tile-bg: var(--c-lavender); }
.tile:nth-child(3n+3) { --tile-bg: var(--c-peach); }
.lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-3); }
.line-card { display: block; padding: var(--sp-4); border-radius: var(--r-md); background: var(--c-surface); border: 1px solid var(--c-line); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.line-card:hover { border-color: var(--c-plum); box-shadow: var(--sh-sm); }
.line-card b { display: block; }
.line-card span { font-size: var(--fs-sm); color: var(--c-muted); }
.contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); padding: var(--sp-5); border-radius: var(--r-lg); background: var(--c-lavender); }
.contacts a, .contacts div { display: flex; gap: var(--sp-3); align-items: flex-start; }
.contacts a:hover { color: var(--c-plum); }

/* ---------- каталог ---------- */
.cat-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.cat-head h1 { font-size: var(--fs-2xl); }
.cat-head .muted { margin-top: var(--sp-1); }
.clear-ask { display: inline-flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-weight: 700; font-size: var(--fs-sm); }
.subnav { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-2); margin-bottom: var(--sp-4); scrollbar-width: thin; }
.subnav .chip { flex: none; }
.cat-layout { display: grid; grid-template-columns: 260px 1fr; gap: var(--sp-5); align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-4); scrollbar-width: thin; }
.f-group { padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-line); }
.f-group:last-of-type { border-bottom: 0; }
.f-group legend, .f-title { font-weight: 800; font-size: var(--fs-sm); margin-bottom: var(--sp-2); padding: 0; }
.f-group fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.f-check { display: flex; align-items: center; gap: var(--sp-2); padding: 5px 2px; font-size: var(--fs-sm); cursor: pointer; border-radius: 8px; }
.f-check:hover { color: var(--c-plum); }
.f-check input { width: 18px; height: 18px; accent-color: var(--c-plum); margin: 0; flex: none; }
.f-check .count { margin-left: auto; color: var(--c-muted); font-size: var(--fs-xs); }
.f-more { border: 0; background: none; color: var(--c-plum); font-weight: 700; font-size: var(--fs-sm); padding: var(--sp-1) 0; }
.f-search { width: 100%; height: 36px; border: 1px solid var(--c-line-strong); border-radius: 10px; padding: 0 var(--sp-3); margin-bottom: var(--sp-2); background: var(--c-bg); }
.f-price { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.field { display: flex; flex-direction: column; gap: var(--sp-1); }
.field label { font-size: var(--fs-sm); font-weight: 700; }
.field .hint { font-size: var(--fs-xs); color: var(--c-muted); }
.input, .select, textarea.input {
  width: 100%; min-height: 44px; padding: 0 var(--sp-3); border: 1.5px solid var(--c-line-strong); border-radius: var(--r-sm); background: var(--c-surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea.input { padding: var(--sp-3); min-height: 96px; resize: vertical; }
.input-sm { min-height: 36px; border-radius: 10px; font-size: var(--fs-sm); }
.input:hover, .select:hover { border-color: #C7B8C0; }
.input:focus, .select:focus { border-color: var(--c-plum); box-shadow: 0 0 0 3px rgba(120, 86, 111, .18); }
.input[aria-invalid="true"] { border-color: var(--c-danger); }
.error { color: var(--c-danger); font-size: var(--fs-sm); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.toolbar .select { width: auto; min-height: 40px; font-weight: 600; }
.active-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.filters-btn { display: none; }
.sheet-head, .sheet-foot { display: none; }

/* сетка товаров и карточка */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: var(--sp-4); }
.card { position: relative; display: flex; flex-direction: column; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; transition: box-shadow var(--t) var(--ease), border-color var(--t), transform var(--t) var(--ease); }
.card:hover { box-shadow: var(--sh-md); border-color: transparent; transform: translateY(-2px); }
.card-media { display: block; aspect-ratio: 1; background: #fff; padding: var(--sp-3); border-bottom: 1px solid var(--c-line); }
.card-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s var(--ease); }
.card:hover .card-media img { transform: scale(1.04); }
.ph { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; gap: var(--sp-2); color: #A8949F; background: linear-gradient(135deg, #FBF5F7, #F5F0F8); border-radius: var(--r-sm); font-size: var(--fs-xs); }
.ph .icon { width: 36px; height: 36px; margin: 0 auto; }
.card-fav { position: absolute; top: var(--sp-2); right: var(--sp-2); width: 38px; height: 38px; background: rgba(255, 255, 255, .92); box-shadow: var(--sh-sm); border-radius: 50%; }
.card-fav[aria-pressed="true"] { color: var(--c-plum); }
.card-fav[aria-pressed="true"] .icon { fill: currentColor; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.card-brand { font-size: var(--fs-xs); font-weight: 700; color: var(--c-muted); text-transform: uppercase; letter-spacing: .05em; height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(3 * 1.35em); line-height: 1.35; font-size: var(--fs-sm); font-weight: 600; margin-top: var(--sp-1); }
.card-title:hover { color: var(--c-plum); }
.card-meta { height: 20px; margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { margin-top: auto; padding-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.price { font-size: var(--fs-lg); font-weight: 800; }
.price-req { font-size: var(--fs-sm); font-weight: 700; color: var(--c-muted); }
.stock-out { font-size: var(--fs-xs); font-weight: 700; color: var(--c-danger); }
.stepper { display: inline-flex; align-items: center; justify-content: space-between; height: 44px; border-radius: var(--r-sm); background: var(--c-plum-soft); color: var(--c-plum); }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; border-radius: var(--r-sm); display: grid; place-items: center; transition: background var(--t-fast); }
.stepper button:hover { background: var(--c-powder); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper input { width: 48px; border: 0; background: transparent; text-align: center; font-weight: 800; color: var(--c-text); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input:focus-visible { box-shadow: none; }
.stepper:has(input:focus) { box-shadow: 0 0 0 3px rgba(120, 86, 111, .18); }
.more-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); margin-top: var(--sp-6); }

/* ---------- товар ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: var(--sp-6); align-items: start; }
.gallery { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-5); position: relative; }
.gallery-main { display: block; width: 100%; aspect-ratio: 1; border: 0; background: #fff; padding: 0; cursor: zoom-in; border-radius: var(--r-md); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery .ph { aspect-ratio: 1; }
.buy-box { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: var(--sp-4); }
.p-brand { font-weight: 800; color: var(--c-plum); text-transform: uppercase; letter-spacing: .05em; font-size: var(--fs-sm); }
.p-brand:hover { text-decoration: underline; text-underline-offset: 3px; }
.product h1 { font-size: var(--fs-2xl); }
.p-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); color: var(--c-muted); font-size: var(--fs-sm); }
.buy-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--sh-sm); display: flex; flex-direction: column; gap: var(--sp-4); }
.buy-card .price { font-size: var(--fs-3xl); }
.in-stock { color: var(--c-success); font-weight: 700; font-size: var(--fs-sm); display: flex; align-items: center; gap: var(--sp-2); }
.in-stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.buy-row { display: flex; gap: var(--sp-3); }
.buy-row .btn-primary { flex: 1; }
.p-sections { margin-top: var(--sp-6); display: grid; gap: var(--sp-4); }
.p-section { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-5); }
.p-section h2 { font-size: var(--fs-lg); margin-bottom: var(--sp-3); }
.p-text { max-width: 76ch; white-space: pre-line; line-height: 1.6; }
.props { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.props th, .props td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.props th { width: 40%; color: var(--c-muted); font-weight: 600; padding-right: var(--sp-4); }
.props tr:last-child th, .props tr:last-child td { border-bottom: 0; }
.complement-group + .complement-group { margin-top: var(--sp-5); }
.complement-group h3 { font-size: var(--fs-md); margin-bottom: var(--sp-1); }
.complement-group p { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(30, 26, 30, .8); display: grid; place-items: center; padding: var(--sp-5); animation: fade var(--t); }
.lightbox img { max-width: min(92vw, 700px); max-height: 86vh; background: #fff; border-radius: var(--r-lg); }
.lightbox .icon-btn { position: absolute; top: var(--sp-4); right: var(--sp-4); color: #fff; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .15); color: #fff; }

.mbuy { display: none; }

/* ---------- корзина и оформление ---------- */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--sp-5); align-items: start; }
.cart-list { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 0 var(--sp-5); }
.cart-line { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto auto 44px; gap: var(--sp-4); align-items: center; padding: var(--sp-4) 0; border-bottom: 1px solid var(--c-line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .thumb { width: 88px; height: 88px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--c-line); padding: 6px; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-line .name { font-weight: 600; font-size: var(--fs-sm); }
.cart-line .name:hover { color: var(--c-plum); }
.cart-line .sub { font-size: var(--fs-xs); color: var(--c-muted); margin-top: 2px; }
.cart-line .sum { font-weight: 800; min-width: 96px; text-align: right; }
.summary { position: sticky; top: calc(var(--header-h) + 16px); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); box-shadow: var(--sh-sm); }
.summary h2 { font-size: var(--fs-lg); }
.sum-row { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--c-line); font-size: var(--fs-xl); font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-grid .full { grid-column: 1 / -1; }
.panel { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-5); }
.panel + .panel { margin-top: var(--sp-4); }
.panel h2 { font-size: var(--fs-lg); margin-bottom: var(--sp-4); }
.order-text { white-space: pre-wrap; font-size: var(--fs-sm); background: var(--c-bg); border-radius: var(--r-sm); padding: var(--sp-3); border: 1px solid var(--c-line); max-height: 260px; overflow: auto; }
.done-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* ---------- бренды ---------- */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); }
.brand-card { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-4); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); font-weight: 700; transition: border-color var(--t-fast), color var(--t-fast); }
.brand-card:hover { border-color: var(--c-plum); color: var(--c-plum); }
.brand-card span { color: var(--c-muted); font-weight: 500; font-size: var(--fs-sm); }
.alpha { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-bottom: var(--sp-4); }

/* подвал */
.footer { border-top: 1px solid var(--c-line); padding: var(--sp-6) 0 calc(var(--sp-6) + env(safe-area-inset-bottom)); color: var(--c-muted); font-size: var(--fs-sm); }
.footer-row { display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.footer a:hover { color: var(--c-plum); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 95; transform: translateX(-50%); background: var(--c-text); color: #fff; padding: var(--sp-3) var(--sp-5); border-radius: var(--r-md); box-shadow: var(--sh-lg); font-weight: 600; animation: toast .3s var(--ease); max-width: calc(100vw - 32px); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ==========================================================================
   Планшет и телефон
   ========================================================================== */
@media (max-width: 1023px) {
  .logo-text span { display: none; }
  .search { min-width: 200px; }
  .header-row { gap: var(--sp-3); }
  .hero { padding: var(--sp-5); }
  .hero h1 { font-size: var(--fs-2xl); }
  .hero p { font-size: var(--fs-md); margin-bottom: var(--sp-4); }
  .cat-layout { grid-template-columns: 1fr; }
  .filters-btn { display: inline-flex; }
  .filters {
    position: fixed; inset: auto 0 0 0; top: auto; z-index: 70; max-height: 86vh; border-radius: var(--r-lg) var(--r-lg) 0 0; border: 0;
    box-shadow: var(--sh-lg); padding: 0; display: flex; flex-direction: column; transform: translateY(105%); transition: transform var(--t) var(--ease); visibility: hidden;
  }
  .filters.open { transform: none; visibility: visible; }
  .filters .f-scroll { overflow: auto; padding: 0 var(--sp-5); }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--c-line); }
  .sheet-head h2 { font-size: var(--fs-lg); }
  .sheet-foot { display: flex; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5) calc(var(--sp-4) + env(safe-area-inset-bottom)); border-top: 1px solid var(--c-line); }
  .sheet-foot .btn-primary { flex: 1; }
  .scrim { position: fixed; inset: 0; z-index: 65; background: var(--c-overlay); animation: fade var(--t); }
  .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-5); }
  .buy-box { position: static; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .mega-panel { grid-template-columns: 240px 1fr; }
}
@media (max-width: 767px) {
  :root { --header-h: 60px; --fs-2xl: 23px; --fs-3xl: 26px; }
  .header-row { height: auto; padding-top: var(--sp-2); padding-bottom: var(--sp-2); flex-wrap: wrap; gap: var(--sp-2); }
  .logo-mark { width: 36px; height: 36px; }
  .logo-text b { font-size: 17px; }
  .logo-text span { display: none; }
  .catalog-btn, .header-icons .hide-m { display: none; }
  .header-icons { margin-left: auto; }
  .search { order: 3; flex-basis: 100%; }
  .search-field { height: 44px; }
  .mega { inset: 0; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--c-line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: var(--r-sm); font-size: 11px; font-weight: 600; color: var(--c-muted); }
  .tabbar a[aria-current="page"] { color: var(--c-plum); background: var(--c-plum-soft); }
  .tabbar .badge { right: calc(50% - 22px); top: 2px; }
  main { padding-bottom: 96px; }
  .footer { padding-bottom: 96px; }
  .hero { grid-template-columns: 1fr; padding: var(--sp-4) var(--sp-4) var(--sp-5); margin-top: var(--sp-4); }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: var(--fs-sm); margin: var(--sp-2) 0 var(--sp-4); }
  .hero-actions .btn { flex: 1; padding: 0 var(--sp-3); }
  .hero-stats { display: none; }
  .section { margin-top: var(--sp-6); }
  .tiles { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .tile { min-height: 132px; padding: var(--sp-3); }
  .tile img { width: 76px; height: 76px; }
  .grid { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .card-body { padding: var(--sp-2) var(--sp-3) var(--sp-3); }
  .price { font-size: var(--fs-md); }
  .card-foot .btn { padding: 0 var(--sp-2); font-size: var(--fs-sm); }
  .stepper button { width: 38px; }
  .stepper input { width: 32px; }
  .cart-list { padding: 0 var(--sp-3); }
  .cart-line { grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "t n x" "t q s"; gap: var(--sp-2) var(--sp-3); align-items: center; }
  .cart-line .thumb { grid-area: t; width: 72px; height: 72px; align-self: start; }
  .cart-line .info { grid-area: n; }
  .cart-line .stepper { grid-area: q; justify-self: start; }
  .cart-line .sum { grid-area: s; text-align: right; min-width: 0; white-space: nowrap; }
  .cart-line .remove { grid-area: x; align-self: start; }
  .form-grid { grid-template-columns: 1fr; }
  .gallery { padding: var(--sp-3); }
  .product { grid-template-columns: 1fr; gap: var(--sp-4); }
  .gallery-main, .gallery .ph { aspect-ratio: auto; height: 300px; }
  .buy-card .price { font-size: var(--fs-2xl); }
  .gallery-main, .gallery .ph { height: 260px; }
  .mbuy {
    display: flex; align-items: center; gap: var(--sp-3); position: fixed; left: 0; right: 0; z-index: 44;
    bottom: calc(58px + env(safe-area-inset-bottom)); padding: var(--sp-2) var(--sp-4);
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--c-line); box-shadow: 0 -6px 20px rgba(56, 50, 56, .06);
  }
  .mbuy > div:last-child { flex: 1; }
  .mbuy .btn, .mbuy .stepper { width: 100%; }
  .page:has(.mbuy) { padding-bottom: 72px; }
  .mega-panel { grid-template-columns: 1fr; border-radius: 0; max-height: 100vh; height: 100%; }
  .mega-secs { border-right: 0; }
  .mega-subs { padding: var(--sp-4); }
  .toast { bottom: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
