/* Общие стили для всех дизайнов. Каждый дизайн задаёт свои переменные. */
:root {
  --bg: #F6F2EB; --surface: #FFFDF9; --fg: #161412; --muted: #7A736B; --line: #DDD5CA;
  --accent: #161412; --accent-fg: #F6F2EB; --sale: #9E2A22;
  --ff-display: "Cormorant Garamond", Georgia, serif; --ff-body: "Manrope", system-ui, sans-serif;
  --radius: 0px; --pad: clamp(16px, 4vw, 56px); --maxw: 1440px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
/* Атрибут hidden скрывает элемент всегда, даже если у класса свой display (плашка cookie, счётчик корзины и т. п.) */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.no-scroll, html.menu-open { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.6 var(--ff-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 50px; padding: 0 28px; border: 1px solid var(--accent); border-radius: var(--radius); text-decoration: none; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; transition: background .3s, color .3s; }
.btn--primary { background: var(--accent); color: var(--accent-fg); }
.btn--primary:hover { background: transparent; color: var(--accent); }
.btn--ghost { color: var(--accent); }
.btn--ghost:hover { background: var(--accent); color: var(--accent-fg); }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; font-size: 16px; }
.link { text-decoration: underline; text-underline-offset: 3px; font-size: 12px; color: var(--muted); letter-spacing: 0; text-transform: none; }
.cart-btn { position: relative; }
.cart-btn [data-cart-count] { position: absolute; top: 2px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--accent-fg); font-size: 10px; line-height: 17px; text-align: center; }

/* Фильтры */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; white-space: nowrap; transition: .25s; }
.chip sup { font-size: 9px; margin-left: 3px; color: var(--muted); }
.chip.is-active, .chip:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip.is-active sup, .chip:hover sup { color: inherit; opacity: .6; }

