/* MarketGroup — светлый магазинный дизайн (структура в духе decanter.ru,
   палитра своя: тёмная олива и оранжевый из логотипа) */

:root {
  --ink: #26321f;          /* основной текст */
  --ink-2: #55614c;        /* вторичный текст */
  --muted: #8d9686;        /* подписи */
  --line: #e3e6dd;         /* границы */
  --line-soft: #eef0ea;
  --bg: #ffffff;
  --bg-soft: #f6f7f2;      /* подложки, плашки */
  --bg-photo: #ffffff;

  --olive: #242714;        /* фирменная тёмная олива (шапка-полоса, подвал) */
  --olive-2: #2f3320;
  --orange: #fe7f32;       /* фирменный оранжевый */
  --orange-dark: #e96a1c;
  --orange-soft: #fff1e6;
  --red: #d8382a;          /* цена/скидка */
  --green: #57922f;        /* наличие */

  --topbar-h: 40px;        /* высота закреплённой служебной полосы */

  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 2px 10px rgba(38, 50, 31, 0.07);
  --shadow-hover: 0 10px 26px rgba(38, 50, 31, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Open Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1240px, 100% - 32px);
  margin-inline: auto;
}

.container--wide {
  width: min(1840px, 100% - 32px);
}

/* ---------------------------- Служебная полоса ---------------------------- */

.topbar {
  background: var(--olive);
  color: #d7d9cb;
  font-size: 13px;
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: var(--topbar-h);
  flex-wrap: wrap;
}

.topbar__nav {
  display: flex;
  gap: 22px;
  font-weight: 600;
}

.topbar__nav a:hover {
  color: var(--orange);
}

.topbar__spacer {
  flex: 1;
}

.topbar__item {
  color: #b9bdab;
}

a.topbar__item:hover {
  color: var(--orange);
}

.topbar__phone {
  font-weight: 600;
}

.topbar__item--hours::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: middle;
}

/* ------------------ Логотип, разделы и поиск в одной полосе ---------------- */

.mainbar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s ease;
}

.mainbar.is-stuck {
  box-shadow: 0 6px 22px rgba(38, 50, 31, 0.12);
}

.mainbar__inner {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 20px 0;
  transition: padding 0.25s ease;
}

/* при прокрутке полоса аккуратно ужимается */
.mainbar.is-stuck .mainbar__inner {
  padding: 11px 0;
}

.brand img,
.cat-tile--nav .cat-tile__circle {
  transition: width 0.25s ease, height 0.25s ease, border-radius 0.3s ease;
}

/* при прокрутке логотип и разделы становятся круглыми */
.mainbar.is-stuck .brand img,
.mainbar.is-stuck .cat-tile--nav .cat-tile__circle {
  border-radius: 50%;
}

.mainbar.is-stuck .brand img {
  height: 52px;
  width: 52px;
}

.mainbar.is-stuck .cat-tile--nav .cat-tile__circle {
  width: 52px;
  height: 52px;
}

.brand__tag,
.cat-tile--nav .cat-tile__name {
  transition: opacity 0.2s ease, max-height 0.25s ease;
  max-height: 40px;
}

.mainbar.is-stuck .brand__tag {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  text-align: center;
}

.brand img {
  height: 86px; /* вровень с плитками разделов */
  width: 86px;
  object-fit: cover;
  border-radius: 14px; /* форма логотипа */
}

.brand__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.2;
}

