/* Общая основа демо-магазинов (05.11.2026): раскладка каталога, карточки товара, корзины и оформления.
   Внешний вид задаёт css/style.css магазина: токены ниже и свои правила поверх. */
:root {
  --bg: #fff; --fg: #141414; --muted: #6b6b6b; --line: #e6e6e6; --soft: #f4f4f2;
  --accent: #141414; --accent-ink: #fff; --sale: #c8341f; --ok: #2f7a3e;
  --card-bg: var(--soft); --radius: 0px; --radius-btn: 0px; --wrap: 1360px; --gap: 24px;
  --font-body: system-ui, sans-serif; --font-head: var(--font-body);
  --step--1: 13px; --step-0: 15px; --step-1: 17px; --step-2: 22px; --step-3: clamp(26px, 3vw, 34px); --step-4: clamp(32px, 4.4vw, 52px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.locked { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 var(--step-0)/1.5 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; font-weight: 500; }
p { margin: 0 0 .7em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; left: 12px; top: 12px; z-index: 100; background: var(--bg); padding: 10px 14px; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--pad, 32px)); margin-inline: auto; }
.narrow { max-width: 820px; }
.noscript { padding: 12px; text-align: center; background: var(--soft); }
.small { font-size: var(--step--1); color: var(--muted); }
.note { font-size: var(--step--1); color: var(--sale); margin: 8px 0; }
[hidden] { display: none !important; }

/* кнопки, чипы */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border: 1px solid var(--accent); border-radius: var(--radius-btn); background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 500; transition: background .2s, color .2s, transform .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn--ghost { background: transparent; color: var(--fg); border-color: currentColor; }
.btn--ghost:hover { background: var(--fg); color: var(--bg); filter: none; }
.btn--block { display: flex; width: 100%; }
.btn--lg { min-height: 54px; font-size: var(--step-1); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; padding: 0; border-radius: 50%; }
.icon-btn svg, .card__fav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[aria-pressed="true"] > svg { fill: var(--sale); stroke: var(--sale); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-btn); text-decoration: none; font-size: var(--step--1); white-space: nowrap; }
.chip.is-on { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.chip .sw { width: 14px; height: 14px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.link-btn { border: 0; background: none; padding: 8px 0; text-decoration: underline; color: var(--muted); }

/* сетка и карточка */
.grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: var(--gap); }
.card { position: relative; display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
.card__media { display: block; background: var(--card-bg); border-radius: var(--radius); overflow: hidden; aspect-ratio: var(--card-ratio, 4/5); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.card:hover .card__media img { transform: scale(1.035); }
.card__badge { position: absolute; left: 10px; top: 10px; padding: 3px 9px; background: var(--fg); color: var(--bg); font-size: 12px; line-height: 1.5; border-radius: var(--radius-btn); }
.card__fav { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.88); display: grid; place-items: center; }
.card__body { display: flex; flex-direction: column; gap: 6px; padding: 14px 0 0; flex: 1; }
.card__price { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: var(--step-1); }
.card__price b, .pprice b { font-weight: 600; }
.card__price small, .pprice small { font-weight: 400; color: var(--muted); font-size: .8em; }
.card__price s, .pprice s { color: var(--muted); font-size: .85em; }
.card__name { font: 400 var(--step-0)/1.35 var(--font-body); margin: 0; }
.card__name a { text-decoration: none; }
.card__name a:hover { text-decoration: underline; }
.card__meta { margin: 0; color: var(--muted); font-size: var(--step--1); }
.card__vars { display: flex; flex-wrap: wrap; gap: 6px; }
.card__vars .chip { min-height: 30px; padding: 0 10px; }
.card__add { margin-top: auto; }
.card.is-out .card__media img { opacity: .5; }

/* ящик корзины, меню, фильтры на телефоне */
.scrim { position: fixed; inset: 0; background: rgba(10,10,10,.42); opacity: 0; visibility: hidden; transition: .25s; z-index: 60; }
.scrim.is-open { opacity: 1; visibility: visible; }
.drawer, .mmenu { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--bg); z-index: 70; transform: translateX(100%); transition: transform .32s cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column; visibility: hidden; }
.drawer.is-open, .mmenu.is-open { transform: none; visibility: visible; }
.drawer__top, .mmenu__top, .filters__top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 12px 22px; border-bottom: 1px solid var(--line); }
.drawer__title, .filters__title { margin: 0; font: 500 var(--step-2) var(--font-head); }
.drawer__title span { font-size: .7em; color: var(--muted); }
.drawer__body { flex: 1; overflow: auto; padding: 8px 22px; }
.drawer__foot { padding: 16px 22px 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.drawer__link { text-align: center; font-size: var(--step--1); color: var(--muted); }
.mmenu nav { display: grid; padding: 8px 22px; }
.mmenu nav a { padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: var(--step-1); }
.mmenu__brand { font: 600 var(--step-2) var(--font-head); text-decoration: none; }
.mmenu__search { padding: 14px 22px 0; }
.mmenu__search input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-btn); }
.mmenu__contacts { padding: 18px 22px; color: var(--muted); font-size: var(--step--1); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; visibility: hidden; background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: var(--radius-btn); z-index: 80; transition: transform .3s, opacity .3s, visibility .3s; font-size: var(--step--1); pointer-events: none; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: scale(1.18); } }

