/* Мобильная версия сайта L’avantage: токены из src/styles/global.css фронтенда,
   размеры — из CardProduct.astro, shop/index.astro и product/[slug].astro
   (ссылки на кадры Figma — в комментариях там). Сайт только светлый, Mini App тоже. */

/* Inter Variable из @fontsource-variable/inter 5.2.8 — тот же файл, что у сайта. */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("inter-cyrillic.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("inter-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: only light; /* тёмной темы нет — запрещаем и принудительное затемнение */
  --bg: #ffffff;
  --base-200: #f9f9f9;
  --ink-900: #1a1a1a;
  --ink-800: #1e1e1e;
  --ink-700: #484848;
  --ink-500: #6b6b6b;
  --ink-400: #878787;
  --neutral-content: #9b9b9b;
  --line: #dedede;
  --line-strong: #d1d1d1;
  --control-soft: #f2f2f2;
  --primary: #b8080b;
  --primary-hover: #970003;
  --on-primary: #ffffff;
  --gutter: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-700);
  font-size: 14px;
  line-height: 1.25;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(96px + var(--safe-bottom)); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.icon.small { width: 16px; height: 16px; stroke-width: 1.5; }
.muted { color: var(--ink-500); font-weight: 300; }
.page { padding: 0 var(--gutter); }

/* ── шапка (NavBar, мобильная) ─────────────────────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  height: 61px; padding: 0 var(--gutter);
  background: var(--bg);
}
.brand { justify-self: center; display: flex; align-items: center; min-height: 44px; }
.brand img { width: 109px; height: 41px; }
.icon-button, .icon-spacer { display: inline-grid; place-items: center; width: 44px; height: 44px; position: relative; color: var(--ink-700); }
.cart-button { justify-self: end; }
.badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 9px; font-weight: 500; line-height: 16px; text-align: center;
}

/* ── «Фильтр ⫶ Сортировать» (Figma 139:4988) ───────────────────────────── */
.split-bar { display: flex; align-items: stretch; height: 44px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.split-half { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--ink-500); text-align: center; }
.split-divider { width: 1px; background: var(--line); }
.split-count { font-size: 12px; font-weight: 500; color: var(--primary); }
.sort-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }

.search {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 0 0; padding: 0 12px; height: 44px;
  border: 1px solid var(--line-strong); color: var(--ink-400);
}
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--ink-700); font: inherit; font-size: 16px; font-weight: 300; outline: none; }

/* ── сетка и карточка (CardProduct.astro) ──────────────────────────────── */
.grid { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 11px; row-gap: 20px; }
.card { display: flex; flex-direction: column; min-width: 0; padding-top: 10px; background: var(--bg); }
.card-media { display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg); }
.card-media img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.card-actions { display: flex; align-items: center; justify-content: flex-end; min-height: 45px; padding: 10px 4px 0; }
.card-cart { position: relative; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: var(--primary); }
.card-cart::before { content: ""; position: absolute; inset: -5px; } /* область нажатия 45px, как .mobile-product-action */
.card-cart-icon { width: 35px; height: 35px; fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.card-out { font-size: 12px; color: var(--neutral-content); line-height: 35px; }
.card-copy { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%; padding: 10px 0 15px; text-align: center; color: var(--ink-500); }
.card-caption { font-size: 14px; font-weight: 300; line-height: 17px; padding: 0 8px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-name { font-size: 16px; font-weight: 400; line-height: 19px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { font-size: 16px; font-weight: 600; line-height: 19px; text-transform: uppercase; }

.state { display: grid; justify-items: center; gap: 16px; padding: 48px 8px; text-align: center; color: var(--ink-500); font-size: 16px; font-weight: 300; }
.state h1 { font-size: 24px; font-weight: 300; color: var(--ink-700); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── панель фильтров (aside#shop-filters-panel на мобильных) ───────────── */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .4); }
.filters {
  position: fixed; top: 0; right: 0; z-index: 41;
  display: flex; flex-direction: column; gap: 0;
  width: min(320px, 90vw); height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  background: var(--bg); box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  transform: translateX(100%); transition: transform .2s; visibility: hidden;
}
.filters[data-open] { transform: none; visibility: visible; }
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 14px; font-weight: 300; text-transform: uppercase; color: var(--ink-800); }
.filter-group { border-top: 1px solid var(--line); }
.filter-group summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 44px;
  list-style: none; cursor: pointer; font-size: 16px; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-800);
}
.filter-group summary::-webkit-details-marker { display: none; }
.filter-sign::before { content: "+"; font-size: 20px; line-height: 1; color: var(--ink-900); }
.filter-group[open] .filter-sign::before { content: "−"; }
.filter-options { display: flex; flex-direction: column; padding-bottom: 12px; }
.filter-option { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; font-weight: 400; color: var(--ink-500); cursor: pointer; }
.filter-option input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex: none; }
.filters-reset { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 8px 0 12px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; text-transform: uppercase; color: var(--ink-500); }

/* ── кнопки ────────────────────────────────────────────────────────────── */
.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 47px; padding: 0 20px; font-size: 14px; font-weight: 400; text-transform: uppercase;
}
.primary { width: 100%; background: var(--primary); color: var(--on-primary); }
.primary:hover:not(:disabled) { background: var(--primary-hover); }
.secondary { background: var(--base-200); color: var(--ink-700); }
.link { color: var(--primary); text-decoration: underline; text-underline-offset: 4px; font-size: 14px; padding: 8px 0; }

.footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  max-width: 640px; margin: 0 auto;
  padding: 10px var(--gutter) calc(10px + var(--safe-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.split { display: flex; gap: 5px; align-items: stretch; }
.split .primary { flex: 1; }

.stepper { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--line-strong); }
.stepper button { display: grid; place-items: center; width: 36px; height: 100%; color: var(--ink-700); }
.stepper output { min-width: 28px; text-align: center; font-size: 14px; color: var(--ink-700); }
.stepper.tall { height: 47px; }
.stepper.tall button { width: 44px; }

/* ── страница товара ───────────────────────────────────────────────────── */
.product-page { padding-top: 10px; }
.gallery-wrap { margin-bottom: 30px; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border: 1px solid var(--line); }
.gallery::-webkit-scrollbar { display: none; }
.slide { flex: none; width: 100%; aspect-ratio: 343 / 354; overflow: hidden; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; }
.slide img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.3); }
.gallery-empty { display: flex; align-items: center; justify-content: center; aspect-ratio: 343 / 354; border: 1px solid var(--line); color: var(--ink-500); }
.dots { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.dots span[data-active="true"] { background: var(--ink-500); }

.product-info h1 { font-size: 24px; font-weight: 300; line-height: 29px; color: var(--ink-700); }
.rich { overflow-wrap: anywhere; font-size: 14px; font-weight: 300; line-height: 17px; color: var(--ink-500); }
.rich p { margin: 0 0 12px; }
.rich ul, .rich ol { margin: 0 0 12px; padding-left: 20px; }
.rich li { margin-bottom: 4px; }
.rich strong, .rich b { font-weight: 400; }
.rich br { display: block; content: ""; }
.tagline { margin-top: 10px; }
.tagline br { display: initial; }
.price-block { display: flex; flex-direction: column; margin-top: 20px; }
.volume p { font-size: 14px; text-transform: uppercase; color: #000; }
.volume span { display: inline-flex; margin-top: 10px; padding: 8px 10px; border: 1px solid var(--primary); font-size: 14px; line-height: 18px; text-transform: uppercase; color: var(--ink-500); }
.price { margin-top: 20px; font-size: 36px; font-weight: 300; line-height: 44px; color: var(--ink-700); }
.stock-out { margin-top: 4px; color: var(--neutral-content); }
.described { margin-top: 20px; }
.described h2 { font-size: 14px; font-weight: 400; text-transform: uppercase; color: #000; margin-bottom: 20px; }
.summary.collapsed { max-height: 9rem; overflow: hidden; }
.described .link { margin-top: 4px; }

.accordion { margin-top: 30px; }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion details[open] { border-color: var(--primary); }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px;
  list-style: none; cursor: pointer; font-size: 14px; text-transform: uppercase; color: #000;
}
.accordion summary::-webkit-details-marker { display: none; }
.chevron { width: 12px; height: 12px; margin-right: 4px; border-right: 1px solid var(--ink-500); border-bottom: 1px solid var(--ink-500); transform: rotate(45deg); flex: none; }
.accordion details[open] .chevron { transform: rotate(225deg); border-color: var(--primary); }
.accordion .rich { padding: 15px 0; }
.product-links { display: flex; justify-content: center; gap: 24px; margin-top: 20px; }

/* ── корзина ───────────────────────────────────────────────────────────── */
.title { margin: 10px 0 16px; font-size: 24px; font-weight: 300; line-height: 29px; color: var(--ink-700); }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.line { display: flex; gap: 12px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.line-thumb { flex: none; width: 80px; aspect-ratio: 4 / 5; }
.line-thumb img { width: 100%; height: 100%; object-fit: contain; }
.line-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; color: var(--ink-500); }
.line-caption { font-size: 12px; font-weight: 300; }
.line-name { font-size: 16px; overflow-wrap: anywhere; }
.line-meta { font-size: 14px; font-weight: 300; margin-bottom: 6px; }
.line .stepper { align-self: flex-start; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 20px 0 8px; font-size: 16px; text-transform: uppercase; color: var(--ink-700); }
.total strong { font-size: 24px; font-weight: 300; text-transform: none; }
.note { margin-top: 4px; font-size: 14px; font-weight: 300; color: var(--ink-500); }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + var(--safe-bottom)); z-index: 50;
  transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  padding: 10px 16px; background: var(--ink-800); color: #fff; font-size: 14px; box-shadow: 0 6px 24px rgb(0 0 0 / .18);
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
  .filters { transition: none; }
}
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; row-gap: 24px; }
}