/* Карточка в каталоге */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 20px; }
.card[hidden] { display: none; }
.card__media { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; background: var(--surface); border-radius: var(--radius); }
.card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s var(--ease), transform 1.2s var(--ease); }
.card__img--alt { opacity: 0; }
@media (hover: hover) { .card__media:hover .card__img--alt { opacity: 1; } .card__media:hover .card__img { transform: scale(1.03); } }
.card__info { padding-top: 14px; }
.card__name { font: inherit; font-size: 14px; line-height: 1.35; }
.card__name a, .card__name button { text-align: left; text-decoration: none; }
.card__media picture, .pm__thumb picture, .pm__stage picture { display: contents; }
.cart__item picture, .co__summary picture { display: contents; }
.card__price { margin: 4px 0 0; font-size: 14px; }
.card__meta { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.price--old { color: var(--muted); margin-left: 6px; font-size: .9em; }
.price--sale { color: var(--sale); }
.price--none { color: var(--muted); font-style: italic; }
.badge { position: absolute; top: 12px; left: 12px; padding: 4px 9px; font-size: 11px; letter-spacing: .06em; background: var(--bg); color: var(--fg); border-radius: var(--radius); }
.badge--sale { background: var(--sale); color: #fff; }
.pm__price .badge { position: static; margin-left: 8px; vertical-align: middle; }

/* Карточка товара (окно) */
dialog { color: var(--fg); }
.pm { width: min(1180px, 100vw); max-width: 100vw; max-height: 100dvh; height: min(820px, 100dvh); padding: 0; border: 0; background: var(--bg); overflow: hidden; border-radius: var(--radius); }
.pm::backdrop, .sizes-dlg::backdrop { background: rgba(15, 12, 10, .55); backdrop-filter: blur(3px); }
.pm[open] { animation: pm-in .45s var(--ease); }
@keyframes pm-in { from { opacity: 0; transform: translateY(16px); } }
.pm__inner { display: grid; grid-template-columns: 1.15fr 1fr; height: 100%; }
.pm__close { position: absolute; top: 10px; right: 10px; z-index: 3; background: var(--bg); border-radius: 50%; }
.pm__gallery { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 16px; min-height: 0; }
.pm__stage { position: relative; grid-column: 2; grid-row: 1; min-height: 0; background: var(--surface); overflow: hidden; border-radius: var(--radius); }
.pm__photo { width: 100%; height: 100%; object-fit: cover; }
.pm__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .8); color: #111; font-size: 24px; line-height: 1; }
.pm__nav--prev { left: 10px; } .pm__nav--next { right: 10px; }
.pm__thumbs { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scrollbar-width: none; }
.pm__thumb { flex: none; aspect-ratio: 2 / 3; opacity: .5; transition: opacity .2s; overflow: hidden; border-radius: var(--radius); }
.pm__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pm__thumb.is-active, .pm__thumb:hover { opacity: 1; }
.pm__info { padding: 48px 40px 40px; overflow-y: auto; }
.pm__cat { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pm__name { font-family: var(--ff-display); font-size: clamp(28px, 3vw, 40px); line-height: 1.1; margin-bottom: 14px; }
.pm__price { font-size: 18px; }
.pm__salenote { font-size: 12px; color: var(--sale); margin-top: -6px; }
.pm__opt { margin: 22px 0; }
.pm__label { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.pm__colors, .pm__sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 1px solid var(--line); box-shadow: 0 0 0 3px var(--bg); }
.swatch.is-active { box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--fg); }
.size { min-width: 52px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.size.is-active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pm__add, .pm__wa { width: 100%; margin-top: 8px; }
.pm__desc { margin-top: 26px; }
.pm__specs { margin: 18px 0; border-top: 1px solid var(--line); }
.pm__specs div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pm__specs dt { color: var(--muted); } .pm__specs dd { margin: 0; text-align: right; }
details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; font-size: 13px; padding: 10px 0; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; } details[open] summary::after { content: "−"; }
.pm__more { font-size: 13px; color: var(--muted); }
.pm__more + .pm__more { border-top: 1px solid var(--line); }
.care { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.care li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: center; line-height: 1.45; }
.care svg { color: var(--fg, #2A1E18); width: 24px; height: 24px; fill: none; stroke: var(--fg, #2A1E18); stroke-width: 1.1; stroke-linejoin: round; }
.care text { font: 600 6px/1 var(--ff-body, sans-serif); fill: currentColor; stroke: none; color: var(--fg, #2A1E18); }
.care li:last-child text { font-size: 10px; font-weight: 500; }

/* Корзина */
.cart { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.cart__backdrop { position: absolute; inset: 0; background: rgba(15, 12, 10, .5); opacity: 0; transition: opacity .4s; }
.cart__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .5s var(--ease); }
.cart.is-open { pointer-events: auto; }
.cart.is-open .cart__backdrop { opacity: 1; }
.cart.is-open .cart__panel { transform: none; }
.cart__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.cart__head h2 { font-family: var(--ff-display); font-size: 26px; }
.cart__list { flex: 1; overflow-y: auto; padding: 8px 24px; }
.cart__empty { padding: 48px 0; text-align: center; color: var(--muted); }
.cart__item { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart__item img { width: 76px; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--radius); }
.cart__name { font-size: 14px; margin: 0; } .cart__opts { font-size: 12px; color: var(--muted); margin: 2px 0; } .cart__price { font-size: 14px; margin: 0 0 8px; }
.cart__rm { align-self: start; color: var(--muted); padding: 4px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); }
.qty button { width: 32px; height: 30px; } .qty span { min-width: 24px; text-align: center; font-size: 13px; }
.cart__foot { padding: 16px 24px 24px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.cart.is-empty .cart__foot, .cart[data-step="3"] .cart__foot { display: none; }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; margin: 0; }
.cart__total span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cart__nonote, .cart__how { font-size: 12px; color: var(--muted); margin: 0; }
.cart__back { width: 40px; height: 40px; font-size: 18px; visibility: hidden; }
.cart[data-step="2"] .cart__back, .cart[data-step="3"] .cart__back { visibility: visible; }
.cart__head { gap: 8px; } .cart__title { flex: 1; }
.cart__stepper { display: flex; gap: 6px; list-style: none; margin: 0; padding: 12px 24px 0; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cart__stepper li { flex: 1; padding-top: 8px; border-top: 2px solid var(--line); transition: .3s; }
.cart__stepper li.is-on { border-color: var(--fg); color: var(--fg); }
.cart.is-empty .cart__stepper { display: none; }
.cart__body { flex: 1; overflow-y: auto; }
.cart__view { display: none; padding: 8px 24px 20px; }
.cart[data-step="1"] .cart__view--1, .cart[data-step="2"] .cart__view--2, .cart[data-step="3"] .cart__view--3 { display: block; animation: view-in .4s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateX(16px); } }
.cart__list { padding: 0; overflow: visible; }
.cart__actions { display: none; gap: 8px; }
.cart[data-step="1"] .cart__actions--1, .cart[data-step="2"] .cart__actions--2 { display: grid; }
.cart__right { display: grid; justify-items: end; align-content: space-between; }
.cart__rm { font-size: 11px; letter-spacing: .08em; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.cart__empty { display: grid; justify-items: center; gap: 16px; }
.cart__empty p { margin: 0; }
.co__summary { display: flex; align-items: center; gap: 6px; padding: 14px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.co__summary img { width: 38px; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--radius); }
.co__summary span { margin-left: 8px; font-size: 12px; color: var(--muted); }
.co { display: grid; gap: 16px; }
.co__field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.co__field > label:not(.co__opt), .co__field legend { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0; }
.co__field input:not([type=radio]), .co__field textarea { width: 100%; font: 15px var(--ff-body); color: var(--fg); background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 0; resize: vertical; transition: border-color .2s; }
.co__field input:focus, .co__field textarea:focus { outline: none; border-color: var(--fg); }
.co__field.is-bad input, .co__field.is-bad textarea { border-color: var(--sale); }
.co__field.is-bad > label { color: var(--sale); }
.co__field[hidden] { display: none; }
.co__delivery { gap: 8px; }
.co__delivery legend { margin-bottom: 8px; }
.co__opt { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .2s, background .2s; }
.co__opt:has(input:checked) { border-color: var(--fg); background: var(--surface); }
.co__opt input { flex: none; width: 16px; height: 16px; accent-color: var(--fg); margin: 3px 0 0; }
.co__opt b { display: block; font-weight: 500; font-size: 14px; }
.co__opt small { display: block; font-size: 12px; color: var(--muted); }
.co__agree { display: flex; gap: 10px; font-size: 12px; color: var(--muted); align-items: flex-start; }
.co__agree input { accent-color: var(--fg); margin-top: 2px; }
.co__agree.is-bad { color: var(--sale); }
.cart__done { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 40px 8px; }
.cart__done img { width: 64px; }
.cart__done h3 { font-family: var(--ff-display); font-size: 28px; line-height: 1.1; }
.cart__done p { color: var(--muted); font-size: 14px; }

/* Размерная сетка */
.sizes-dlg { width: min(560px, calc(100vw - 32px)); border: 0; padding: 0; background: var(--bg); border-radius: var(--radius); }
.sizes-dlg__inner { position: relative; padding: 36px 28px 24px; }
.sizes-dlg .icon-btn { position: absolute; top: 8px; right: 8px; }
.sizes-dlg h2 { font-family: var(--ff-display); font-size: 30px; margin-bottom: 18px; }
.size-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 16px; }
.size-table th, .size-table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--line); font-weight: 400; }
.size-table thead th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.size-table tbody th { font-weight: 600; }

/* Списки, контакты, уведомление */
.list { padding-left: 1.2em; margin: 0 0 1em; } .list li { margin-bottom: .5em; }
.contacts { list-style: none; margin: 0; padding: 0; }
/* Плашка о cookie */
.consent { position: fixed; z-index: 80; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 560px; margin-inline: auto; display: grid; gap: 12px; padding: 16px 18px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(28, 19, 14, .18); font-size: 13px; line-height: 1.5; }
.consent p { margin: 0; } .consent a { color: inherit; }
.consent__btns { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.consent__yes { min-height: 40px; padding: 0 22px; background: var(--fg); color: var(--bg); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.consent__yes:hover { background: #4A3328; }
.consent__no { min-height: 40px; font-size: 12px; letter-spacing: .08em; text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 4px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 20px); padding: 12px 20px; background: var(--fg); color: var(--bg); font-size: 13px; border-radius: var(--radius); opacity: 0; pointer-events: none; transition: .35s var(--ease); max-width: calc(100vw - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Появление при прокрутке */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } * { animation: none !important; transition: none !important; } }

/* Мобильные */
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; }
  .pm { height: 100dvh; width: 100vw; }
  .pm__inner { display: block; overflow-y: auto; height: 100%; }
  .pm__gallery { display: block; padding: 0; }
  .pm__stage { aspect-ratio: 3 / 4; border-radius: 0; }
  .pm__thumbs { flex-direction: row; overflow-x: auto; padding: 10px 16px 0; }
  .pm__thumb { width: 54px; }
  .pm__info { padding: 22px 16px 40px; overflow: visible; }
  .card__name, .card__price { font-size: 13px; }
}
