/* page-grilles.css — лендинг щелевых диффузоров (RedVent, Vent-Line, FLOW) */

/* ===== HERO ===== */
.hero {
  padding: 84px 0 56px;
  background: linear-gradient(180deg, var(--paper) 0%, #EEEBE3 100%);
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 56px);
  max-width: 18ch;
  margin: 14px 0 18px;
}
.hero p {
  font-size: clamp(16px, 1.6vw, 19px);
  max-width: 62ch;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== Общая секция ===== */
.section { padding: 84px 0; border-bottom: 1px solid var(--line); }

.why-head, .brands-head, .install-head, .how-head {
  max-width: 720px;
  margin: 0 auto 56px;
  text-align: center;
}
.why-head h2, .brands-head h2, .install-head h2, .how-head h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  margin: 12px 0 14px;
}
.lead {
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ===== WHY (4 преимущества) ===== */
.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.why-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px 24px;
}
.why-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.why-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}
.why-card p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ===== BRANDS (3 производителя) ===== */
.brands { background: var(--paper-2); }

.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

/* Vent-Line — всего 2 модели, центрируем их с фиксированной шириной вместо растягивания на 3 колонки */
.vl-models {
  grid-template-columns: repeat(2, minmax(0, 380px));
  justify-content: center;
}

/* Кнопка «показать ещё» + скрытый блок оставшихся моделей */
.toggle-wrap {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}
.toggle-models {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.toggle-models svg {
  transition: transform .25s var(--ease);
}
.toggle-models[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
/* Скрытые до клика карточки FLOW (AF со светом, AS) —
   просто display:none, физически лежат в той же сетке/карусели что и первые 3.
   Специфичность .brand-card.hidden-model (2 класса) обязана быть выше базового
   .brand-card{display:flex}, иначе порядок правил в файле может его перебить. */
.brand-card.hidden-model {
  display: none;
}

/* Desktop: 5 карточек в 3 колонки — раскрытая пара повисает слева в новом ряду.
   Считаем сетку в 6 колонках по полколонки, карточка занимает 2 — ширина ровно
   та же, что при repeat(3,1fr), но пару можно сдвинуть на полколонки к центру. */
@media (min-width: 901px) {
  #flowModelsGrid { grid-template-columns: repeat(6, 1fr); }
  #flowModelsGrid .brand-card { grid-column: span 2; }
  #flowModelsGrid .brand-card:nth-child(4) { grid-column: 2 / span 2; }
  #flowModelsGrid .brand-card:nth-child(5) { grid-column: 4 / span 2; }
}

.brand-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.brand-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -24px rgba(0,0,0,.18);
}
.brand-photo {
  aspect-ratio: 4 / 3;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.brand-photo img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.photo-placeholder {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  color: var(--ink-faint);
  font-size: 13px; letter-spacing: .04em;
}
.brand-body {
  padding: 26px 26px 30px;
  display: flex; flex-direction: column;
  flex: 1;
}
.brand-tag {
  display: inline-block;
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
}
.brand-tag.premium {
  background: #2F2A24;
  color: #F2EDE0;
}
.brand-body h3 {
  font-size: 26px;
  margin-bottom: 10px;
  line-height: 1.1;
}
.brand-sub {
  font-family: 'Archivo', sans-serif;
  font-size: 14px;
  color: var(--ink-faint);
  font-weight: 500;
  letter-spacing: .02em;
  display: block;
  margin-top: 4px;
}
.brand-body > p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.brand-features {
  list-style: none;
  padding: 16px 0 0;
  margin-top: auto;
  border-top: 1px solid var(--line);
}
.brand-features li {
  display: flex; gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 7px 0;
}
.brand-features li svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
}

/* ===== INSTALL ===== */
.install-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.install-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 24px;
}
.install-icon {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.install-item h4 {
  font-family: 'Newsreader', serif;
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
}
.install-item p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ===== HOW (4 шага) ===== */
.how { background: var(--paper-2); }
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 30px 24px;
}
.step-num {
  display: inline-block;
  font-family: 'Newsreader', serif;
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 14px;
  line-height: 1;
}
.step h3 {
  font-size: 20px;
  margin-bottom: 8px;
}
.step p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ===== FORM ===== */
.cta-section { padding: 84px 0; background: var(--paper); }
.cta-box {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 48px;
}
.cta-left h2 {
  font-size: clamp(26px, 2.6vw, 34px);
  margin-bottom: 16px;
}
.cta-left p {
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.cta-pros {
  list-style: none;
  padding: 0;
}
.cta-pros li {
  display: flex; gap: 10px;
  font-size: 14.5px;
  color: var(--ink-soft);
  padding: 7px 0;
}
.cta-pros li svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
}

