/* Дополнение к styles.css прототипа: блоки, которых в прототипе не было —
   панель сортировки mFilter, галерея и состав в карточке товара.
   Переменные (--paper, --line, --muted, --green-600/700) берутся из styles.css. */

.toolbar__controls { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.field-input--inline { width: auto; display: inline-block; margin-left: 8px; }

/* mFilter рисует свою форму фильтров — приводим её к виду сайдбара прототипа */
.filters .form-check,
.filters .mfilter-item { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.filters .form-check-input { width: 17px; height: 17px; accent-color: var(--green-600); }
.filters label { cursor: pointer; }
.filters .form-select,
.filters .form-control,
.filters input[type="text"],
.filters input[type="number"] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px; background: var(--paper);
}
.filters .btn { margin-top: 12px; }
.filters .mfilter-title,
.filters h5,
.filters h6 {
  font-size: 14px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 20px 0 10px; font-weight: 700;
}

/* Карточка товара */
/* Галерея занимает 45 % макета, а не половину: кадр квадратный, и в половине
   ширины это ~580 px высоты — цена и таблица тиражей уезжали за первый экран.
   45 %, а не 43 % — по ТЗ 16.09.2026: фото на 10–15 px крупнее. */
.product { display: grid; grid-template-columns: minmax(0, 45%) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 8px; }
.product__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); margin: 12px 0 18px; }
.product__price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 24px; }
.product__price b { font-size: 34px; }
.product__price span { color: var(--muted); font-size: 14px; }

/* Состав подарка */
.composition { margin-top: 32px; }
.composition__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 14px; }
.candy {
  display: flex; align-items: center; gap: 10px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 8px 8px;
}
.candy__img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; flex: none; background: var(--paper); }
.candy__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.candy__title { font-size: 13px; line-height: 1.3; }
.candy__maker { font-size: 11px; color: var(--muted); }
.candy__count { font-size: 13px; font-weight: 700; color: var(--green-700); white-space: nowrap; }

