/* E-Mobil: секция 04b «Зарядные станции» (#stations). Правка 3, версия ТЗ 07.10.2026. Классы .stations__.
   Две вкладки: «Станции E-Mobil» (3 карточки) и «Фирменные станции машин» (4 карточки).
   Вкладки, чипы мощности и точки лент - js/app.js. Без js вкладок нет, обе группы карточек видны друг под другом
   со своими заголовками (.stations__panel-title), точек нет, ленты листаются как есть.
   Вкладка 1: до 1023 px - лента (scroll-snap, виден край следующей, точки), от 1024 - 3 в ряд.
   Вкладка 2: до 767 px - лента, 768-1023 - 2×2, от 1024 - 4 в ряд.
   Строки карточек (фото, тег, название, ..., цена, кнопка) общие для всех карточек ряда (subgrid):
   цены и кнопки на одной линии, кнопки одной высоты, даже если подпись одной переносится на 2 строки.
   Без subgrid карточка - колонка, цена и кнопка прижаты к низу. */

#stations .section__lead { max-width: var(--measure); } /* абзац не шире ~65 знаков, как в других секциях */

/* ---------- Вкладки-«таблетки» ---------- */
.stations__tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 999px;
  background: var(--c-white);
  box-shadow: var(--shadow);
}
.stations__tabs[hidden] { display: none; }
.stations__tab {
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-primary);
  font-weight: 700;
  font-size: 15px;
  line-height: 20px;
  white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.stations__tab:hover { background: var(--c-light); }
.stations__tab[aria-selected="true"] { background: var(--c-primary); color: var(--c-white); }
@media (max-width: 420px) {
  .stations__tabs { width: 100%; }
  .stations__tab { flex: 1 1 0; padding: 10px 8px; font-size: 14px; white-space: normal; }
}
@media (min-width: 1024px) { .stations__tabs { margin-bottom: 32px; } }

/* Заголовки групп - только без js (с вкладками их роль играют вкладки) */
.stations__panel-title { margin-bottom: 8px; color: var(--c-primary); font-weight: 700; font-size: var(--fs-subtitle); line-height: var(--lh-subtitle); }
#stations.is-tabbed .stations__panel-title { display: none; }
.stations__panel + .stations__panel { margin-top: 32px; }
#stations.is-tabbed .stations__panel + .stations__panel { margin-top: 0; }
.stations__panel[hidden] { display: none; }
.stations__intro { max-width: var(--measure); margin-bottom: 8px; font-weight: 500; }

/* ---------- Лента / сетка карточек ---------- */
.stations__list {
  display: flex;
  gap: 16px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 16px var(--gutter) 16px; /* сверху - место под ярлык карточки A08 */
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--gutter);
  -webkit-overflow-scrolling: touch;
}
.stations__card {
  position: relative;
  flex: 0 0 min(84%, 340px);
  min-width: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.stations__card--brand { flex-basis: min(78%, 300px); }
/* всё, кроме фото и ярлыка, - с боковыми отступами карточки */
.stations__card > :not(.stations__photo):not(.stations__badge) { padding-left: var(--card-pad); padding-right: var(--card-pad); }

@supports (grid-template-rows: subgrid) {
  .stations__list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(84%, 340px);
    grid-template-rows: repeat(8, auto);   /* фото, тег, название, описание, список, чипы, цена, кнопка */
    column-gap: 16px;
    row-gap: 0;
  }
  .stations__card { display: grid; grid-row: span 8; grid-template-rows: subgrid; row-gap: 0; }
  .stations__list--brand { grid-auto-columns: min(78%, 300px); grid-template-rows: repeat(6, auto); } /* фото, тег, название, факты, цена, кнопка */
  .stations__card--brand { grid-row: span 6; }
  .stations__foot { display: flex; flex-direction: column; }
  .stations__foot .btn { flex: 1 0 auto; } /* кнопка растягивается на высоту общей строки */
}

/* Вкладка 2 на планшете: 2×2 */
@media (min-width: 768px) {
  .stations__list--brand {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 16px 0 0;
    overflow: visible;
  }
  @supports (grid-template-rows: subgrid) {
    .stations__list--brand { grid-template-rows: none; row-gap: 24px; }
  }
}

@media (min-width: 1024px) {
  .stations__list {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
    margin: 0;
    padding: 14px 0 0;
    overflow: visible;
  }
  .stations__list--brand { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 20px; }
  @supports (grid-template-rows: subgrid) {
    .stations__list--brand { grid-template-rows: repeat(6, auto); row-gap: 0; }
  }
  .stations__card--brand { --card-pad: 20px; }
}

/* Рекомендуемая для домов: рамка 2 px акцентом (вторая половина - внутренней тенью, без сдвига вёрстки) */
.stations__card--main {
  border-color: var(--c-accent);
  box-shadow: inset 0 0 0 1px var(--c-accent), var(--shadow);
}
.stations__badge {
  position: absolute;
  top: 0;
  left: var(--card-pad);
  z-index: 1;
  transform: translateY(-50%);
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--c-accent);
  color: var(--c-dark);
  font-weight: 700;
  font-size: var(--fs-micro);
  line-height: var(--lh-micro);
  letter-spacing: .06em;
  white-space: nowrap;
}