.brand__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand__tag {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* Разделы посередине */
.catnav__tiles {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  padding-bottom: 2px;
}

/* если разделы не помещаются — правый край растворяется, показывая продолжение */
.catnav__tiles.is-scrollable {
  mask-image: linear-gradient(to right, #000 calc(100% - 46px), transparent);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 46px), transparent);
}

/* Поиск, а под ним избранное и корзина */
.header__tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
  width: var(--control-w);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.header__actions .cart-link {
  flex: 1; /* сердечко + корзина = ширина поиска */
  justify-content: center;
}

/* --------------------------- Подсказки поиска ---------------------------- */

/* поиск, переключатель наличия и сортировка — одной ширины */
:root {
  --control-w: 240px;
}

.search-wrap {
  position: relative;
  width: var(--control-w);
  display: flex;
}

.search-wrap .search {
  max-width: none;
}

.search {
  flex: 1;
  display: flex;
  align-items: stretch;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search:hover {
  border-color: #d3d8c9;
}

.search:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(254, 127, 50, 0.14);
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 0 0 0 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
}

.search input::placeholder {
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
}

.search input:focus {
  outline: none;
}

.search__btn {
  width: 42px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.search__btn svg {
  width: 19px;
  height: 19px;
}

.search__btn:hover {
  color: var(--orange);
}

/* -------------------------------- Избранное ------------------------------- */

.fav-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.fav-link:hover {
  border-color: var(--red);
}

.fav-link svg {
  width: 22px;
  height: 22px;
  fill: none;
}

.fav-link:hover {
  color: var(--red);
}

.fav-link__count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.fav-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
}

.fav-btn:hover {
  color: var(--red);
  border-color: var(--red);
}

.fav-btn.is-on {
  color: var(--red);
  border-color: var(--red);
}

.fav-btn.is-on svg {
  fill: var(--red);
}

.fav-btn--wide {
  position: static;
  width: auto;
  height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  background: var(--bg);
}

/* ---------------------------- Разделы каталога ---------------------------- */

.cats {
  margin-top: 50px;
  padding: 34px 0 10px;
  border-top: 1px solid var(--line);
}

.cats__title {
  margin: 0 0 22px;
  font-size: 22px;
}

.cats__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 150px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.cat-tile__circle {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff; /* фото товаров на белом фоне */
  border: 1px solid var(--line);
  display: block;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.cat-tile:hover .cat-tile__circle {
  border-color: var(--orange);
  transform: translateY(-3px);
}

.cat-tile__circle img {
  position: absolute;
  inset: 14%;
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.cat-tile__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.cat-tile__count {
  font-size: 12.5px;
  color: var(--muted);
}

/* Компактные плитки в строке категорий */
.cat-tile--nav {
  width: 96px;
  gap: 8px;
  flex-shrink: 0;
}

.cat-tile--nav .cat-tile__circle {
  width: 86px;
  height: 86px;
  border-radius: 16px; /* квадрат со скруглением — как логотип */
  background: #fff;
  box-shadow: 0 2px 10px rgba(38, 50, 31, 0.08);
}

.cat-tile--nav .cat-tile__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  color: var(--ink);
}

.cat-tile--nav:hover .cat-tile__name {
  color: var(--orange);
}

.cat-tile--nav.is-active .cat-tile__circle {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(254, 127, 50, 0.22);
}

.cat-tile--nav.is-active .cat-tile__name {
  color: var(--orange);
  font-weight: 700;
}

/* --------------------------- Карточка товара ----------------------------- */

.modal .modal__box--product {
  position: relative;
  width: min(880px, 100%);
  max-height: min(90vh, 940px);
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 28px;
}

#productBody {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.pcard {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 26px;
}

.pcard__media {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  place-items: center;
}

.pcard__media img {
  max-height: 340px;
  object-fit: contain;
}

.modal .pcard__info h2 {
  margin: 6px 0 14px;
  font-size: 23px;
  text-align: left;
}

.pcard__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.pcard__specs li {
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}

.modal .pcard__text {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 14.5px;
  text-align: left;
}

.modal .pcard .modal__note,
.modal .pcard .card__sku,
.modal .pcard .card__stock {
  text-align: left;
}

.pcard__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pcard__actions .add-btn,
.pcard__actions .qty-row {
  width: auto;
  min-width: 230px;
  flex: 1;
}

/* Карточка товара на телефоне: окно занимало почти весь экран и внутри ещё
   прокручивалось. Фото и название ставим в один ряд, остальное ужимаем —
   так карточка помещается целиком. */
@media (max-width: 700px) {
  .modal .modal__box--product {
    padding: 14px;
    max-height: 88vh;
    /* окно прокручивается только вверх-вниз: вбок уезжало на ~50px
       из-за содержимого строки кнопок, вертикальную прокрутку это не трогает */
    overflow-x: hidden;
  }

  .pcard {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* фото занимало 240px по высоте — на телефоне это треть окна */
  .pcard__media {
    padding: 8px;
  }

  .pcard__media img {
    max-height: 132px;
  }

  .modal .pcard__info h2 {
    margin: 2px 0 6px;
    font-size: 17px;
    line-height: 1.25;
  }

  .pcard__specs {
    gap: 5px;
    margin: 10px 0 8px;
  }

  .pcard__specs li {
    padding: 3px 9px;
    font-size: 12px;
  }

  .modal .pcard__text {
    margin: 0 0 10px;
    font-size: 13.5px;
  }

  .pcard__actions {
    gap: 8px;
    margin-top: 4px;
  }

  .pcard__actions .add-btn,
  .pcard__actions .qty-row {
    min-width: 0;
  }

  .fav-btn--wide {
    width: 46px;
    padding: 0;
    justify-content: center;
  }

  .fav-btn--wide .fav-btn__label {
    display: none;
  }
}

.cart-link {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 16px 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}

.cart-link:hover {
  border-color: var(--orange);
}

.cart-link__icon {
  width: 21px;
  height: 21px;
  color: var(--orange);
  flex-shrink: 0;
}

.cart-link:hover .cart-link__text {
  color: var(--orange);
}

.cart-link__text {
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13.5px;
}

.cart-link__text b {
  color: var(--ink);
}

/* ---------------------------- Заголовок страницы -------------------------- */

main {
  padding-top: 24px;
  padding-bottom: 60px;
  scroll-margin-top: 120px; /* чтобы липкая шапка не закрывала начало каталога */
}

.crumbs {
  display: flex;
  gap: 8px;
  padding: 16px 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.crumbs a:hover {
  color: var(--orange);
}

.page-head h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.page-head__count {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.page-head__lead {
  margin: 0 0 22px;
  max-width: 760px;
  color: var(--ink-2);
  font-size: 14.5px;
}

.toolbar {
  display: flex;
  align-items: flex-start;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 0 0 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.filters {
  display: grid;
  grid-template-columns: repeat(var(--filter-cols, 5), minmax(0, 1fr));
  justify-content: start;
  align-content: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
  min-height: 84px; /* две строки фильтров: 2 × 38px + отступ */
}

.toolbar__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
  width: var(--control-w);
  flex-shrink: 0;
}

.toolbar__reset-row {
  margin-bottom: 22px;
}

.toolbar__reset {
  border: 0;
  background: transparent;
  color: var(--red);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.toolbar__reset:hover {
  text-decoration: underline;
}

/* Кнопка фильтров и панель — только для телефона */
.filters-btn {
  display: none;
}

.filters-sheet,
.filters-sheet__panel {
  display: contents; /* на десктопе фильтры остаются на своём месте */
}

.filters-sheet__close {
  display: none;
}

.switch__text--short {
  display: none;
}

/* ------------------------- Свои выпадающие списки ------------------------- */

.dd {
  position: relative;
}

.dd.is-open {
  z-index: 71;
}

.filters .dd {
  min-width: 0;
  max-width: 240px; /* кнопка фильтра никогда не растягивается сверх меры */
}

.filters .dd__btn {
  width: 100%;
}

.dd__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 30px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dd__btn:hover {
  border-color: var(--orange);
}

.dd.is-open .dd__btn,
.dd__btn:focus-visible {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(254, 127, 50, 0.16);
}

.dd__btn.is-set {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.dd__label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dd__value {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dd__btn.is-set .dd__value {
  color: var(--orange-dark);
}

.dd__arrow {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
  color: var(--orange);
  transition: transform 0.18s ease;
}

.dd.is-open .dd__arrow {
  transform: translateY(-50%) rotate(180deg);
}

.dd__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 70;
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 36px rgba(38, 50, 31, 0.16);
  animation: ddIn 0.14s ease;
}

@keyframes ddIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.dd--sort {
  width: 100%;
}

.dd--sort .dd__btn {
  width: 100%;
  justify-content: flex-start;
}

.dd--sort .dd__panel {
  left: auto;
  right: 0;
}

.dd__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.dd__opt:hover {
  background: var(--bg-soft);
}

.dd__opt.is-active {
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-weight: 700;
}

.dd__count {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
}

/* Переключатель «Только в наличии» */
.switch {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease;
}

.switch:hover {
  border-color: var(--orange);
}

.switch__track {
  order: 2; /* подпись слева, тумблер справа */
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__track {
  width: 42px;
  height: 24px;
  padding: 3px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.18s ease;
}

.switch__dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(38, 50, 31, 0.3);
  transition: transform 0.18s ease;
}

.switch input:checked + .switch__track {
  background: var(--orange);
}

.switch input:checked + .switch__track .switch__dot {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch__track {
  box-shadow: 0 0 0 3px rgba(254, 127, 50, 0.25);
}

.switch__text {
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

.switch input:checked ~ .switch__text {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 900px) {
  /* на узком экране полоса высокая, прилипание только мешало бы */
  .mainbar {
    position: static;
  }
}

/* число колонок зависит только от ширины экрана, поэтому кнопки всегда одного размера */
@media (max-width: 1200px) {
  .filters {
    --filter-cols: 4;
  }
}

@media (max-width: 1100px) {
  .filters {
    --filter-cols: 3;
  }
}

@media (max-width: 900px) {
  .filters {
    --filter-cols: 2;
  }
}

@media (max-width: 760px) {
  /* на узком экране контролы во всю ширину и друг под другом */
  .toolbar__side {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-left: 0;
  }

  .header__tools {
    width: 100%;
  }
}

/* ------------------------------- Каталог ---------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}



.card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.card:hover {
  border-color: #d3d8c9;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 0; /* иначе высокое фото растягивает блок и ломает пропорцию */
  overflow: hidden;
  background: var(--bg-photo);
  display: grid;
  place-items: center;
  padding: 12px;
}

/* абсолютное позиционирование: только так проценты считаются от блока с aspect-ratio */
.card__media img {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
}

.card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 52px; /* место под сердечко справа */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.badge--top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #ffb648, #f59211);
  color: #3a2600;
}

.badge__star {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.badge--inline {
  position: static;
  align-self: flex-start;
  margin-bottom: 8px;
}

.top-mark {
  color: var(--orange-dark);
}


.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  padding: 0 13px 12px;
  border-top: 1px solid var(--line-soft);
}

/* Все блоки карточки фиксированной высоты — поля совпадают по строкам во всём ряду */
.card__sku {
  font-size: 11.5px;
  line-height: 16px;
  height: 25px;
  padding-top: 9px;
  color: var(--muted);
}

.card__name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  height: 54px; /* ровно три строки */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__specs {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  height: 32px; /* две строки */
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__prices {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 8px;
  height: 36px;
  padding-top: 8px;
  overflow: hidden;
}

.price {
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
  line-height: 1.1;
}

.price--old {
  font-size: 14px;
  color: var(--muted);
  text-decoration: line-through;
}

.price-off {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

.card__stock {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 20px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}

/* короткая надпись о наличии — только для узкого экрана, её включает мобильный блок */
.card__stock-short {
  display: none;
}

.card__stock::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.card__stock--out {
  color: var(--muted);
}

.card__stock--out::before {
  background: #c9cec0;
}

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
}

/* ------------------ Бронирование: кнопка и круглые «±» ------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--orange);
  color: #fff;
}

.btn--primary:hover {
  background: var(--orange-dark);
}

.btn--ghost {
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.btn--danger {
  background: var(--bg);
  border-color: #f0c9c5;
  color: var(--red);
}

.btn--danger:hover {
  background: #fdf0ee;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  padding: 7px 15px;
  font-size: 13.5px;
}

.btn--request {
  background: var(--bg);
  border-color: var(--orange);
  color: var(--orange-dark);
  font-weight: 600;
}

.btn--request:hover {
  background: var(--orange-soft);
}

.card .btn--request {
  height: 42px;
  padding: 0 10px;
  font-size: 14px;
  margin-top: 4px;
}

.pcard__actions .btn--request {
  height: 46px;
  min-width: 230px;
  flex: 1;
}

.btn:disabled,
.btn--soon {
  background: var(--bg-soft);
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
}

.add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.add-btn:hover {
  background: var(--orange-dark);
}

.card .add-btn {
  font-size: 14px;
  margin-top: 4px;
}

/* «Скоро» той же высоты, что и «Забронировать», иначе ряд разъезжается */
.card .btn--soon {
  height: 42px;
  padding: 0 10px;
  font-size: 14px;
  margin-top: 4px;
}

.card .qty-row {
  margin-top: 4px;
}

.add-btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 42px;
}

.qty-circle {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-family: inherit;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.qty-circle:hover:not(:disabled) {
  background: var(--orange-dark);
}

.qty-circle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-row__label {
  flex: 1;
  text-align: center;
  color: var(--orange);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.qty-row--sm {
  width: auto;
  height: auto;
  gap: 8px;
}

.qty-row--sm .qty-circle {
  width: 32px;
  height: 32px;
  font-size: 18px;
}

.qty-row--sm .qty-row__label {
  flex: 0 0 auto;
  min-width: 44px;
  font-size: 14px;
}

/* ------------------------------- Пагинация -------------------------------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
}

.pager__btn {
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pager__btn:hover:not(:disabled):not(.is-active) {
  border-color: var(--orange);
  color: var(--orange);
}

.pager__btn.is-active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  cursor: default;
}

.pager__btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.pager__btn--arrow {
  font-size: 22px;
  line-height: 1;
  padding-bottom: 3px;
}

.pager__dots {
  color: var(--muted);
  padding: 0 2px;
}

/* -------------------------------- Подвал ---------------------------------- */

.footer {
  background: var(--olive);
  color: #c7cbba;
  padding: 44px 0 26px;
  font-size: 14px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 30px;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer__col h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #fff;
}

.footer__col a {
  cursor: pointer;
}

.footer__col a:hover {
  color: var(--orange);
}

.brand--footer {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.brand--footer img {
  height: 56px;
  width: 56px;
}

.brand--footer .brand__text {
  align-items: flex-start;
}

.brand--footer .brand__name {
  color: #fff;
  font-size: 20px;
}

.brand--footer .brand__tag {
  color: #9aa38c;
}

/* на широком экране обёртки ничего не меняют: контакты — строки колонки бренда,
   «Информация» и «Оплата» — отдельные колонки грида */
.footer__contacts,
.footer__side {
  display: contents;
}

.footer__phone {
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  margin-top: 6px;
}

.footer__mail {
  color: var(--orange);
}

.footer__addr {
  margin: 0;
  color: #9aa38c;
  font-size: 13.5px;
}

.footer__warn {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #8f9782;
  font-size: 12.5px;
}

.footer__warn p {
  margin: 0;
  max-width: 900px;
}

.footer__age {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 2px solid #8f9782;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  color: #7f8873;
  font-size: 12.5px;
}

/* ------------------------------- Модалки ---------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  /* запасной вариант для браузеров без поддержки `safe center` ниже —
     окно прижато к верху и всегда доступно, а не центрируется вслепую */
  align-items: flex-start;
  /* на телефоне видимая высота экрана (без адресной строки) часто меньше,
     чем 88vh, по которым считается max-height окна: обычное центрирование
     может увести верх окна с заголовком и крестиком выше экрана без
     возможности прокрутки. `safe center` центрирует, только когда окно
     целиком помещается, иначе прижимает к началу, как обычный flex-start. */
  align-items: safe center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(30, 33, 22, 0.55);
}

.modal.is-open {
  display: flex;
}

@media (max-width: 700px) {
  .modal {
    padding: 12px;
  }
}

.modal__box {
  width: min(460px, 100%);
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 32px 30px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(20, 24, 14, 0.35);
}

.modal__box--age .logo {
  height: 60px;
  width: auto;
  margin: 0 auto 16px;
  border-radius: 10px;
}

.modal__box h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.modal__box p {
  margin: 0 0 20px;
  color: var(--ink-2);
  font-size: 14.5px;
}

.modal__note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.modal__box--wide {
  position: relative;
  width: min(660px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 28px;
}

#cartContent {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal__box--wide h2 {
  text-align: left;
}

/* На телефоне корзина уже не занимает почти весь экран, как раньше —
   высота меньше, а список товаров и форма плотнее, чтобы поместиться. */
@media (max-width: 700px) {
  .modal__box--wide {
    width: min(660px, 94%);
    padding: 14px;
    max-height: 72vh;
    overflow-x: hidden;
  }

  .cart-items {
    gap: 8px;
    margin: 12px 0;
  }

  .cart-row {
    padding: 8px;
    gap: 10px;
  }

  .cart-total {
    padding: 10px 2px 12px;
  }
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.modal__close:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

/* --------------------------- Информационные окна -------------------------- */

.modal .modal__box--info {
  width: min(620px, 100%);
  max-height: min(86vh, 800px);
  overflow-y: auto;
  text-align: left;
  padding: 30px 30px 26px;
}

.modal .modal__box--info h2 {
  margin: 0 0 16px;
  font-size: 23px;
  text-align: left;
}

.info-body p {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 14.5px;
  text-align: left;
}

.info-body p:last-child {
  margin-bottom: 0;
}

.info-body b {
  color: var(--ink);
}

.info-body a {
  color: var(--orange-dark);
}

.info-body a:hover {
  text-decoration: underline;
}

/* ------------------------------- Корзина ---------------------------------- */

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.cart-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cart-row__img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.cart-row__info {
  min-width: 0;
}

.cart-row__name {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 700;
}

.cart-row__price {
  font-size: 13px;
  color: var(--muted);
}

.cart-row__price b {
  color: var(--red);
  font-size: 14px;
}

.cart-row__controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-row__remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.cart-row__remove:hover {
  color: var(--red);
}

.cart-empty {
  margin: 22px 0;
  padding: 26px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 2px 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}

.cart-total strong {
  font-size: 24px;
  color: var(--red);
}

/* ----------------------------- Уведомление -------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--olive);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(20, 24, 14, 0.3);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast--error {
  background: var(--red);
}

/* --------------------------------- Формы ---------------------------------- */

.field {
  display: block;
  margin-bottom: 16px;
  text-align: left;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--ink-2);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--orange);
}

.field input[type='file'] {
  padding: 9px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
}

.field input[type='file']::file-selector-button {
  margin-right: 12px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.field input[type='file']::file-selector-button:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0 16px;
}

/* три поля цены/скидки/количества в админке — ровно в один ряд и на одном уровне */
#productForm .field-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 12px;
  align-items: start;
}

#productForm .field-row .field > span {
  height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#productForm .field-row .field input {
  padding-inline: 10px;
}

#productForm .field-row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* блок характеристик, из которых собираются фильтры витрины */
.specs {
  margin: 0 0 14px;
  padding: 12px 14px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.specs legend {
  padding: 0 6px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.specs .hint {
  display: block;
  margin-bottom: 10px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 16px;
  cursor: pointer;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
}

.form-error {
  display: none;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #fdf0ee;
  border: 1px solid #f0c9c5;
  color: #a32b1f;
  font-size: 14px;
  text-align: left;
}

.form-error.is-visible {
  display: block;
}

/* --------------------------- Контакт: тел./почта -------------------------- */

.contact {
  margin-bottom: 4px;
}

.contact__switch {
  display: inline-flex;
  padding: 3px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
}

.contact__tab {
  padding: 6px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.contact__tab.is-active {
  background: var(--orange);
  color: #fff;
}

/* код страны и номер — одна рамка (селектор с .field, иначе перебивает .field > span) */
.field > .phone-row {
  display: flex;
  margin: 0;
  font-size: inherit;
  color: inherit;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.field > .phone-row:focus-within {
  border-color: var(--orange);
}

.phone-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: transparent;
  padding-left: 12px;
}

.phone-row input:focus {
  outline: none;
}

/* выбор страны со своим поиском */
.country {
  position: relative;
  display: block;
}

.country {
  flex-shrink: 0;
}

.country__btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  min-height: 44px;
  padding: 0 10px 0 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: var(--radius) 0 0 var(--radius);
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.country__btn:hover {
  color: var(--orange-dark);
}

.country__arrow {
  width: 14px;
  height: 14px;
  color: var(--orange);
}

.country__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: -1px;
  z-index: 90;
  display: block;
  width: min(320px, 78vw);
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 36px rgba(38, 50, 31, 0.18);
}

.country__search {
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
}

.country__search:focus {
  outline: none;
  border-color: var(--orange);
}

.country__list {
  display: block;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.country__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.country__item:hover {
  background: var(--bg-soft);
}

.country__dial {
  color: var(--muted);
  white-space: nowrap;
}

.country__empty {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
}

/* ------------------------------ Админ-панель ------------------------------ */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-soft);
}

.login-card {
  width: min(400px, 100%);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-card h1 {
  margin: 0 0 22px;
  font-size: 20px;
}

.admin-spacer {
  flex: 1;
}

/* Три колонки: форма — товары — заказы */
.admin-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 370px;
  gap: 20px;
  padding: 20px 0 60px;
  align-items: start;
}

.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

/* Форма прилипает, но прокручивается внутри себя — иначе низ недоступен */
.panel--sticky {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.admin-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
  min-width: 0;
}

.panel--orders {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
}

.section-head .count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

/* фильтры и поиск в шапке списка товаров: фильтры слева от поля поиска */
.admin-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  flex-wrap: wrap;          /* фильтров четыре — на узкой панели переносятся */
  justify-content: flex-end;
  min-width: 0;
}

.admin-filter {
  flex: 0 0 auto;
  height: 42px; /* вровень с полем поиска рядом */
  max-width: 190px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.admin-filter:hover {
  border-color: var(--orange);
}

/* выбранный фильтр подсвечен, чтобы не забыть, что список сужен */
.admin-filter.is-set {
  border-color: var(--orange);
  color: var(--orange);
  font-weight: 600;
}

/* поиск по товарам — та же вёрстка, что у поиска на витрине */
.admin-search {
  flex: 0 1 380px;
  min-width: 0;
}

/* карточка заказа или заявки в режиме правки */
.order.is-editing {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange) inset;
}

.order.is-editing .field {
  margin-bottom: 8px;
}

.edit-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 4px;
}

.edit-item {
  display: grid;
  grid-template-columns: 1fr auto 68px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.edit-item__price {
  color: var(--muted);
  white-space: nowrap;
}

.edit-item .edit-qty {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
}

/* Список заказов — колонкой */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Товары — сеткой в четыре колонки */
.admin-list--grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---------------------- Массовая правка: выделение ------------------------ */

.bulk {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--orange);
  border-radius: var(--radius);
  background: var(--orange-soft);
}

.bulk__count {
  align-self: center;
  font-weight: 600;
  white-space: nowrap;
}

.bulk__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-2);
}

.bulk__field select,
.bulk__field input {
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-family: inherit;
  font-size: 13.5px;
}

.bulk .hint {
  align-self: center;
  margin: 0;
}

.bulk-select {
  margin-bottom: 12px;
}

/* чекбокс выделения — в левом верхнем углу карточки */
.row__pick {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.row__pick input {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--orange);
}

.row.is-picked {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange) inset;
}

/* кнопка-глаз в углу карточки: показать или скрыть товар на витрине */
.row {
  position: relative;
}

.row__eye {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.row__eye svg {
  width: 17px;
  height: 17px;
}

.row__eye:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.row__eye.is-off {
  border-color: var(--muted);
  color: var(--muted);
}

/* скрытый товар видно в списке сразу — приглушённый и подписанный */
.row.is-hidden-product {
  background: var(--bg-soft);
}

.row.is-hidden-product .row__thumb,
.row.is-hidden-product .row__info {
  opacity: 0.55;
}

.row.is-hidden-product .row__name::after {
  content: ' · скрыт';
  color: var(--muted);
  font-weight: 400;
}

.row.is-editing {
  border-color: var(--orange);
  background: var(--orange-soft);
  /* карточка с формой правки растягивается на всю ширину списка */
  grid-column: 1 / -1;
}

/* место, куда переезжает форма товара */
.row__form:empty {
  display: none;
}

.row__form {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

/* Форма в карточке — компактная раскладка: четыре колонки, характеристики
   в две строки, кадрирование рядом с описанием, а не под ним. */
.row.is-editing .row__form #productForm {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 12px;
  align-items: start;
}

.row.is-editing .row__form #formTitle,
.row.is-editing .row__form .form-error,
.row.is-editing .row__form .specs,
.row.is-editing .row__form .form-actions {
  grid-column: 1 / -1;
}

.row.is-editing .row__form #formTitle {
  margin: 0 0 8px;
  font-size: 17px;
}

/* название шире остальных: в нём длинные строки */
.row.is-editing .row__form #productForm > .field:first-of-type {
  grid-column: span 2;
}

/* «в топе» и «убрать фото» — одной строкой во всю ширину, они низкие */
.row.is-editing .row__form #productForm > .checkbox {
  grid-column: 1 / -1;
  margin: 0 0 8px;
}