/* строки корзины */
.line { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line__img { display: block; background: var(--card-bg); border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5; }
.line__img img { width: 100%; height: 100%; object-fit: cover; }
.line__info { display: grid; gap: 4px; min-width: 0; }
.line__name { text-decoration: none; font-weight: 500; }
.line__var { color: var(--muted); font-size: var(--step--1); }
.line__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.line__rm { justify-self: start; border: 0; background: none; padding: 2px 0; color: var(--muted); font-size: 12px; text-decoration: underline; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-btn); height: 38px; }
.stepper button { width: 38px; height: 100%; border: 0; background: none; font-size: 18px; }
.stepper output { min-width: 54px; text-align: center; font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.stepper--lg { height: 54px; }
.stepper--lg output { min-width: 64px; font-size: var(--step-0); }
.sum { margin: 0; display: grid; gap: 6px; }
.sum div { display: flex; justify-content: space-between; gap: 12px; }
.sum dt { color: var(--muted); }
.sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.sum__save dd { color: var(--ok); }
.sum__total { padding-top: 8px; border-top: 1px solid var(--line); font-size: var(--step-1); font-weight: 600; }
.sum__total dt { color: var(--fg); }
.ship-progress { font-size: var(--step--1); display: grid; gap: 6px; }
.ship-progress__bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.ship-progress__bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.empty-cart { display: grid; gap: 6px; justify-items: start; padding: 26px 0; }
.empty-cart__t { font: 500 var(--step-2) var(--font-head); margin: 0; }
.empty-cart--page { padding: 40px 0 80px; }

/* хлебные крошки, заголовки */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0 8px; color: var(--muted); font-size: var(--step--1); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.page-title { font-size: var(--step-4); margin: 6px 0 24px; }
.sec-t { font-size: var(--step-3); margin: 48px 0 20px; }

/* каталог */
.cat-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 6px 0 14px; }
.cat-head h1 { font-size: var(--step-4); }
.cat-count { color: var(--muted); margin: 0; }
.cat-search input { width: min(520px, 100%); height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--bg); }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 6px; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; padding-bottom: 72px; }
.cat-main { --cols: 3; }
.cat-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin: 10px 0 18px; }
.cat-sort select { height: 40px; padding: 0 10px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-btn); margin-left: 6px; }
.filters-btn { display: none; }
.filters { position: sticky; top: 90px; display: grid; gap: 4px; }
.filters__top, .filters__foot .filters__apply { display: none; }
.fgroup { border: 0; padding: 0 0 16px; margin: 0 0 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.fgroup legend { font-weight: 600; padding: 0 0 8px; }
.fopt { display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: pointer; font-size: var(--step--1); }
.fopt input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.fopt i { margin-left: auto; font-style: normal; color: var(--muted); font-size: 12px; }
.fopt.is-zero { opacity: .45; }
.frange { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.frange input { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--bg); }
.filters__foot { display: flex; gap: 8px; padding-top: 6px; }
.empty { text-align: center; padding: 60px 20px; }
.empty__t { font: 500 var(--step-2) var(--font-head); }

/* карточка товара */
.product { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: start; padding: 8px 0 40px; }
.gallery__main { position: relative; background: var(--card-bg); border-radius: var(--radius); overflow: hidden; }
.gallery__main img { width: 100%; }
.gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.9); }
.gallery__nav--l { left: 12px; } .gallery__nav--r { right: 12px; }
.gallery__nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; }
.gallery__thumbs button { width: 72px; padding: 0; border: 1px solid transparent; background: var(--card-bg); border-radius: var(--radius); overflow: hidden; }
.gallery__thumbs button[aria-current] { border-color: var(--fg); }
.product__buy { position: sticky; top: 96px; display: grid; gap: 14px; }
.pbadge { justify-self: start; padding: 3px 10px; background: var(--fg); color: var(--bg); font-size: 12px; border-radius: var(--radius-btn); }
.ptitle { font-size: var(--step-3); }
.pmeta { color: var(--muted); margin: -6px 0 0; }
.pprice { margin: 0; display: flex; align-items: baseline; gap: 10px; font-size: var(--step-3); }
.pvars__l { margin: 0 0 8px; color: var(--muted); }
.pvars__l b { color: var(--fg); font-weight: 500; }
.pvars__list { display: flex; flex-wrap: wrap; gap: 8px; }
.pbuy { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.pbuy .btn { flex: 1; min-width: 220px; }
.pfav { width: 54px; height: 54px; border: 1px solid var(--line); border-radius: var(--radius-btn); }
.pstock { margin: 0; color: var(--ok); font-size: var(--step--1); }
.pfacts { list-style: none; padding: 14px 0 0; margin: 0; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: var(--step--1); }
.pfacts li { padding-left: 22px; position: relative; }
.pfacts li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.pinfo { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; padding: 40px 0; border-top: 1px solid var(--line); }
.pinfo h2 { font-size: var(--step-2); margin-bottom: 14px; }
.specs { margin: 0; display: grid; }
.specs div { display: grid; grid-template-columns: 44% 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.related { padding: 8px 0 80px; }
.related__t { font-size: var(--step-3); margin-bottom: 20px; }

/* корзина и оформление */
.cartpage, .checkout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; align-items: start; padding-bottom: 80px; }
.cartpage__lines .line { grid-template-columns: 110px 1fr; }
.cartpage__side, .checkout__side { position: sticky; top: 96px; display: grid; gap: 16px; padding: 24px; background: var(--soft); border-radius: var(--radius); }
.promo { display: grid; gap: 6px; }
.promo label { font-weight: 500; }
.promo div { display: flex; gap: 8px; }
.promo input { flex: 1; min-width: 0; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--bg); text-transform: uppercase; }
.promo__msg { font-size: 12px; color: var(--muted); margin: 0; }
.cbox { border: 0; padding: 0 0 26px; margin: 0 0 26px; border-bottom: 1px solid var(--line); min-width: 0; }
.cbox legend { font: 500 var(--step-2) var(--font-head); padding: 0 0 14px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.cbox > .fields:first-of-type { margin-top: 0; }
.field { display: grid; gap: 6px; font-size: var(--step--1); color: var(--muted); }
.field--wide { grid-column: 1 / -1; }
.field input, .field textarea { height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-btn); background: var(--bg); color: var(--fg); font-size: var(--step-0); }
.field textarea { height: auto; padding: 12px 14px; resize: vertical; }
[aria-invalid="true"] { border-color: var(--sale) !important; box-shadow: 0 0 0 1px var(--sale); }
.opts { display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.opt:has(input:checked) { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.opt input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.opt span { display: grid; }
.opt small { color: var(--muted); }
.opt em { font-style: normal; font-size: var(--step--1); color: var(--muted); text-align: right; }
.slots { margin-top: 18px; display: grid; gap: 10px; }
.slots__l { margin: 0; font-weight: 500; }
.slots__days, .slots__win { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-r { position: relative; }
.chip-r input { position: absolute; opacity: 0; inset: 0; }
.chip-r span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-btn); font-size: var(--step--1); cursor: pointer; }
.chip-r input:checked + span { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.chip-r input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: var(--step--1); color: var(--muted); }
.agree input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.form-err { color: var(--sale); margin: 12px 0 0; }
.checkout__t { font: 500 var(--step-2) var(--font-head); margin: 0; }
.olines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 300px; overflow: auto; }
.olines li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; font-size: var(--step--1); }
.olines img { border-radius: var(--radius); background: var(--card-bg); aspect-ratio: 4/5; object-fit: cover; }
.olines span { display: grid; }
.olines small { color: var(--muted); }
.done { max-width: 620px; padding: 30px 0 90px; display: grid; gap: 12px; justify-items: start; }
.done__k { margin: 0; color: var(--ok); font-weight: 600; }
.done__t { font-size: var(--step-4); }
.done .sum { width: 100%; padding: 16px 0; }
.credits { list-style: none; padding: 0; display: grid; gap: 12px; }
.credits li { display: flex; gap: 14px; align-items: center; font-size: var(--step--1); }
.credits img { width: 64px; flex: none; border-radius: var(--radius); }
.lost { padding: 30px 0 80px; }
.lost__code { font: 600 clamp(80px, 14vw, 180px)/1 var(--font-head); margin: 0; color: var(--line); }