@media (max-width: 1100px) {
  .grid-products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  /* minmax(0,…), а не 1fr: обычная доля не сжимается уже содержимого,
     и широкая таблица цен распирала страницу за экран. */
  .product { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; }
  .grid-products { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-products { grid-template-columns: 1fr; }
}

/* ——— mFilter рисует сайдбар и пагинацию классами Bootstrap 5, а Bootstrap мы
   не подключаем: здесь минимальный набор правил, чтобы фильтр выглядел частью сайта.
   Ограничено сайдбаром и блоками фильтра, чтобы не задеть остальную вёрстку. ——— */

.filters .card { border: 0; background: transparent; margin-bottom: 18px; }
.filters .card-header {
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 0 0 10px; display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700;
}
.filters .card-body { padding: 12px 0 0; }
.filters .collapse:not(.show) { display: none; }
.filters .mfilter-chevron { color: var(--muted); flex: none; }

.filters .form-check { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.filters .form-check-input { width: 17px; height: 17px; accent-color: var(--green-600); margin: 0; flex: none; }
.filters .form-check-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; font-size: 14px; cursor: pointer; }
.filters .badge { font-size: 12px; color: var(--muted); font-weight: 400; }
.filters .badge.bg-primary { background: var(--green-700); color: #fff; padding: 1px 8px; border-radius: 999px; }
.filters .d-none { display: none !important; }

.filters .row { display: flex; gap: 8px; margin-bottom: 14px; }
.filters .col-6 { flex: 1; min-width: 0; }
.filters .input-group { display: flex; align-items: center; gap: 6px; }
.filters .input-group-text { font-size: 13px; color: var(--muted); flex: none; }
.filters .form-control {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; font-size: 14px; min-width: 0;
}
.filters .mfilter-slider { margin: 6px 2px 4px; }
.filters .noUi-connect { background: var(--green-600); }
.filters .fw-semibold { font-weight: 700; }
.filters .text-dark { color: var(--ink); }

/* Кнопки и мелочи сайдбара: остальные утилиты Bootstrap, которые встречаются в разметке */
.filters .d-grid { display: grid; gap: 8px; }
.filters .mt-3 { margin-top: 14px; }
.filters .mb-3 { margin-bottom: 14px; }
.filters .mb-5 { margin-bottom: 18px; }
.filters .py-3 { padding-top: 10px; padding-bottom: 10px; }
.filters .px-2 { padding-left: 6px; padding-right: 6px; }
.filters .w-100 { width: 100%; }
.filters .me-1 { margin-right: 6px; }
.filters .ms-2 { margin-left: 8px; }
.filters .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.filters .btn-primary { background: var(--green-700); color: #fff; }
.filters .btn-primary:hover { background: var(--green-600); }
.filters .btn-outline-secondary { background: var(--paper); border-color: var(--line); color: var(--ink); }
.filters .btn[hidden] { display: none; }
.filters .mfilter-count { font-size: 12px; color: var(--muted); }
.filters .mfilter-items { display: block; max-height: 260px; overflow-y: auto; }
.filters .mfilter-item { padding: 0; }
.filters .bg-secondary, .filters .bg-opacity-25 { background: transparent; }
.filters .rounded-pill { border-radius: 999px; }
.filters .shadow-sm { box-shadow: none; }
.filters .bg-white { background: transparent; }
.filters .border-0 { border: 0; }
.filters .border-bottom { border-bottom: 1px solid var(--line); }
.filters .gap-2 { gap: 8px; }
.filters .g-2 { gap: 8px; }
.filters .d-flex { display: flex; }
.filters .align-items-center { align-items: center; }
.filters .justify-content-between { justify-content: space-between; }
.filters .input-group-sm .form-control { padding: 7px 9px; font-size: 13px; }

/* ——— Мега-меню каталога ——— */
/* Шапка тёмно-зелёная и красит ссылки белым, поэтому внутри белой панели
   цвета задаём явно, иначе заголовки разделов белым по белому. */
.nav__item--mega { position: static; display: flex; align-items: center; }
.header__row { position: relative; }
.mega {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 60;
  background: var(--paper); color: var(--ink); border-top: 1px solid var(--line);
  box-shadow: var(--shadow-md); padding: 22px 0 26px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav__item--mega:hover .mega,
.nav__item--mega:focus-within .mega { opacity: 1; visibility: visible; transform: none; }
.mega__inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px 30px; align-items: start; }
.mega__col { min-width: 0; }
.mega__col--wide { grid-column: span 2; }
.mega__col--wide .mega__list { columns: 2; column-gap: 26px; }
.mega__col--wide .mega__list li { break-inside: avoid; }
.nav .mega__title, .mega .mega__title {
  display: inline-flex; align-items: baseline; gap: 6px;
  color: var(--green-800); font-weight: 700; font-size: 15px; line-height: 1.25;
  padding-bottom: 7px; margin-bottom: 8px; border-bottom: 1px solid var(--line); width: 100%;
}
.nav .mega__title:hover, .mega .mega__title:hover { color: var(--green-600); }
.mega .mega__title em, .mega .mega__list em { font-style: normal; font-size: 12px; color: var(--muted); }
.mega__list { list-style: none; margin: 0; padding: 0; }
.mega__list li { margin: 0; }
.nav .mega__list a, .mega .mega__list a {
  display: inline-flex; align-items: baseline; gap: 6px;
  color: var(--ink); font-size: 14px; line-height: 1.3; padding: 3px 0; font-weight: 400;
}
.nav .mega__list a:hover, .mega .mega__list a:hover { color: var(--green-700); }

/* ——— Состав: первые 20 позиций, остальные по кнопке ——— */
.composition__wrap { position: relative; }
.composition__toggle { position: absolute; opacity: 0; pointer-events: none; }
/* хвост состава прячем, пока чекбокс не отмечен */
.composition__toggle:not(:checked) ~ .composition__grid > .candy:nth-child(n+21) { display: none; }
.composition__more {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 11px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); font-weight: 700; font-size: 14px; cursor: pointer;
}
.composition__more:hover { border-color: var(--green-600); color: var(--green-700); }
.composition__more::after { content: '▾'; color: var(--muted); }
.composition__toggle:checked ~ .composition__more::after { content: '▴'; }
.composition__more-close,
.composition__toggle:checked ~ .composition__more .composition__more-open { display: none; }
.composition__toggle:checked ~ .composition__more .composition__more-close { display: inline; }

@media (max-width: 900px) {
  .mega { position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; padding: 0; border: 0; display: none; }
  .mega__inner { grid-template-columns: 1fr; }
}

/* ——— Превью одной высоты и по центру ——— */
.card { display: flex; flex-direction: column; height: 100%; }
.card__img {
  display: flex; align-items: center; justify-content: center;
  height: 240px; aspect-ratio: auto; background: var(--paper); overflow: hidden;
}
.card__img img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.grid-products { align-items: stretch; }

.tile__img { display: flex; align-items: center; justify-content: center; height: 180px; background: var(--paper); overflow: hidden; }
.tile__img img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }

@media (max-width: 900px) {
  .card__img { height: 200px; }
  .tile__img { height: 150px; }
}

/* ——— Хиро по макету: фото-фон, текст на светлой левой части ——— */
.hero2 {
  position: relative; background: var(--cream) url('/assets/tivoli/i/hero-bg.webp') right center / cover no-repeat;
  padding: 56px 0 64px; min-height: 720px;
}
/* слева фон должен уходить в однотонный, чтобы текст читался на любом экране */
.hero2::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--cream) 0%, var(--cream) 26%, rgba(250,246,238,.85) 40%, rgba(250,246,238,0) 62%);
}
/* хиро живёт в общем контейнере .wrap, иначе его текст уезжает
   относительно логотипа и заголовков остальных блоков */
