/* lannét glow: дизайн-система по макетам.
   Порядок файла: токены, база, каркас (шапка, подвал), компоненты, страницы, адаптив. */

/* ---------- Шрифты (локально, лицензия OFL, см. static/fonts) ---------- */
@font-face {
  font-family: "Comfortaa";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/comfortaa-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Comfortaa";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/comfortaa-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Токены ---------- */
:root {
  /* цвета из макетов (значения уточнить по Figma) */
  --bg: #E6D9C3;          /* фон страницы */
  --panel: #F8CBC4;       /* панели и карточки */
  --panel-deep: #F2BDB5;  /* вложенные блоки на панели */
  --bar: #C9A9A2;         /* шапка и подвал */
  --field: #FBE6E2;       /* поля ввода */
  --ink: #6B1F2A;         /* заголовки и основной текст */
  --muted: #7A3D47;       /* вторичный текст, контраст не ниже 4.5:1 на панели */
  --btn: #C98E88;         /* кнопки */
  --btn-hover: #BC7F79;
  --icon: #111111;
  --line: rgba(107, 31, 42, 0.22);
  --ok: #2F6B45;
  --warn: #8A5A12;
  --danger: #9B1C2C;

  --font-head: "Comfortaa", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-xs: 10px;
  --r-sm: 16px;
  --r-md: 26px;
  --r-lg: 34px;
  --r-pill: 999px;

  /* мягкие тени, «вдавленные» у полей */
  --shadow-panel: 0 3px 8px rgba(107, 31, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  --shadow-lift: 0 6px 14px rgba(107, 31, 42, 0.25);
  --shadow-inset: inset 0 2px 5px rgba(107, 31, 42, 0.2);

  --gap: 16px;
  --page-w: 1180px;
  --gutter: clamp(12px, 3vw, 28px);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

/* талисман как водяной знак и узор из точек в углу */
body::before {
  content: "";
  position: fixed;
  left: -70px;
  top: 90px;
  width: min(520px, 60vw);
  aspect-ratio: 608 / 735;
  background: url("../img/deer.png") center / contain no-repeat;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  right: 0;
  bottom: 0;
  width: min(460px, 70vw);
  height: min(360px, 50vh);
  background: radial-gradient(circle, rgba(201, 169, 162, 0.7) 0 3.5px, transparent 4.5px) 0 0 / 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse at 100% 100%, #000 15%, transparent 70%);
  mask-image: radial-gradient(ellipse at 100% 100%, #000 15%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.site-header, main, .site-footer { position: relative; z-index: 1; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0 0 12px; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--ink);
}
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.narrow { max-width: 760px; }
.page { padding-top: 20px; padding-bottom: 64px; flex: 1; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.danger { color: var(--danger); }
.text-center { text-align: center; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Шапка ---------- */
.site-header { padding-top: 12px; }

.header-bar {
  display: flex;
  align-items: center;
  gap: 14px 20px;
  flex-wrap: wrap;
  background: var(--bar);
  border-radius: var(--r-md);
  padding: 8px 20px;
  box-shadow: var(--shadow-panel);
}

.brand-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.5px;
  color: var(--ink);
  white-space: nowrap;
}
.brand-logo:hover { text-decoration: none; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px 16px;
  margin-left: auto;
  font-family: var(--font-head);
  font-size: 0.95rem;
}
.main-nav a {
  padding: 6px 4px;
  border-radius: var(--r-pill);
}
.main-nav a:hover { text-decoration: underline; }
.main-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

.search-pill {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--r-pill);
  padding: 0 4px 0 12px;
  height: 36px;
  min-width: 0;
}
.search-pill input {
  border: 0;
  background: transparent;
  height: 100%;
  width: 130px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.search-pill input::placeholder { color: var(--muted); opacity: 1; }
.search-pill:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }

.header-icons { display: flex; align-items: center; gap: 4px; }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--icon);
  border-radius: var(--r-pill);
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.35); text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.cart-badge {
  position: absolute;
  top: 0;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.cart-badge[data-count="0"] { display: none; }

.menu-toggle { display: none; }

/* ---------- Флеш-сообщения ---------- */
.flash-messages { padding-top: 12px; }
.alert {
  border-radius: var(--r-sm);
  padding: 12px 18px;
  margin-bottom: 8px;
  background: var(--field);
  box-shadow: var(--shadow-panel);
  border-left: 6px solid var(--btn);
}
.alert-success { border-left-color: var(--ok); }
.alert-danger, .alert-error { border-left-color: var(--danger); }
.alert-warning { border-left-color: var(--warn); }

/* ---------- Подвал ---------- */
.site-footer {
  margin-top: auto;
  background: var(--bar);
  box-shadow: 0 -3px 8px rgba(107, 31, 42, 0.15);
  padding: 26px 0 18px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 24px;
}
.footer-brand .brand-logo { display: inline-block; margin-bottom: 8px; }
.footer-phone { font-family: var(--font-head); font-size: 1.15rem; }
.footer-col h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 4px; font-size: 14px; }
.footer-col p { font-size: 14px; margin-bottom: 4px; }
.footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 12px;
  font-size: 13px;
  color: var(--ink);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 24px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--btn);
  color: var(--ink);
  font: inherit;
  font-family: var(--font-head);
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-panel);
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--btn-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary { background: transparent; box-shadow: none; border: 1.5px solid var(--ink); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.35); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #561722; }
.btn-danger { background: transparent; color: var(--danger); box-shadow: none; border: 1.5px solid var(--danger); }
.btn-danger:hover { background: rgba(155, 28, 44, 0.1); }
.btn-sm { min-height: 34px; padding: 5px 16px; font-size: 0.88rem; }
.btn-block { width: 100%; }