/* цена, скидка и количество занимают половину ряда — рядом с описанием */
.row.is-editing .row__form #productForm > .field-row {
  grid-column: span 2;
}

/* восемь характеристик — двумя рядами по четыре */
.row.is-editing .row__form .specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 12px;
  padding: 8px 12px 2px;
}

.row.is-editing .row__form .specs legend,
.row.is-editing .row__form .specs > .hint {
  grid-column: 1 / -1;
}

.row.is-editing .row__form .specs .field-row {
  display: contents;
}

/* описание и блок фото — в один ряд */
.row.is-editing .row__form .field--description {
  grid-column: span 2;
}

.row.is-editing .row__form .field--image {
  grid-column: span 2;
}

.row.is-editing .row__form .field--description textarea {
  min-height: 96px;
}

.row.is-editing .row__form .cropper {
  grid-column: span 2;
  margin-bottom: 8px;
}

/* уменьшаем само фото, а не контейнер: обрезка контейнера сдвинула бы
   рамку кадрирования относительно снимка */
.row.is-editing .row__form .cropper__img {
  max-height: 168px;
}

/* превью товара при правке не нужно: те же данные есть в полях,
   а фотографию показывает кадрирование */
.row.is-editing > .row__thumb,
.row.is-editing > .row__info {
  display: none;
}