.hero2 .wrap { position: relative; }
.hero2__body { max-width: 660px; }
.hero2__title { font-size: clamp(34px, 4.4vw, 58px); line-height: 1.08; margin: 0 0 18px; letter-spacing: -.02em; }
.hero2__title em { font-style: normal; color: var(--gold-dark); }
.hero2__lead { font-size: 17px; line-height: 1.55; color: var(--ink); margin: 0 0 26px; }
.hero2__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.btn--gold-outline { background: var(--paper); border: 1px solid var(--gold); color: var(--gold-dark); }
.btn--gold-outline:hover { background: #fffaf0; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.fact {
  background: rgba(255, 255, 255, .82); border: 1px solid rgba(210, 162, 76, .28);
  border-radius: 14px; padding: 14px 16px; backdrop-filter: blur(2px);
}
.fact b { display: block; font-size: 24px; line-height: 1.1; margin-bottom: 4px; }
.fact span { font-size: 12px; color: var(--muted); line-height: 1.3; display: block; }

.calc-card {
  background: rgba(255, 255, 255, .92); border: 1px solid rgba(210, 162, 76, .28);
  border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow-md); backdrop-filter: blur(2px);
}
.calc-card h2 { font-size: 20px; margin: 0 0 4px; }
.calc-card .muted { font-size: 13px; margin: 0 0 16px; }
.calc-card__row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.calc-card__row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.calc-card__row input {
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 15px; background: var(--paper);
}
.calc-card__out { font-size: 14px; margin-top: 12px; min-height: 20px; }
.calc-card__notes { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.calc-card__notes span { font-size: 12px; color: var(--muted); max-width: 190px; line-height: 1.35; }

/* кнопка конструктора в шапке */
.header__constructor {
  border: 1px solid rgba(210, 162, 76, .8); color: #fff; border-radius: 12px;
  padding: 10px 16px; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.header__constructor:hover { background: rgba(210, 162, 76, .16); }

@media (max-width: 1100px) {
  .hero2 { min-height: 0; padding: 36px 0 40px; background-position: 78% center; }
  .hero2::before { background: linear-gradient(90deg, var(--cream) 0%, rgba(250,246,238,.92) 55%, rgba(250,246,238,.55) 100%); }
  .hero2__body { max-width: none; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .calc-card__row { grid-template-columns: 1fr; }
}

/* ——— Отступы вокруг хлебных крошек ———
   В прототипе у крошек padding 18px сверху и снизу, а следом секция добавляет
   свои 40px: сверху получалось тесно (сразу под шапкой), снизу — провал. */
/* 16 px снизу, а не 12: крошки прилипали к контенту (ТЗ 16.09.2026, п. 3) */
.breadcrumbs { padding: 30px 0 16px; }
.wrap--crumbs + .section { padding-top: 12px; }

/* ——— Главная, новые блоки 06.10.2026: «для кого», «почему», шаги, вопросы, текст ——— */
.home-for {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.home-for__item {
  display: block;
  padding: 22px 22px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: inherit;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.home-for__item:hover { border-color: var(--wine-800); box-shadow: 0 10px 24px rgba(107, 18, 32, .08); transform: translateY(-2px); }
.home-for__item b { display: block; margin-bottom: 8px; font-family: var(--font-display); font-size: 21px; color: var(--wine-800); }
.home-for__item b::after { content: " →"; color: var(--gold); }
.home-for__item span { color: var(--ink-soft); font-size: 15px; line-height: 1.55; }

/* tivoli-theme.css подключается после этого файла — нужна специфичность выше .about-cards */
.about-cards.home-why { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* факты первого экрана стали словами, а не числами: мельче, без разрыва «−8 %» */
.hero2 .fact b { font-size: 21px; line-height: 1.2; font-variant-numeric: normal; } /* tnum у Lora растягивает пробелы */
.home-why .about-card h3 { font-size: 17px; }
.home-why .about-card p { font-size: 15px; }

.home-steps__cta { margin-top: 22px; }

.home-faq { display: grid; gap: 10px; max-width: 900px; }
.home-faq__item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0 22px;
}
.home-faq__item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}
.home-faq__item summary::-webkit-details-marker { display: none; }
.home-faq__item summary::after { content: "+"; flex: none; font-size: 24px; line-height: 1; color: var(--gold); transition: transform .2s; }
.home-faq__item[open] summary::after { transform: rotate(45deg); }
.home-faq__item h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.home-faq__item p { margin: 0 0 18px; color: var(--ink-soft); line-height: 1.6; }

.home-seo { max-width: 76ch; color: var(--ink-soft); line-height: 1.65; }
.home-seo h2 { color: var(--ink); margin: 28px 0 12px; }
.home-seo h2:first-child { margin-top: 0; }
.home-seo p { margin: 0 0 14px; }

@media (max-width: 1100px) {
  .home-for, .about-cards.home-why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .home-for, .about-cards.home-why { grid-template-columns: 1fr; }
  .home-faq__item { padding: 0 16px; }
}