/* ---------- Фото: квадрат 1:1, белый фон, станция по центру ---------- */
.stations__photo {
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--radius-card) - 1px) calc(var(--radius-card) - 1px) 0 0;
  border-bottom: 1px solid var(--c-line);
  background: var(--c-white);
  overflow: hidden;
}
.stations__photo img { width: 100%; height: 100%; object-fit: contain; }
/* Карточка «Ваша станция»: тёмная плашка с иконкой вилки */
.stations__photo--own {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--c-dark);
  border-bottom-color: transparent;
  color: var(--c-accent);
}
.stations__photo--own svg { width: 96px; height: 96px; }
.stations__own-label {
  color: var(--c-white);
  font-weight: 700;
  font-size: var(--fs-micro);
  line-height: var(--lh-micro);
  letter-spacing: .14em;
}

/* ---------- Текст карточки ---------- */
.stations__tag { margin-top: 20px; }
.stations__card .tag { background: var(--c-light); }
.card h3.stations__name {
  margin: 10px 0 0;
  color: var(--c-primary);
  font-weight: 700;
  font-size: 22px;
  line-height: 30px;
  letter-spacing: 0;
  text-transform: none;
}
.stations__desc { margin-top: 6px; font-weight: 500; font-size: var(--fs-body); line-height: var(--lh-body); }
.stations__facts { margin-top: 6px; }
.stations__fact { font-size: var(--fs-body); line-height: var(--lh-body); }
.stations__fact + .stations__fact { margin-top: 4px; }

/* Список с галочками */
.stations__points { display: grid; align-content: start; gap: 8px; margin-top: 16px; }
.stations__points li { position: relative; padding-left: 30px; font-size: var(--fs-body); line-height: var(--lh-body); }
.stations__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(104, 173, 173, .2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2303525F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.2l3 3 6-6.4'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
}

/* Чипы мощности: выбранный - фон #03525F, текст белый. Рамка у всех одинаковая - смена выбора без скачка */
.stations__chips { display: flex; flex-wrap: wrap; align-content: flex-end; gap: 6px; margin-top: 20px; }
.stations__chip {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  background: var(--c-white);
  color: var(--c-primary);
  font-weight: 600;
  font-size: var(--fs-micro);
  line-height: var(--lh-micro);
  white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}
.stations__chip:hover { border-color: var(--c-primary); }
.stations__chip[aria-pressed="true"] { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-white); }
.stations__chips--empty { margin-top: 0; }

/* Цена: 700 26/32 #03525F, «по запросу» - тот же размер, #464646. Цифры моноширинные - смена цены без скачка */
.stations__price { margin-top: 14px; }
.stations__price-value {
  color: var(--c-primary);
  font-weight: 700;
  font-size: 26px;
  line-height: 32px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stations__price-value--ask { color: var(--c-text); }
.stations__price-note { margin-top: 2px; font-size: var(--fs-small); line-height: var(--lh-small); }

/* Кнопка - внизу карточки */
.stations__foot { padding-top: 20px; padding-bottom: var(--card-pad); }
@supports not (grid-template-rows: subgrid) {
  .stations__price { margin-top: auto; padding-top: 14px; }
}
.stations__foot .btn { width: 100%; padding-left: 16px; padding-right: 16px; }

/* Короткие строки карточек - по левому краю, без переносов (общее правило «по ширине» в base.css) */
.stations__card p, .stations__card li, .stations__how p, .stations__intro {
  text-align: left;
  -webkit-hyphens: manual;
  hyphens: manual;
}

/* Наведение (мышь): подъём на 2 px, тень сильнее. При reduced-motion - без подъёма */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .stations__card { transition: transform .2s ease-out, box-shadow .2s ease-out; }
  .stations__card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
  .stations__card--main:hover { box-shadow: inset 0 0 0 1px var(--c-accent), var(--shadow-hover); }
}

/* ---------- Точки лент (только пока лента листается) ---------- */
.stations__dots { display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
.stations__dots[hidden] { display: none; }
.stations__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}
.stations__dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(3, 82, 95, .25);
  transition: width .2s, background-color .2s;
}
.stations__dot[aria-current="true"]::before { width: 20px; background: var(--c-primary); }

/* ---------- Как подбираем станцию ---------- */
.stations__how { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--c-line); }
.stations__how-title { margin-bottom: 20px; color: var(--c-primary); font-weight: 700; font-size: var(--fs-subtitle); line-height: var(--lh-subtitle); }
.stations__how-list { display: grid; gap: 20px; }
.stations__how-item { display: flex; align-items: flex-start; gap: 14px; }
.stations__how-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-white);
  color: var(--c-primary);
  box-shadow: var(--shadow);
}
.stations__how-icon svg { width: 22px; height: 22px; }
.stations__how-name { margin-bottom: 4px; color: var(--c-primary); font-weight: 700; font-size: 16px; line-height: 22px; }
.stations__how-text { font-size: var(--fs-body); line-height: var(--lh-body); }
@media (min-width: 768px) {
  .stations__how-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
}
/* 768-1023: колонки узкие - иконка над текстом, а не сбоку */
@media (min-width: 768px) and (max-width: 1023px) {
  .stations__how-item { flex-direction: column; gap: 12px; }
}
@media (min-width: 1024px) {
  .stations__how { margin-top: 56px; padding-top: 40px; }
  .stations__how-title { margin-bottom: 24px; }
}