/* подсказки у отдельных полей в карточке прячем — они очевидны;
   пояснение к характеристикам остаётся, оно уберегает от ошибок */
.row.is-editing .row__form .field > .hint {
  display: none;
}

.row.is-editing .row__form .specs > .hint {
  font-size: 11.5px;
  line-height: 1.35;
  margin-top: 2px;
}

.row.is-editing .row__form .field {
  margin-bottom: 8px;
}

.row.is-editing .row__form .field--description textarea {
  min-height: 96px;
}

/* пояснение в левой панели, пока форма стоит в карточке */
.form-moved {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: 13.5px;
}

.row__thumb {
  width: 100%;
  height: 108px;
  object-fit: contain;
  background: #fff;
}

.row__name {
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.3;
  margin: 0;
  height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row__meta {
  font-size: 12.5px;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}

.row__meta .out {
  color: var(--red);
}

.row__actions {
  display: flex;
  gap: 6px;
}

.row__actions .btn {
  flex: 1 1 0;
  min-width: 0; /* на узкой карточке «Удалить» иначе вылезала за её край */
  padding: 6px 8px;
  font-size: 12.5px;
  white-space: nowrap;
}

/* --------------------------------- Заказы --------------------------------- */

.order {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13.5px;
}

.order.is-done {
  background: var(--bg-soft);
  color: var(--muted);
}

.order__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.order__number {
  font-weight: 700;
  font-size: 15px;
}

.order__status {
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--orange-soft);
  border: 1px solid #ffd3b3;
  color: var(--orange-dark);
  font-size: 12px;
}