/* появление */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--d, 0) * 70ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; transition: none; } * { scroll-behavior: auto; } }

/* планшет и телефон */
@media (max-width: 1100px) {
  .grid { --cols: 3; }
  .cat-main { --cols: 2; }
  .product { gap: 32px; }
}
@media (max-width: 860px) {
  :root { --pad: 16px; --gap: 14px; }
  .grid, .cat-main { --cols: 2; }
  .cat-layout { grid-template-columns: 1fr; gap: 0; }
  .filters-btn { display: inline-flex; margin-right: auto; }
  .filters { position: fixed; top: 0; left: 0; bottom: 0; width: min(380px, 100%); background: var(--bg); z-index: 70; padding: 0 20px 20px; overflow: auto; transform: translateX(-100%); visibility: hidden; transition: transform .3s; display: block; }
  .filters.is-open { transform: none; visibility: visible; }
  .filters__top { display: flex; margin: 0 -20px 16px; }
  .filters__foot .filters__apply { display: inline-flex; flex: 1; }
  .filters__foot { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
  .product, .pinfo, .cartpage, .checkout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .product__buy, .cartpage__side, .checkout__side { position: static; }
  .fields { grid-template-columns: 1fr; }
  .pbuy .btn { min-width: 0; }
  .cartpage__lines .line { grid-template-columns: 84px minmax(0, 1fr); }
  .line__row { flex-wrap: wrap; }
  .card__body { padding-top: 10px; }
  .card__add { min-height: 40px; padding: 0 12px; font-size: var(--step--1); }
  .opt { grid-template-columns: auto 1fr; }
  .opt em { grid-column: 2; text-align: left; }
}