/* ---------- Формы ---------- */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  margin: 0 0 4px 14px;
  font-family: var(--font-head);
  font-size: 0.95rem;
}
.form-control {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  box-shadow: var(--shadow-inset);
}
textarea.form-control { border-radius: var(--r-md); resize: vertical; min-height: 90px; }
select.form-control { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%236B1F2A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.form-control::placeholder { color: var(--muted); opacity: 0.85; }
.form-control:focus { outline: 3px solid var(--ink); outline-offset: 1px; }
.form-error { margin: 4px 0 0 14px; font-size: 13px; color: var(--danger); font-weight: 700; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }

.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Панели ---------- */
.panel {
  background: var(--panel);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-panel);
  padding: clamp(16px, 3vw, 28px);
  margin-bottom: var(--gap);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.panel-head h1, .panel-head h2, .panel-head h3 { margin: 0; }

.page-title { margin: 8px 0 18px; }
.back-link { display: inline-block; margin-bottom: 6px; font-size: 14px; }

.breadcrumbs { font-size: 14px; margin: 4px 0 14px; color: var(--muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; }
.breadcrumbs a:hover { color: var(--ink); }

.section-title { margin: 28px 0 12px 8px; }

.empty-state {
  text-align: center;
  padding: 36px 16px;
}
.empty-state p { color: var(--muted); max-width: 460px; margin-left: auto; margin-right: auto; }
.empty-state .btn { margin-top: 8px; }

/* ---------- Карточки товаров ---------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 22px 18px;
}
.products-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.product-card { display: flex; flex-direction: column; min-width: 0; }

.tile-wrap { position: relative; }
.fav-btn { position: absolute; top: 8px; right: 8px; z-index: 3; margin: 0; }
.fav-form { display: inline-block; }
.fav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: var(--r-pill);
  background: rgba(251, 230, 226, 0.92); color: var(--ink); cursor: pointer;
}
.fav-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.fav-toggle:hover { background: #fff; }
.fav-toggle.is-active svg { fill: currentColor; }
.fav-inline .fav-toggle { width: 44px; height: 44px; background: var(--field); box-shadow: var(--shadow-inset); }
.buy-wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.product-tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1.12;
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.product-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-tile img.is-broken { display: none; }
.product-tile::before {
  content: "lannét glow";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  color: var(--muted);
  opacity: 0.55;
  z-index: 0;
}
.product-tile img { position: relative; z-index: 1; }

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.product-info { padding: 10px 6px 0; display: flex; flex-direction: column; flex: 1; }
.product-type { font-size: 12.5px; color: var(--muted); }
.product-name { font-family: var(--font-head); font-size: 0.98rem; line-height: 1.25; margin: 2px 0 4px; }
.product-name a:hover { text-decoration: underline; }
.product-brand { font-size: 13px; font-weight: 700; }
.product-meta-row { font-size: 12.5px; color: var(--muted); }
.product-price-row { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 8px; flex-wrap: wrap; }
.current-price { font-weight: 800; font-size: 1.05rem; }
.old-price { text-decoration: line-through; color: var(--muted); font-size: 0.9rem; }
.product-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.product-actions .btn { flex: 1; }
.product-actions .icon-btn { background: var(--btn); box-shadow: var(--shadow-panel); flex: none; }
.product-actions .icon-btn:hover { background: var(--btn-hover); }
.stock-note { font-size: 12.5px; color: var(--danger); font-weight: 700; }

/* ---------- Главная ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: clamp(20px, 4vw, 44px);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}
.hero .hero-art {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  background: var(--panel-deep);
  box-shadow: var(--shadow-inset);
  overflow: hidden;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 { margin-bottom: 10px; }
.hero p { color: var(--muted); max-width: 460px; }
.hero .btn { margin-top: 6px; }

.category-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  background: var(--panel);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-panel);
  padding: 14px 8px;
}
.category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: center;
  font-size: 14px;
  color: var(--ink);
}
.category-tile + .category-tile { border-left: 1px solid var(--line); }
.category-tile svg { width: 52px; height: 52px; fill: none; stroke: var(--icon); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Каталог ---------- */
.catalog-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.filters { position: sticky; top: 12px; margin-bottom: 0; }
.filters summary { list-style: none; cursor: pointer; }
.filters summary::-webkit-details-marker { display: none; }
.filters-title { font-family: var(--font-head); font-size: 1.15rem; margin: 0 0 12px; }
.price-range { display: flex; gap: 8px; }
.sort-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sort-row .form-control { width: auto; min-width: 210px; }

.pagination { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 28px; }
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  font-family: var(--font-head);
}
.page-link:hover { text-decoration: none; background: var(--btn); }
.page-link[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---------- Карточка товара ---------- */
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 24px;
  align-items: start;
}
.product-photo {
  position: relative;
  aspect-ratio: 1 / 1.1;
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.product-photo img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.product-photo img.is-broken { display: none; }
.product-photo::before {
  content: "lannét glow";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 1.4rem; color: var(--muted); opacity: 0.55;
}
.product-gallery { display: grid; gap: 12px; }
.thumbs { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.thumb {
  width: 64px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: var(--r-md);
  overflow: hidden; cursor: pointer; background: var(--panel); box-shadow: var(--shadow-soft);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb[aria-current="true"] { border-color: var(--ink); }
.gallery-admin { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.gallery-admin img { width: 100%; aspect-ratio: 1 / 1.1; object-fit: cover; border-radius: var(--r-md); background: var(--panel-deep); }
.gallery-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.product-brandline { font-family: var(--font-head); color: var(--muted); margin-bottom: 4px; }
.product-price-big { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.product-price-big .current-price { font-size: 1.9rem; }
.product-price-big .old-price { font-size: 1.1rem; }
.discount-pill { padding: 2px 10px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: var(--field); border-radius: var(--r-md); box-shadow: var(--shadow-inset); padding: 14px 18px; margin: 14px 0; }
.facts span { display: block; font-size: 12.5px; color: var(--muted); }
.buy-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 16px 0; }

.qty {
  display: inline-flex;
  align-items: center;
  background: var(--field);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-inset);
}
.qty button {
  width: 38px; height: 38px;
  border: 0; background: transparent;
  color: var(--ink);
  font-size: 20px; font-family: var(--font-head);
  cursor: pointer;
  border-radius: var(--r-pill);
}
.qty button:hover { background: rgba(107, 31, 42, 0.1); }
.qty input {
  width: 48px;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.spec-table td:first-child { color: var(--muted); width: 42%; }
.spec-table td:last-child { font-weight: 700; }
.composition { font-size: 13px; line-height: 1.55; background: var(--field); border-radius: var(--r-sm); box-shadow: var(--shadow-inset); padding: 12px 16px; }

/* ---------- Корзина ---------- */
.cart-panel { padding-bottom: 20px; }
.free-ship { margin: 6px 0 18px; }
.free-ship-track { height: 5px; border-radius: var(--r-pill); background: rgba(107, 31, 42, 0.2); overflow: hidden; }
.free-ship-fill { height: 100%; background: var(--ink); border-radius: var(--r-pill); transition: width 0.25s; }
.free-ship-labels { display: flex; justify-content: space-between; font-size: 12.5px; margin-top: 4px; color: var(--muted); }
.free-ship-text { font-size: 14px; margin: 8px 0 0; }

.cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  gap: 8px 18px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.cart-thumb { width: 96px; height: 96px; border-radius: var(--r-sm); background: var(--panel-deep); overflow: hidden; box-shadow: var(--shadow-inset); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-thumb img.is-broken { display: none; }
.cart-title { font-size: 13px; color: var(--muted); }
.cart-name { font-family: var(--font-head); font-size: 1.05rem; }
.cart-sub { font-size: 14px; color: var(--muted); }
.cart-price { text-align: right; min-width: 110px; }
.cart-price .current-price { font-size: 1.1rem; }
.icon-link-btn { border: 0; background: transparent; cursor: pointer; color: var(--ink); width: 36px; height: 36px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; }
.icon-link-btn:hover { background: rgba(255, 255, 255, 0.4); }
.icon-link-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.cart-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.cart-total-label { font-size: 14px; color: var(--muted); }
.cart-total { font-family: var(--font-head); font-size: 1.6rem; }

/* ---------- Оформление заказа ---------- */
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.checkout-summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.checkout-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; font-family: var(--font-head); }
.checkout-total strong { font-size: 1.4rem; }
.shop-info { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; }
.shop-info li { display: flex; gap: 12px; align-items: flex-start; }
.shop-info svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--icon); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.mascot-badge { width: 150px; height: 150px; margin: 8px auto 0; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow-inset); display: flex; align-items: center; justify-content: center; }
.mascot-badge img { width: 70%; }
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--field); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; box-shadow: var(--shadow-inset); }
.done-mark svg { width: 28px; height: 28px; stroke: var(--ok); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.details-list { background: var(--field); border-radius: var(--r-md); box-shadow: var(--shadow-inset); padding: 14px 20px; text-align: left; max-width: 520px; margin: 0 auto 20px; }
.details-list div { margin: 4px 0; }

/* ---------- Вход и регистрация ---------- */
.auth-wrap { max-width: 470px; margin: 8px auto 0; }
.auth-wrap h1 { text-align: center; margin-bottom: 16px; }
.auth-foot { text-align: center; font-size: 14px; margin-top: 14px; }
.auth-foot a { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Статусы заказа ---------- */
.status-badge {
  display: inline-block;
  padding: 2px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 800;
  background: var(--field);
  border: 1.5px solid var(--ink);
  white-space: nowrap;
}
.status-new { border-color: var(--warn); color: var(--warn); }
.status-processing { border-color: var(--ink); color: var(--ink); }
.status-paid, .status-delivered { border-color: var(--ok); color: var(--ok); }
.status-shipped { border-color: #285A8A; color: #285A8A; }
.status-cancelled { border-color: var(--danger); color: var(--danger); }
.badge-tag { display: inline-block; padding: 1px 10px; border-radius: var(--r-pill); background: var(--field); font-size: 12px; font-weight: 800; }

/* ---------- Таблицы ---------- */
.table-wrap, .orders-table-wrapper { overflow-x: auto; }
.admin-table, .orders-table, .items-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .orders-table th, .items-table th {
  text-align: left;
  padding: 8px 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}
.admin-table td, .orders-table td, .items-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tfoot td, .items-table tfoot td { border-bottom: 0; font-weight: 800; }
.admin-table .right, .items-table .num, .items-table th.num { text-align: right; }
.actions { white-space: nowrap; }
.actions form { display: inline; }
.admin-thumb { width: 48px; height: 56px; object-fit: cover; border-radius: var(--r-xs); background: var(--panel-deep); }

/* ---------- Личный кабинет ---------- */
.profile-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.profile-header { margin: 10px 0 18px; }
.profile-header h1 { margin-bottom: 4px; }
.profile-header p { color: var(--muted); margin: 0; }
.profile-sidebar { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-panel); padding: 18px; }
.profile-user { text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.profile-avatar { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--font-head); font-size: 1.6rem; display: flex; align-items: center; justify-content: center; }
.profile-user-name { font-family: var(--font-head); }
.profile-user-email { font-size: 13px; color: var(--muted); word-break: break-all; }
.profile-nav { display: grid; gap: 4px; }
.profile-nav .nav-item { padding: 9px 16px; border-radius: var(--r-pill); font-family: var(--font-head); font-size: 0.95rem; }
.profile-nav .nav-item:hover { background: rgba(255, 255, 255, 0.4); text-decoration: none; }
.profile-nav .nav-item.active { background: var(--ink); color: #fff; }
.profile-nav .nav-item-danger { color: var(--danger); }
.profile-content, .order-details { min-width: 0; }
.profile-stats, .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.stat-card, .stat-grid .panel { background: var(--panel); border-radius: var(--r-md); box-shadow: var(--shadow-panel); padding: 16px 20px; margin-bottom: 0; }
.stat-value { display: block; font-family: var(--font-head); font-size: 1.6rem; margin-top: 4px; }
.stat-label { font-size: 13px; color: var(--muted); }
.profile-section, .order-info, .order-items { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-panel); padding: clamp(16px, 3vw, 26px); margin-bottom: var(--gap); }
.profile-form { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-panel); padding: clamp(16px, 3vw, 28px); max-width: 560px; }
.order-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.order-meta-grid .order-info { margin-bottom: 0; }
.order-info p { margin: 4px 0; }
.order-number { font-weight: 800; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { margin-bottom: 10px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }

/* ---------- Админ-панель ---------- */
.admin-page h1 { margin-bottom: 10px; }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-nav a {
  padding: 7px 20px;
  border-radius: var(--r-pill);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  font-family: var(--font-head);
  font-size: 0.95rem;
}
.admin-nav a:hover { text-decoration: none; background: var(--btn); }
.admin-nav a.active { background: var(--ink); color: #fff; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.two-col .panel { margin-bottom: 0; }
.two-col + .panel { margin-top: var(--gap); }
.stack { display: grid; gap: 10px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: var(--gap); }
.filter-row .form-control { width: auto; min-width: 190px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

/* ---------- Страница ошибки ---------- */
.error-page { text-align: center; padding: 40px 0 20px; }
.error-page .panel { max-width: 560px; margin: 0 auto; }
.error-code { font-family: var(--font-head); font-weight: 700; font-size: clamp(3.5rem, 12vw, 6rem); line-height: 1; color: var(--ink); }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* ---------- Уведомление ---------- */
.site-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 20px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-lift);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.site-toast.is-visible { opacity: 1; }
.site-toast.is-error { background: var(--danger); }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .products-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .catalog-layout, .profile-grid, .checkout-layout, .product-layout, .hero { grid-template-columns: 1fr; }
  .filters { position: static; }
  .main-nav { gap: 6px 14px; font-size: 0.95rem; }
  .two-col, .order-meta-grid { grid-template-columns: 1fr; }
  .search-pill input { width: 100px; }
}

@media (max-width: 720px) {
  .header-bar { padding: 8px 12px; }
  .menu-toggle { display: inline-flex; order: 3; }
  .header-icons { margin-left: auto; order: 2; }
  .brand-logo { order: 1; }
  .main-nav, .search-pill { display: none; order: 4; width: 100%; }
  .site-header.menu-open .main-nav { display: flex; flex-direction: column; align-items: flex-start; margin-left: 0; }
  .site-header.menu-open .search-pill { display: flex; }
  .search-pill input { width: 100%; }
  .products-grid, .products-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .category-strip { grid-template-columns: repeat(2, 1fr); }
  .category-tile + .category-tile { border-left: 0; }
  .cart-item { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .cart-thumb { width: 72px; height: 72px; }
  .cart-item .qty-col { grid-column: 2; }
  .cart-price { grid-column: 3; grid-row: 1; min-width: 0; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  body::before { opacity: 0.12; width: 70vw; left: -20vw; }
}

@media (max-width: 380px) {
  .products-grid, .products-grid.six { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Мелкие утилиты ---------- */
.mt-s { margin-top: 12px; }
.mt-m { margin-top: 18px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.form-actions.center { justify-content: center; }
.btn-sm svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* длинные слова в названиях не вылезают за карточку */
.product-name, .cart-name, .product-type, .product-brand { overflow-wrap: anywhere; hyphens: auto; }
.product-info { min-width: 0; }

[hidden] { display: none !important; }

/* ---------- Рейтинг и отзывы ---------- */
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.stars {
  --fill: 0%;
  font-size: 15px; letter-spacing: 1px; line-height: 1;
  background: linear-gradient(90deg, var(--ink) var(--fill), rgba(107, 31, 42, 0.22) var(--fill));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rating-count { color: var(--muted); }
.rating-link { display: inline-block; margin-bottom: 6px; text-decoration: none; }
.rating-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rating-big { font-family: var(--font-head); font-size: 2rem; }
.rating-summary .stars { font-size: 20px; }
.review-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.review { background: var(--field); border-radius: var(--r-md); box-shadow: var(--shadow-inset); padding: 14px 18px; }
.review-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.review-text { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.review .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.review .actions form { margin: 0; }
.review-form { max-width: 560px; }
.rating-input { margin: 0 0 12px; display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; flex-wrap: wrap; }
.rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-input label { font-size: 30px; line-height: 1; color: rgba(107, 31, 42, 0.25); cursor: pointer; padding: 0 2px; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: var(--ink); }
.rating-input input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--gap); }
.chip { padding: 6px 16px; border-radius: var(--r-pill); background: var(--field); font-weight: 700; font-size: 14px; }
.chip:hover { text-decoration: none; background: var(--btn); }
.chip.active { background: var(--ink); color: #fff; }
.product-layout h1 { overflow-wrap: anywhere; hyphens: auto; }

/* ---------- Варианты товара ---------- */
.variant-picker { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.variant { position: relative; cursor: pointer; }
.variant input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.variant span {
  display: inline-block; padding: 7px 16px; border-radius: var(--r-pill);
  background: var(--field); box-shadow: var(--shadow-inset); font-weight: 700; font-size: 14px;
  border: 2px solid transparent;
}
.variant input:checked + span { border-color: var(--ink); background: #fff; }
.variant input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.variant.is-out span { opacity: 0.5; text-decoration: line-through; cursor: not-allowed; }
.variants-table input.form-control { min-width: 90px; }
.variants-table td:first-child input.form-control { min-width: 190px; }

/* ---------- Акции и карусель ---------- */
.carousel { position: relative; margin-bottom: var(--gap, 24px); }
.carousel-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  border-radius: var(--r-lg);
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.slide {
  flex: 0 0 100%; scroll-snap-align: start;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: center;
  background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-panel); padding: 28px 32px; min-height: 280px;
}
.slide h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); margin: 4px 0 10px; overflow-wrap: anywhere; }
.slide-art { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: var(--field); box-shadow: var(--shadow-inset); }
.slide-art img { width: 100%; height: 100%; object-fit: cover; }
.promo-badge {
  position: absolute; top: 12px; right: 12px; padding: 6px 16px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; font-family: var(--font-head); font-size: 1.3rem; font-weight: 700;
}
.carousel-controls { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.carousel-controls .icon-btn { font-size: 26px; line-height: 1; background: var(--field); box-shadow: var(--shadow-soft); }
.carousel-dots { display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(107, 31, 42, 0.25); cursor: pointer; }
.dot[aria-current="true"] { background: var(--ink); }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.promo-card { display: flex; flex-direction: column; background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-panel); overflow: hidden; color: inherit; }
.promo-card:hover { text-decoration: none; background: #fcd4cd; }
.promo-art { position: relative; aspect-ratio: 16 / 9; background: var(--field); }
.promo-art img { width: 100%; height: 100%; object-fit: cover; }
.promo-body { padding: 14px 18px 18px; }
.promo-body h2 { font-size: 1.15rem; margin: 0 0 6px; overflow-wrap: anywhere; }
.promo-body p { margin: 0 0 6px; }
.promo-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: center; }
.promo-detail-art { width: 100%; border-radius: var(--r-lg); aspect-ratio: 4 / 3; object-fit: cover; }
.promo-detail:not(:has(.promo-detail-art)) { grid-template-columns: 1fr; }
.promo-percent { font-family: var(--font-head); font-size: 1.5rem; margin: 0 0 8px; }
.promo-text { white-space: pre-line; overflow-wrap: anywhere; }
.promo-preview { display: block; max-width: 260px; border-radius: var(--r-md); margin: 10px 0; }
@media (max-width: 900px) {
  .slide, .promo-detail { grid-template-columns: 1fr; padding: 20px; }
  .slide-art { order: -1; aspect-ratio: 16 / 9; }
}

/* ---------- Текстовые страницы ---------- */
.prose { max-width: 820px; }
.prose h2 { font-size: 1.2rem; margin: 22px 0 6px; }
.prose p, .prose li { line-height: 1.6; }
.prose ul, .prose ol { padding-left: 22px; }
.faq { background: var(--field); border-radius: var(--r-md); box-shadow: var(--shadow-inset); padding: 12px 18px; margin: 0 0 10px; }
.faq summary { cursor: pointer; font-weight: 800; }
.faq[open] summary { margin-bottom: 6px; }
.faq p { margin: 0; }

/* Шапка шире основного содержимого, чтобы меню помещалось в одну строку */
.site-header .container { max-width: 1320px; }

/* Пять пунктов меню не помещаются в одну строку с поиском: на средних экранах меню уходит во вторую строку шапки */
@media (min-width: 901px) and (max-width: 1360px) {
  .header-bar { row-gap: 4px; }
  .search-pill { margin-left: auto; }
  .main-nav { order: 5; flex-basis: 100%; margin-left: 0; justify-content: center; padding-bottom: 4px; }
}

/* Этап 4: промокод в корзине, баллы, письма в админке */
.promo-box { margin: 18px 0 4px; }
.promo-form, .promo-applied { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.promo-form .form-control { max-width: 260px; text-transform: uppercase; }
.promo-form .form-control::placeholder { text-transform: none; }
.promo-applied span { flex: 1 1 auto; }
.bonus-box { margin-top: 4px; }
.plain-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.email-body { white-space: pre-wrap; word-break: break-word; font-family: var(--font-body); background: var(--bg, #fff); border-radius: var(--r-md); padding: 16px; margin: 12px 0 0; }
.inline-filter { margin: 0; }

/* Этап 5: двухфакторная защита */
.recovery-codes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; font-family: ui-monospace, Consolas, monospace; }
.recovery-codes li { background: rgba(255, 255, 255, .55); border-radius: var(--r-md); padding: 8px 12px; text-align: center; letter-spacing: .04em; }
.mfa-secret code { font-size: 1.05rem; letter-spacing: .06em; word-break: break-all; }