.order.is-done .order__status {
  background: #eef5e7;
  border-color: #cfe3bd;
  color: var(--green);
}

.order__date {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.order__customer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14px;
  margin-bottom: 8px;
}

.order__customer a {
  color: var(--orange-dark);
}

.order__items {
  margin: 0 0 10px;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.order__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.order__total {
  font-size: 14px;
  color: var(--ink-2);
}

.order__total b {
  font-size: 17px;
  color: var(--red);
}

.order__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.order__actions .btn {
  padding: 5px 10px;
  font-size: 12.5px;
}

/* ------------------------------ Кадрирование ------------------------------ */

.cropper {
  margin-bottom: 14px;
}

.cropper__stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.cropper__img {
  max-width: 100%;
  max-height: 260px;
  display: block;
}

.cropper__frame {
  position: absolute;
  border: 2px solid var(--orange);
  box-shadow: 0 0 0 9999px rgba(20, 24, 14, 0.45);
  cursor: move;
}

.cropper__handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--orange);
  border: 2px solid #fff;
  border-radius: 50%;
}

.cropper__handle[data-handle='nw'] { top: -8px; left: -8px; cursor: nwse-resize; }
.cropper__handle[data-handle='ne'] { top: -8px; right: -8px; cursor: nesw-resize; }
.cropper__handle[data-handle='sw'] { bottom: -8px; left: -8px; cursor: nesw-resize; }
.cropper__handle[data-handle='se'] { bottom: -8px; right: -8px; cursor: nwse-resize; }