.lead-form { display: flex; flex-direction: column; gap: 16px; }
.lead-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lead-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.lead-form label > span {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.lead-form label > span small {
  color: var(--ink-faint);
  font-weight: 400;
}
.lead-form input,
.lead-form select,
.lead-form textarea {
  font-family: 'Archivo', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: #FBFAF7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color .2s var(--ease);
}
.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.lead-form textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.honeypot { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; pointer-events: none; }

.form-submit { padding: 14px 28px; font-size: 16px; margin-top: 6px; }
.form-status {
  font-size: 14px;
  min-height: 1.4em;
  margin: 4px 0 0;
}
.form-status.ok { color: var(--accent); }
.form-status.err { color: #B5453B; }

/* ===== Адаптив ===== */
@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .cta-box { grid-template-columns: 1fr; padding: 36px 28px; gap: 32px; }

  /* От планшета и уже все ряды карточек — горизонтальные карусели (блок
     CAROUSEL ниже), поэтому кнопка "Показать ещё" для FLOW не нужна:
     все модели видны свайпом. Здесь же принудительно показываем карточки,
     скрытые на десктопе до клика по кнопке. */
  .toggle-wrap { display: none; }
  #flowModelsGrid .brand-card.hidden-model { display: flex; }
}

/* Кнопка "Показать ещё" — только на компьютере/ноутбуке (шире 900px) */
@media (min-width: 901px) {
  .toggle-wrap { display: flex; }
}

@media (max-width: 560px) {
  .hero { padding: 56px 0 40px; }
  .section { padding: 56px 0; }
  .cta-section { padding: 56px 0; }
  .why-grid { grid-template-columns: 1fr; }
  .install-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .lead-form .row { grid-template-columns: 1fr; }
  .cta-box { padding: 28px 20px; }
}

/* === CAROUSEL: свайп карточек на телефоне и планшете ===
   Откат: удалить весь блок между этими комментариями
   (или восстановить page-grilles.css.bak). */

/* --- общая механика карусели: телефон + планшет (<=900px) --- */
@media (max-width: 900px) {
  .why-grid,
  .brand-grid,
  .install-grid {
    display: flex;
    grid-template-columns: none;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    scrollbar-width: none;
  }
  .why-grid::-webkit-scrollbar,
  .brand-grid::-webkit-scrollbar,
  .install-grid::-webkit-scrollbar { display: none; }

  /* .vl-models на десктопе центрируется (justify-content:center) — в карусели
     это свойство сдвигает стартовую позицию скролла; сбрасываем. */
  .vl-models { justify-content: flex-start; }

  /* точки-индикатор карусели (в стиле iOS), заполняются из mobile-carousel.js */
  .carousel-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
  }
  .carousel-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ink-faint, #b8b3a8);
    opacity: .45;
    cursor: pointer;
    transition: opacity .2s var(--ease, ease), transform .2s var(--ease, ease), background .2s;
  }
  .carousel-dot.active {
    opacity: 1;
    background: var(--accent);
    transform: scale(1.3);
  }
}

/* --- планшет: ~2 карточки в ряд, аккуратнее ритм секций --- */
@media (min-width: 561px) and (max-width: 900px) {
  .hero { padding: 64px 0 48px; }
  .section { padding: 64px 0; }
  .cta-section { padding: 64px 0; }
  .why-head, .brands-head, .install-head, .how-head { margin-bottom: 40px; }

  .why-grid,
  .brand-grid,
  .install-grid { padding: 4px 24px 20px; }

  .why-card,
  .install-item {
    flex: 0 0 46%;
    scroll-snap-align: start;
  }
  .brand-card {
    flex: 0 0 48%;
    scroll-snap-align: start;
  }
  /* Vent-Line — всего 2 модели, обе помещаются в ряд: центрируем их
     и убираем точки-индикатор (свайпать нечего) */
  .vl-models { justify-content: center; }
  .vl-models + .carousel-dots { display: none; }
}

/* --- телефон: одна карточка по центру с «подглядыванием» соседей --- */
@media (max-width: 560px) {
  /* боковые отступы = половине "выглядывающего" края соседней карточки,
     чтобы первая и последняя тоже вставали строго по центру */
  .why-grid,
  .brand-grid,
  .install-grid { padding-top: 4px; padding-bottom: 16px; }
  .why-grid     { padding-left: 10%; padding-right: 10%; }
  .brand-grid   { padding-left: 7%;  padding-right: 7%;  }
  .install-grid { padding-left: 14%; padding-right: 14%; }

  .why-card,
  .brand-card,
  .install-item { scroll-snap-align: center; }
  .why-card    { flex: 0 0 80%; }
  .install-item { flex: 0 0 72%; }
  .brand-card  { flex: 0 0 86%; }

  /* компактнее внутренности карточек брендов;
     margin-top:auto из базы прижимает список галочек к низу,
     поэтому у карточек одинаковый нижний край */
  .brand-body { padding: 20px 20px 22px; }
  .brand-body h3 { margin-bottom: 8px; }
  .brand-body > p { margin-bottom: 14px; }
  .brand-features { padding-top: 14px; }
  .brand-features li { padding: 5px 0; }

  /* 3 карточки обзора брендов — самые длинные на телефоне, ужимаем их отдельно */
  .main-brands .brand-photo { aspect-ratio: 16 / 10;}
  .main-brands .brand-body > p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .main-brands .brand-features li { font-size: 13.5px; padding: 4px 0; }
  /* линейка моделей FLOW — подробно расписана ниже своими карточками,
     здесь на телефоне не дублируем, чтобы карточка не раздувалась */
  .main-brands .brand-models { display: none; }

  .carousel-dots { margin-top: 6px; }
}
/* === /CAROUSEL === */

/* === MOBILE: скрыть "Как мы работаем" + компактная форма ===
   Откат: удалить весь блок между этими комментариями. */
@media (max-width: 560px) {
  /* --- скрыть секцию "Как мы работаем" (удали строку ниже, чтобы вернуть) --- */
  #how { display: none; }

  /* --- компактная форма заявки --- */
  .cta-box { padding: 24px 18px; gap: 22px; }
  .cta-left h2 { margin-bottom: 10px; }
  .cta-left p { margin-bottom: 14px; }
  .cta-pros li { padding: 4px 0; font-size: 13.5px; }

  .lead-form { gap: 11px; }
  /* парные поля снова в 2 колонки — форма вдвое короче */
  .lead-form .row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lead-form label > span { font-size: 12px; }
  .lead-form input,
  .lead-form select,
  .lead-form textarea { padding: 10px 12px; font-size: 14px; }
  .lead-form textarea { min-height: 56px; }
  .form-submit { padding: 13px 24px; }
}
/* === /MOBILE: скрыть "Как мы работаем" + компактная форма === */
