/* «ПІМАШ Валенки» — самостоятельное оформление по вывеске и баннеру. */
:root {
  --red: #e0141c;
  --red-sign: #b80f16;
  --red-deep: #8e0a10;
  --gold: #ffc629;
  --gold-deep: #e6a200;
  --cream: #fff5e6;
  --felt: #f5e5ca;
  --tile: #fff;
  --brown: #4a2b1d;
  --brown-soft: #7a5844;
  --display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --top: 76px;
  --pad: clamp(14px, 4vw, 48px);
  --spring: cubic-bezier(.2, 1.35, .35, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* Фактура войлока: мелкий шум без картинок-файлов */
  --grain: 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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .18 0 0 0 0 .08 0 0 0 .13 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 70px); -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
body { margin: 0; overflow-x: clip; background: var(--cream) var(--grain); color: var(--brown); font: 600 16px/1.45 var(--body); }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1.08; text-wrap: balance; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
a { color: inherit; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 99px; background: var(--gold); }
.skip:focus { top: 12px; }

/* ---------- Шапка-вывеска ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: var(--top); padding: 0 var(--pad); color: var(--cream); background: var(--red-sign) var(--grain); border-bottom: 3px solid var(--gold); box-shadow: 0 6px 22px rgb(74 12 8 / .28); }
.brand { margin-right: auto; flex: none; }
.brand img { width: auto; height: 50px; }
.top-nav { display: flex; gap: 2px; margin-right: auto; }
.top-nav button { position: relative; padding: 10px 12px; font: 800 14px var(--display); white-space: nowrap; }
.top-nav button::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 3px; border-radius: 3px; background: var(--gold); transform: scaleX(0); transition: transform .35s var(--spring); }
.top-nav button:hover::after, .top-nav button.on::after { transform: scaleX(1); }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; transition: background .2s; }
.icon-btn:hover { background: rgb(255 255 255 / .14); }
.burger { display: none; }
.cart-btn { position: relative; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 14px; border-radius: 99px; background: var(--gold); color: var(--brown); font: 800 14px var(--display); box-shadow: 0 3px 0 var(--gold-deep); }
.cart-btn.bump { animation: bump .55s var(--spring); }
.badge { position: absolute; top: -6px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border: 2px solid var(--red-sign); border-radius: 99px; background: #fff; color: var(--red); font: 900 11px/18px var(--display); text-align: center; }
@keyframes bump { 35% { transform: scale(1.16) rotate(-4deg); } }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 26px; border-radius: 99px; font: 800 15px/1.2 var(--display); text-decoration: none; text-align: center; transition: transform .2s var(--spring), box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-deep), 0 10px 24px rgb(224 20 28 / .28); }
.btn-gold { background: var(--gold); color: var(--brown); box-shadow: 0 4px 0 var(--gold-deep), 0 10px 24px rgb(230 162 0 / .24); }
.btn-line { border: 2px solid currentColor; }
.btn-wide { width: 100%; }

/* ---------- Орнаментная лента ---------- */
.ribbon { position: relative; height: 38px; overflow: hidden; background: var(--red) ; border-block: 2px solid var(--gold); }
.ribbon::before { content: ""; position: absolute; inset: 4px -70px 4px 0; background: url("assets/ornament.webp") repeat-x left center / auto 100%; animation: ribbon 7s linear infinite; }
.ribbon-back::before { animation-direction: reverse; }
@keyframes ribbon { to { transform: translateX(-31.92px); } }

/* ---------- Обложка ---------- */
.hero { position: relative; overflow: hidden; height: clamp(520px, calc(100svh - var(--top) - 70px), 780px); background: #f9e6cc; }
.hero-art, .hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art img { object-fit: cover; object-position: right 62%; animation: settle 2.4s var(--ease) both; }
.snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-text { position: relative; width: min(620px, 52%); height: 100%; display: flex; flex-direction: column; justify-content: center; padding-left: max(var(--pad), calc((100% - 1500px) / 2)); }
.hero h1 { font-size: clamp(44px, 6.2vw, 94px); font-weight: 900; line-height: .98; letter-spacing: -.02em; color: var(--red); text-shadow: 0 3px 0 #fff, 0 8px 26px rgb(255 240 215 / .9); }
.hero h1 span { display: block; animation: drop .9s var(--spring) both; }
.hero h1 span:nth-child(2) { animation-delay: .12s; }
.hero h1 span:nth-child(3) { animation-delay: .24s; }
.hero-kz { margin-top: 16px; font: 800 clamp(20px, 2.2vw, 32px)/1.2 var(--display); animation: appear .7s .45s both; }
.hero-shop { margin-top: 12px; color: var(--brown-soft); font-weight: 700; animation: appear .7s .55s both; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; animation: appear .7s .65s both; }
@keyframes settle { from { transform: scale(1.09); } }
@keyframes drop { from { opacity: 0; transform: translateY(-46px) rotate(-3deg); } }
@keyframes appear { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Полка разделов ---------- */
.shelf { background: var(--red-sign) var(--grain); color: var(--cream); }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(12px, 2.4vw, 34px); max-width: 1320px; margin: 0 auto; padding: 38px var(--pad) 22px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.tile i { display: block; width: 100%; max-width: 210px; aspect-ratio: 1; padding: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 12px 26px rgb(45 0 0 / .35); transition: transform .45s var(--spring); }
.tile img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid var(--cream); }
.tile:hover i, .tile:focus-visible i { transform: translateY(-8px) rotate(-5deg) scale(1.04); }
.tile b { margin-top: 8px; font: 800 clamp(13px, 1.35vw, 18px)/1.2 var(--display); }
.tile small { color: #ffdc8a; font-size: 13px; }
.pill { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px; width: fit-content; max-width: calc(100% - 28px); margin: 0 auto 30px; padding: 12px 30px; border: 2px solid var(--gold); border-radius: 99px; background: var(--cream); color: var(--red-sign); font: 800 15px/1.35 var(--display); text-align: center; }
.pill span { color: var(--brown); }

/* ---------- Каталог ---------- */
.catalog { max-width: 1420px; margin: 0 auto; padding: 46px var(--pad) 30px; }
.catalog > h2, .how h2 { font-size: clamp(32px, 4.6vw, 58px); font-weight: 900; color: var(--red); }
.tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 6px; }
.search { position: relative; flex: 1 1 280px; }
.search svg { position: absolute; left: 16px; top: 13px; width: 22px; height: 22px; color: var(--red); }
.search input, .select select { width: 100%; height: 48px; border: 2px solid #ead3ae; border-radius: 99px; background-color: var(--tile); }
.search input { padding: 0 16px 0 48px; }
.search input:focus, .select select:focus { border-color: var(--red); }
.select select { appearance: none; padding: 0 40px 0 18px; font-weight: 800; background: var(--tile) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23b80f16' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center; cursor: pointer; }
.select select.active { border-color: var(--red); background-color: #fff0d0; }
.tabs-wrap { position: sticky; top: var(--top); z-index: 10; margin: 0 calc(var(--pad) * -1); padding: 10px var(--pad); background: var(--cream) var(--grain); }
.tabs-wrap.stuck { box-shadow: 0 10px 18px -12px rgb(74 43 29 / .4); }
.tabs { position: relative; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 3px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; z-index: 1; flex: none; padding: 12px 20px; border-radius: 99px; font: 800 14px var(--display); white-space: nowrap; transition: color .3s; }
.tabs button:not(.on):hover { background: var(--felt); }
.tabs button.on { color: #fff; }
.tabs button sup { margin-left: 5px; font-size: 11px; opacity: .65; }
.tab-ink { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 99px; background: var(--red); box-shadow: 0 3px 0 var(--red-deep); transition: transform .5s var(--spring), width .5s var(--spring); }
.found { min-height: 22px; margin: 6px 0; color: var(--brown-soft); font-size: 14px; }
.loading, .empty { padding: 60px 16px; text-align: center; color: var(--brown-soft); }
.empty img { width: 120px; margin: 0 auto 14px; }
.empty .btn { margin-top: 18px; }

.group { margin-bottom: 44px; }
.group-head { display: flex; align-items: center; gap: 14px; margin: 22px 0 18px; }
.group-head img { width: 62px; height: 62px; border-radius: 50%; border: 3px solid var(--gold); object-fit: cover; }
.group-head h3 { font-size: clamp(22px, 2.8vw, 32px); font-weight: 900; }
.group-head small { display: block; color: var(--brown-soft); font: 700 14px var(--body); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 46%), 1fr)); gap: clamp(10px, 1.8vw, 24px); }

/* ---------- Карточка товара ---------- */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 8px; border-radius: 26px; background: var(--tile); box-shadow: 0 2px 0 #ecd5ae, 0 10px 30px -18px rgb(110 55 15 / .45); transition: transform .35s var(--spring), box-shadow .3s; }
.card:hover { transform: translateY(-6px); box-shadow: 0 2px 0 #ecd5ae, 0 24px 40px -20px rgb(160 20 10 / .45); }
/* Стежок по войлоку: пунктир, который «прошивается» при наведении */
.card::after { content: ""; position: absolute; inset: 4px; border: 2px dashed var(--gold); border-radius: 22px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.card:hover::after, .card:focus-within::after { opacity: 1; animation: stitch .8s steps(8) 1; }
@keyframes stitch { from { clip-path: inset(0 100% 100% 0); } 50% { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.card-photo { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 19px; background: #fff; }
.cat-valenki .card-photo, .cat-tapki .card-photo { aspect-ratio: 1; }
.card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .45s, transform .7s var(--ease); }
.card-photo.cover img { object-fit: cover; }
.card-photo .alt { opacity: 0; }
.card:hover .card-photo img { transform: scale(1.055); }
@media (hover: hover) { .card:hover .card-photo .alt { opacity: 1; } .card:hover .card-photo.has-alt .main { opacity: 0; } }
.no-photo { display: grid; place-content: center; justify-items: center; gap: 12px; width: 100%; height: 100%; background: var(--red) var(--grain); color: var(--cream); font: 800 14px var(--display); text-align: center; }
.no-photo img { position: static; width: 46%; height: auto; }
.card-photo .no-photo img { position: static; width: 46%; height: auto; }
.swatches { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 8px 0; }
.swatches button { position: relative; z-index: 2; width: 32px; height: 32px; padding: 2px; border: 2px solid transparent; border-radius: 50%; transition: transform .2s var(--spring), border-color .2s; }
.swatches button:hover { transform: scale(1.15); }
.swatches button[aria-pressed="true"] { border-color: var(--red); }
.swatches img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.swatches small { color: var(--brown-soft); }
.card-info { display: flex; flex-direction: column; flex: 1; padding: 6px 8px 8px; }
.card-kind { color: var(--brown-soft); font-size: 13px; line-height: 1.3; }
.card h4 { margin: 2px 0 0; font: 800 clamp(14px, 1.5vw, 18px)/1.22 var(--display); overflow-wrap: anywhere; }
.card h4 a { text-decoration: none; }
.card h4 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 26px; }
.card-sizes { margin-top: 5px; color: var(--brown-soft); font-size: 13px; }
.card-buy { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; }
.price { color: var(--red); font: 900 clamp(16px, 1.8vw, 22px)/1.15 var(--display); font-variant-numeric: tabular-nums; }
.price.ask { color: var(--brown); font-size: 14px; font-weight: 800; }
.add { position: relative; z-index: 2; display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--gold); box-shadow: 0 3px 0 var(--gold-deep); transition: transform .25s var(--spring), background .2s; }
.add:hover { transform: scale(1.1) rotate(90deg); }
.add.done { background: var(--red); color: #fff; box-shadow: 0 3px 0 var(--red-deep); transform: none; }

/* ---------- Как заказать и подвал ---------- */
.how { max-width: 1420px; margin: 0 auto; padding: 30px var(--pad) 64px; }
.how ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 26px 0 0; padding: 0; list-style: none; counter-reset: step; }
.how li { counter-increment: step; padding: 24px; border: 2px dashed var(--gold-deep); border-radius: 28px; background: var(--tile); }
.how li::before { content: counter(step); display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 50%; background: var(--red); color: var(--gold); font: 900 22px var(--display); }
.how h3 { margin-bottom: 8px; font-size: 19px; }
.how p { color: var(--brown-soft); }
.foot { padding-bottom: 34px; background: var(--red-sign) var(--grain); color: var(--cream); text-align: center; }
.foot-logo { width: min(250px, 60vw); height: auto; margin: 38px auto 18px; filter: drop-shadow(0 14px 22px rgb(40 0 0 / .4)); }
.foot-tag { font: 900 clamp(22px, 3vw, 34px)/1.35 var(--display); }
.foot-note { max-width: 640px; margin: 22px auto 0; padding: 0 var(--pad); color: #ffd9c9; font-size: 13px; }

.cart-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 18; display: none; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border: 2px solid var(--gold); border-radius: 99px; background: var(--red); color: #fff; box-shadow: 0 14px 34px rgb(90 0 0 / .4); font-variant-numeric: tabular-nums; animation: rise .5s var(--spring); }
.cart-bar b { font: 800 14px var(--display); color: var(--gold); }
@keyframes rise { from { transform: translateY(130%); } }

/* ---------- Окна ---------- */
dialog { padding: 0; border: 0; color: var(--brown); background: var(--cream) var(--grain); }
dialog::backdrop { background: rgb(50 12 6 / .62); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }

.menu { position: fixed; inset: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; overflow-y: auto; background-color: var(--red-sign); color: var(--cream); }
.menu[open] { animation: menu-in .45s var(--ease); }
@keyframes menu-in { from { clip-path: circle(0 at 30px 34px); } to { clip-path: circle(150% at 30px 34px); } }
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.menu-head img { width: auto; height: 50px; }
.menu nav { display: grid; gap: 10px; padding: 18px 16px; }
.menu nav button { display: flex; align-items: center; gap: 14px; padding: 8px; border-radius: 99px; background: rgb(255 245 230 / .1); text-align: left; font: 800 17px/1.2 var(--display); }
.menu[open] nav button { animation: slide-in .55s var(--spring) both; animation-delay: calc(var(--i) * 55ms + .12s); }
.menu nav img { width: 62px; height: 62px; border: 3px solid var(--gold); border-radius: 50%; object-fit: cover; }
.menu nav small { display: block; color: #ffdc8a; font: 700 13px var(--body); }
.menu-link { display: block; margin: 0 16px 30px; padding: 14px; border: 2px solid var(--gold); border-radius: 99px; text-align: center; text-decoration: none; font: 800 15px var(--display); }
@keyframes slide-in { from { opacity: 0; transform: translateX(-46px); } }

/* Карточка-окно */
.product { width: min(1120px, calc(100% - 40px)); max-width: none; height: min(760px, calc(100dvh - 40px)); max-height: none; overflow: hidden; border-radius: 34px; box-shadow: 0 40px 90px rgb(40 0 0 / .5); }
.product[open] { animation: pop .4s var(--ease); }
.product.morph[open], .product.still[open] { animation: none; }
@keyframes pop { from { opacity: 0; transform: translateY(30px) scale(.96); } }
.sheet { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100%; }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 5; background: var(--red); color: #fff; box-shadow: 0 4px 14px rgb(90 0 0 / .35); }
.sheet-close:hover { background: var(--red-deep); }
.grab { display: none; }
.gallery { position: relative; display: flex; flex-direction: column; min-height: 0; padding: 14px; background: #fff; }
.slides { display: flex; flex: 1; min-height: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slides figure { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.slides img { width: 100%; height: 100%; object-fit: contain; }
.slides figure > .no-photo { border-radius: 22px; }
.slides .no-photo img { width: 40%; height: auto; }
/* safe: когда миниатюр много, первые не уезжают за левый край */
.thumbs { display: flex; justify-content: safe center; gap: 8px; padding-top: 10px; overflow-x: auto; }
.thumbs button { width: 66px; height: 66px; flex: none; padding: 3px; border: 2px solid #eedcbc; border-radius: 16px; }
.thumbs button[aria-current="true"] { border-color: var(--red); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.thumbs.round button, .thumbs.round img { border-radius: 50%; }
.info { display: flex; flex-direction: column; min-height: 0; }
.info-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 30px 30px 20px; overscroll-behavior: contain; }
.info h2 { margin-top: 4px; padding-right: 44px; font-size: clamp(22px, 2.6vw, 34px); font-weight: 900; overflow-wrap: anywhere; }
.info .price { display: inline-block; margin-top: 12px; font-size: 32px; }
.info .price.ask { font-size: 20px; }
.info fieldset, .quick-sheet fieldset { min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.info legend, .quick-sheet legend { margin-bottom: 10px; padding: 0; font: 800 14px var(--display); }
.colors { display: flex; flex-wrap: wrap; gap: 8px; }
.colors button { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 14px 4px 4px; border: 2px solid #ead3ae; border-radius: 99px; background: var(--tile); font-size: 14px; text-align: left; line-height: 1.2; transition: border-color .2s, transform .2s var(--spring); }
.colors img { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; }
.colors button[aria-pressed="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.sizes button { min-width: 56px; min-height: 50px; padding: 6px 14px; border: 2px solid #ead3ae; border-radius: 16px; background: var(--tile); font: 800 16px/1.15 var(--display); transition: transform .2s var(--spring), background .2s; }
.sizes button small { display: block; font: 700 11px var(--body); opacity: .75; }
.sizes button:hover { transform: translateY(-3px); }
.sizes button[aria-pressed="true"] { border-color: var(--red); background: var(--red); color: #fff; }
.sizes.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.stock { min-height: 22px; margin-top: 10px; color: var(--brown-soft); font-size: 14px; }
.note { margin-top: 16px; padding: 12px 16px; border-radius: 18px; background: #ffe9ae; font-size: 14px; }
.info dl { margin: 22px 0 0; }
.info dl div { display: flex; gap: 14px; justify-content: space-between; padding: 9px 0; border-bottom: 2px dotted #e0c493; font-size: 14px; }
.info dt { color: var(--brown-soft); }
.info dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.more { margin-top: 28px; }
.more h3 { margin-bottom: 12px; font-size: 16px; }
.more-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.more-row button { width: 104px; flex: none; text-align: left; font-size: 12px; line-height: 1.25; }
.more-row img, .more-row .no-photo { width: 104px; height: 120px; margin-bottom: 5px; border-radius: 16px; background-color: #fff; object-fit: cover; }
.buy { padding: 14px 30px 18px; border-top: 3px solid var(--gold); background: var(--tile); }
.buy .btn + .btn { margin-top: 10px; }
.buy .to-cart { color: var(--red); }

/* Быстрый выбор размеров */
.product.quick { width: min(480px, calc(100% - 40px)); height: fit-content; max-height: calc(100dvh - 40px); }
.quick-sheet { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.quick-head { display: flex; gap: 14px; align-items: center; padding: 18px 70px 14px 20px; border-bottom: 3px solid var(--gold); background: #fff; }
.quick-head > img, .quick-head > .no-photo { width: 76px; height: 92px; flex: none; border-radius: 14px; object-fit: cover; }
.quick-head > .no-photo img { width: 60%; }
.quick-head h2 { margin: 0; font: 900 19px/1.2 var(--display); overflow-wrap: anywhere; }
.product.quick .info-scroll { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 4px 20px 16px; }
.quick-sheet fieldset { margin-top: 14px; }
.all-photos { margin-top: 10px; }
.quick-hint { margin: 16px 0 10px; color: var(--brown-soft); font-size: 13px; }
.size-rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.size-rows li { display: grid; grid-template-columns: minmax(62px, 1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border: 2px solid #ead3ae; border-radius: 18px; background: var(--tile); }
.size-rows li.chosen { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.size-rows li.out { opacity: .5; }
.size-rows b { font: 900 18px/1.15 var(--display); }
.size-rows small { display: block; color: var(--brown-soft); font: 700 11px/1.3 var(--body); }
.size-rows .price { display: block; margin: 0; font-size: 16px; }
.size-rows .price.ask { font-size: 13px; }
.item p.item-note { margin-top: 4px; color: var(--red); font-weight: 800; }

/* Корзина */
.cart { position: fixed; inset: 0 0 0 auto; width: min(480px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; }
.cart[open] { display: flex; flex-direction: column; animation: drawer .45s var(--ease); }
@keyframes drawer { from { transform: translateX(100%); } }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 3px solid var(--gold); background: var(--red-sign) var(--grain); color: var(--cream); }
.cart-head h2 { font-size: 24px; font-weight: 900; }
.cart-body { flex: 1; overflow-y: auto; padding: 14px; overscroll-behavior: contain; }
.item { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; margin-bottom: 10px; padding: 10px; border-radius: 20px; background: var(--tile); }
.item > img, .item > .no-photo { width: 82px; height: 100px; border-radius: 14px; object-fit: cover; }
.item > .no-photo img { width: 60%; }
.item h3 { font-size: 14px; }
.item p { color: var(--brown-soft); font-size: 13px; }
.item-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.qty { display: flex; align-items: center; border: 2px solid #ead3ae; border-radius: 99px; }
.qty button { width: 40px; height: 38px; font: 900 18px var(--display); color: var(--red); }
.qty button:disabled { opacity: .3; cursor: default; }
.qty output { min-width: 26px; text-align: center; font-weight: 800; }
.item .price { font-size: 16px; }
.item .price.ask { font-size: 13px; }
.remove { color: var(--brown-soft); font-size: 13px; text-decoration: underline; padding: 6px 0; }
.cart-foot { padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); border-top: 3px solid var(--gold); background: var(--tile); }
.cart-foot:empty { display: none; }
.total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font: 800 17px var(--display); }
.total b { color: var(--red); font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.cart-foot p { margin: 6px 0 12px; color: var(--brown-soft); font-size: 13px; }
.cart-foot .btn + .btn { margin-top: 10px; }
.cart-foot textarea { width: 100%; height: 130px; margin-top: 10px; padding: 10px; border: 2px solid #ead3ae; border-radius: 14px; font: 500 13px/1.4 var(--body); color: var(--brown); }

.toast { position: fixed; left: 50%; bottom: 26px; z-index: 40; display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100% - 28px); padding: 12px 20px; border: 2px solid var(--gold); border-radius: 99px; background: var(--brown); color: var(--cream); font-size: 14px; opacity: 0; visibility: hidden; transform: translate(-50%, 24px); transition: .4s var(--spring); }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast button { color: var(--gold); font: 800 14px var(--display); }
.fly { position: fixed; z-index: 60; margin: 0; border-radius: 20px; object-fit: cover; pointer-events: none; box-shadow: 0 18px 34px rgb(60 0 0 / .35); }
::view-transition-group(photo) { animation-duration: .45s; animation-timing-function: var(--ease); }
::view-transition-old(photo), ::view-transition-new(photo) { height: 100%; object-fit: contain; }

/* ---------- Планшет и телефон ---------- */
@media (max-width: 1180px) {
  .top-nav { display: none; }
  .burger { display: grid; }
  .brand { margin-right: auto; }
}
@media (max-width: 860px) {
  .how ol { grid-template-columns: 1fr; }
  .tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 10px; padding-top: 26px; }
  .tile { width: calc((100% - 20px) / 3); }
  .product { inset: auto 0 0; width: 100%; height: 95dvh; margin: 0; border-radius: 30px 30px 0 0; }
  .product.quick { width: 100%; height: fit-content; max-height: 92dvh; }
  .quick-sheet { max-height: 92dvh; }
  .quick-head { padding-top: 28px; }
  .product.quick .info-scroll { padding: 4px 14px 14px; }
  .product.quick .buy { position: static; }
  .product[open] { animation: sheet-up .45s var(--ease); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  .sheet { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
  .grab { display: block; position: absolute; top: 0; left: 50%; z-index: 4; width: 140px; height: 34px; transform: translateX(-50%); touch-action: none; cursor: grab; }
  .grab::after { content: ""; position: absolute; top: 9px; left: 45px; width: 50px; height: 5px; border-radius: 5px; background: rgb(74 43 29 / .35); }
  .gallery { flex: none; padding: 22px 10px 10px; }
  .slides { flex: none; height: min(52dvh, 125vw); }
  .info { flex: none; }
  .info-scroll { overflow: visible; padding: 18px 18px 20px; }
  .info h2 { padding-right: 0; }
  .buy { position: sticky; bottom: 0; z-index: 3; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  :root { --top: 62px; }
  .top { gap: 4px; padding: 0 8px; }
  .brand img { height: 38px; }
  .cart-label { display: none; }
  .cart-btn { width: 46px; justify-content: center; padding: 0; }
  .ribbon { height: 28px; }
  .ribbon::before { animation-name: ribbon-small; }
  @keyframes ribbon-small { to { transform: translateX(-22.8px); } }
  .hero { height: auto; }
  .hero-art, .hero-art img { position: static; height: auto; }
  .hero-art img { width: 100%; aspect-ratio: 2 / 3; object-position: center top; transform-origin: bottom; }
  .hero-art { display: block; overflow: hidden; }
  .snow { height: auto; aspect-ratio: 2 / 3; }
  .hero-text { position: static; display: block; width: auto; height: auto; padding: 0; text-align: center; }
  .hero h1 { position: absolute; top: 8vw; left: 2%; right: 2%; font-size: 10vw; line-height: 1.04; white-space: nowrap; }
  .hero h1 span { display: inline; }
  .hero h1 span:first-child { display: block; }
  .hero-kz { position: absolute; top: 33vw; left: 10%; right: 10%; margin: 0; font-size: 5vw; }
  .hero-shop { padding: 18px 16px 0; }
  .hero-actions { justify-content: center; padding: 0 14px 24px; margin-top: 16px; }
  .hero-actions .btn { flex: 1 1 100%; max-width: 380px; }
  .tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .search { grid-column: 1 / -1; }
  .select select { height: 44px; padding: 0 26px 0 12px; font-size: 13px; background-position: right 10px center; text-overflow: ellipsis; }
  .tabs button { padding: 11px 16px; }
  .card { padding: 6px; border-radius: 20px; }
  .card::after { border-radius: 17px; inset: 3px; }
  .card-photo { border-radius: 15px; }
  .card-info { padding: 4px 4px 4px; }
  .card-buy { flex-wrap: wrap; }
  .swatches { gap: 2px; padding: 6px 2px 0; }
  .swatches button { width: 28px; height: 28px; }
  .add { width: 44px; height: 44px; }
  .cart-bar:not([hidden]) { display: flex; }
  .foot { padding-bottom: 100px; }
  .toast { bottom: 88px; }
  /* В карточке товара внизу размеры и кнопка — уведомление показывается сверху */
  .product .toast { top: 14px; bottom: auto; }
  .group-head img { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .snow { display: none; }
}