.cropper__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.cropper__size {
  font-size: 12.5px;
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

/* -------------------------------- Адаптив --------------------------------- */

@media (max-width: 1000px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* до 1150px три колонки сохраняются, кнопки в карточке товара встают друг под друга */
@media (max-width: 1560px) {
  .admin-layout {
    grid-template-columns: 300px minmax(0, 1fr) 330px;
    gap: 16px;
  }

  .row__actions {
    flex-direction: column;
  }

  .row__thumb {
    height: 96px;
  }
}

@media (max-width: 1150px) {
  .admin-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .admin-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
  min-width: 0;
}

.panel--orders {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }

  .row__actions {
    flex-direction: row;
  }
}

@media (max-width: 1000px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .panel--sticky {
    position: static;
    max-height: none;
  }

  .admin-list--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .mainbar__inner {
    flex-wrap: wrap;
    gap: 14px;
  }

  .header__tools {
    margin-left: auto;
  }

  .catnav__tiles {
    flex: 1 1 100%;
    order: 3;
  }
}

@media (max-width: 760px) {
  .header__tools {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .search-wrap {
    width: 100%;
  }

  .header__tools {
    flex-wrap: wrap;
  }

  /* служебная полоса закреплена сверху: только адрес и телефон по центру */
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 140;
  }

  /* место под закреплённую полосу — на самой шапке, чтобы не задеть админку */
  .mainbar {
    margin-top: var(--topbar-h);
  }

  .topbar__inner {
    justify-content: center;
    gap: 16px;
    flex-wrap: nowrap;
  }

  .topbar__nav,
  .topbar__spacer,
  .topbar__mail,
  .topbar__item--hours {
    display: none;
  }

  .topbar__addr {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .catnav__phone {
    font-size: 16px;
  }

  .page-head h1 {
    font-size: 24px;
  }
}

@media (max-width: 620px) {
  /* подвал в две колонки: слева бренд и «Каталог», справа контакты, «Информация», «Оплата» */
  .footer__grid {
    grid-template-columns: 1fr 1.4fr;
    gap: 22px 12px;
    align-items: start;
  }

  .footer__col--brand {
    display: contents;
  }

  /* логотип встаёт над названием и центрируется по нему */
  .brand--footer {
    grid-column: 1;
    flex-direction: column;
    align-items: center;
    width: max-content;
    gap: 4px;
  }

  .footer__contacts {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  /* адрес должен умещаться в одну строку на любой ширине телефона */
  .footer__addr {
    font-size: clamp(11.5px, 3.2vw, 13.5px);
  }

  .footer__cats {
    grid-column: 1;
  }

  /* «Информация» и «Оплата» идут одна за другой, не подстраиваясь под «Каталог» */
  .footer__side {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  .row__thumb {
    height: 92px;
  }

  .cart-row {
    grid-template-columns: 48px 1fr;
  }

  .cart-row__img {
    width: 48px;
    height: 48px;
  }

  .cart-row__controls {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ============================ Телефон (≤760px) ============================ */

@media (max-width: 760px) {
  /* логотип слева, поиск с кнопками — сразу справа от него */
  .mainbar__inner {
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
  }

  .brand {
    gap: 5px;
  }

  .brand img {
    width: 58px;
    height: 58px;
  }

  .brand__name {
    font-size: 14px;
  }

  .brand__tag {
    font-size: 9.5px;
  }

  .header__tools {
    flex: 1 1 0; /* делит строку с логотипом, а не требует ширину содержимого */
    width: auto;
    min-width: 0;
    margin-left: auto;
    gap: 8px;
  }

  .header__actions .cart-link {
    flex: 0 1 auto;
    min-width: 0;
  }

  .cart-link__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .search-wrap {
    width: 100%;
  }

  .search {
    height: 38px;
  }

  .header__actions {
    justify-content: flex-end;
  }

  .fav-link {
    width: 36px;
    height: 36px;
  }

  .cart-link {
    height: 36px;
    padding: 0 12px 0 10px;
    font-size: 12.5px;
  }

  .cart-link__icon {
    width: 18px;
    height: 18px;
  }

  /* разделы: две строки по четыре, без прокрутки */
  .catnav__tiles {
    order: 3;
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 6px;
    overflow: visible;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .cat-tile--nav {
    width: auto;
    gap: 5px;
  }

  .cat-tile--nav .cat-tile__circle {
    width: 100%;
    max-width: 68px;
    height: auto;
    aspect-ratio: 1 / 1;
    margin-inline: auto;
  }

  .cat-tile--nav .cat-tile__name {
    font-size: 11.5px;
    line-height: 1.2;
  }

  /* одна строка: кнопка фильтров, наличие, сортировка */
  .toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding-bottom: 14px;
    margin-bottom: 14px;
  }

  .filters-btn {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink);
    cursor: pointer;
  }

  .filters-btn svg {
    width: 20px;
    height: 20px;
  }

  .filters-btn__dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
  }

  .toolbar__side {
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    gap: 8px;
    margin-left: 0;
  }

  .switch {
    flex: 0 1 auto;
    width: auto;
    height: 40px;
    padding: 0 8px 0 12px;
    gap: 8px;
  }

  .switch__text {
    display: none;
  }

  .switch__text--short {
    display: inline;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .switch__track {
    width: 34px;
    height: 20px;
  }

  .switch__dot {
    width: 14px;
    height: 14px;
  }

  .switch input:checked + .switch__track .switch__dot {
    transform: translateX(14px);
  }

  .dd--sort {
    flex: 0 1 auto;
    width: auto;
  }

  .dd--sort .dd__btn {
    width: auto;
    min-height: 40px;
    padding: 4px 26px 4px 12px;
  }

  .dd--sort .dd__label {
    display: none;
  }

  .dd--sort .dd__value {
    font-size: 12.5px;
  }

  .dd--sort .dd__arrow {
    right: 8px;
  }

  /* фильтры — панель от верха вниз по содержимому, без затемнения, только тень */
  .filters-sheet {
    display: block;
    position: fixed;
    inset: var(--topbar-h) 0 0; /* выезжает из-под служебной полосы */
    z-index: 120;
    background: transparent;
    pointer-events: none;
  }

  .filters-sheet.is-open {
    pointer-events: auto;
  }

  /* панель во всю ширину сайта, высота — ровно под фильтры в две колонки */
  .filters-sheet__panel {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    padding: 46px 16px 16px;
    background: var(--bg);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 6px 24px rgba(38, 50, 31, 0.2);
    transform: translateY(-102%);
    transition: transform 0.25s ease;
  }

  .filters-sheet.is-open .filters-sheet__panel {
    transform: none;
  }

  .filters-sheet__close {
    display: grid;
    place-items: center;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    z-index: 2;
    border: 0;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--ink-2);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }

  .filters-sheet .filters {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  /* в панели показываем только названия фильтров, без выбранных значений */
  .filters-sheet .dd__value {
    display: none;
  }

  .filters-sheet .dd__label {
    font-size: 13.5px;
    letter-spacing: 0.02em;
    color: var(--ink);
    font-weight: 600;
  }

  .filters-sheet .dd__btn.is-set .dd__label {
    color: var(--orange-dark);
  }

  .filters-sheet .dd__btn {
    width: 100%;
    justify-content: flex-start;
    min-height: 40px;
    padding-right: 30px;
  }

  .filters-sheet .dd__panel {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
    border-color: var(--line-soft);
    animation: none;
  }

  .filters .dd {
    max-width: none;
  }

  .toolbar__reset-row {
    margin-bottom: 16px;
  }
}

/* карточки каталога на телефоне — правила идут последними, чтобы перебить базовые */
@media (max-width: 620px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .card__body {
    gap: 3px;
    padding: 0 8px 10px;
  }

  /* артикул и старая цена в узкой карточке не помещаются */
  .card__sku {
    display: none;
  }

  .card__body {
    padding-top: 8px;
  }

  .price--old {
    display: none;
  }

  .card__stock-full {
    display: none;
  }

  .card__stock-short {
    display: inline;
  }

  /* страниц может быть много — кнопки уже, при нехватке места переносятся */
  .pager {
    flex-wrap: wrap;
    gap: 5px;
  }

  .pager__btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 14px;
  }

  .pager__btn--arrow {
    font-size: 19px;
  }

  .card__badges {
    right: 34px;
    gap: 4px;
  }

  .card__name {
    font-size: 12px;
    line-height: 15px;
    height: 45px;
  }

  .card__specs {
    font-size: 10.5px;
    line-height: 13px;
    height: 26px;
  }

  .card__prices {
    height: 28px;
    padding-top: 4px;
    gap: 5px;
  }

  .price {
    font-size: 15px;
  }

  .price--old {
    font-size: 11px;
  }

  .card__stock {
    height: 16px;
    font-size: 10px;
    gap: 5px;
  }

  .card .add-btn,
  .card .btn--request {
    height: 34px;
    font-size: 10.5px;
    padding: 0 4px;
    gap: 4px;
    letter-spacing: -0.01em;
  }

  .card .add-btn__icon {
    display: none;
  }

  .qty-row {
    height: 34px;
    gap: 4px;
  }

  .qty-circle {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .qty-row__label {
    font-size: 12px;
  }

  .badge {
    font-size: 10.5px;
    padding: 3px 8px;
  }

  .fav-btn:not(.fav-btn--wide) {
    width: 26px;
    height: 26px;
    top: 6px;
    right: 6px;
  }

  .fav-btn:not(.fav-btn--wide) svg {
    width: 14px;
    height: 14px;
  }
}
