/* ==========================================================================
   PENZA TRANSPORT — V4 ДИЗАЙН-СИСТЕМА (Высокая четкость на солнце и Mobile Safe)
   ========================================================================== */

:root {
  /* Основные цвета (Насыщенный королевский синий и чистые поверхности) */
  --sun-bg: #f8fafc;
  --sun-surface: #ffffff;
  --sun-surface-subtle: #f1f5f9;
  --sun-surface-hover: #e2e8f0;

  --sun-border: #cbd5e1;
  --sun-border-strong: #94a3b8;
  --sun-border-light: #e2e8f0;

  /* Высококонтрастная типографика */
  --sun-text: #0f172a;        /* Контраст 14.2:1 (WCAG AAA) */
  --sun-text-muted: #334155;  /* Темно-серый */
  --sun-text-subtle: #64748b; /* Служебный серый */

  /* Фирменные акценты */
  --sun-primary: #1d4ed8;       /* Насыщенный транспортный синий */
  --sun-primary-hover: #1e40af;
  --sun-primary-bg: #eff6ff;    /* Светло-голубой фон выбранного */
  --sun-primary-border: #bfdbfe;

  --sun-badge-bg: #047857;      /* Темно-зеленый статус графика */
  --sun-badge-light: #ecfdf5;
  --sun-badge-border: #a7f3d0;

  /* Виды транспорта */
  --mode-bus: #0284c7;
  --mode-bus-bg: #f0f9ff;
  --mode-bus-border: #bae6fd;

  --mode-trolley: #059669;
  --mode-trolley-bg: #ecfdf5;
  --mode-trolley-border: #a7f3d0;

  --mode-shuttle: #d97706;
  --mode-shuttle-bg: #fffbeb;
  --mode-shuttle-border: #fde68a;

  --mode-train: #dc2626;
  --mode-train-bg: #fef2f2;
  --mode-train-border: #fecaca;

  --mode-suburban: #7c3aed;
  --mode-suburban-bg: #f5f3ff;
  --mode-suburban-border: #ddd6fe;

  --mode-avia: #0891b2;
  --mode-avia-bg: #ecfeff;
  --mode-avia-border: #a5f3fc;

  /* Радиусы и тени */
  --sun-radius: 10px;
  --sun-radius-sm: 6px;
  --sun-radius-full: 9999px;

  --sun-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --sun-shadow: 0 2px 5px rgba(15, 23, 42, 0.07);
  --sun-shadow-md: 0 4px 10px rgba(15, 23, 42, 0.08);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--sun-text);
  background-color: var(--sun-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--sun-bg);
  color: var(--sun-text);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

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

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input {
  font-family: inherit;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Контейнеры */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

.sun-container-route {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.station-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* Карточки */
.sun-card {
  background: var(--sun-surface);
  border: 1px solid var(--sun-border);
  border-radius: var(--sun-radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--sun-shadow-sm);
}

/* ==========================================================================
   ШАПКА САЙТА (Стильный Transport Bar 56px)
   ========================================================================== */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}

/* 1. Блок бренда и города слева */
.header-brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo-card {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-logo-img {
  width: 26px;
  height: 26px;
  display: block;
}

.brand-title {
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1;
}

/* 2. Транспортные вкладки (Центр) */
.header-modes-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.header-modes-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.header-modes-scroll::-webkit-scrollbar {
  display: none;
}

.header-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.header-nav-item .nav-icon {
  font-size: 0.90rem;
  line-height: 1;
}

.header-nav-item:hover {
  color: #1e293b;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.header-nav-item.active {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* 3. Правый блок (Избранное) */
.header-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-fav-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 34px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.header-fav-pill-btn:hover {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.fav-star-icon {
  color: #f59e0b;
  font-size: 0.95rem;
  line-height: 1;
}

.fav-count-pill {
  background: #2563eb;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.2;
}

/* Мобильная навигационная полоса: строго скрыта на десктопе! */
.mobile-nav-strip {
  display: none;
}

@media (max-width: 768px) {
  .header-modes-nav {
    display: none;
  }
  .mobile-nav-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
  }
  .mobile-nav-strip::-webkit-scrollbar {
    display: none;
  }
  .mobile-nav-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .mobile-nav-chip:hover {
    background: #f1f5f9;
    color: #1e293b;
  }
  .mobile-nav-chip.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
  }
}

/* ==========================================================================
   ФИЛЬТРЫ ВИДОВ ТРАНСПОРТА (MODE CHIPS)
   ========================================================================== */
.mode-chips-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0 16px;
}

.mode-chips-strip::-webkit-scrollbar {
  display: none;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.mode-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.mode-chip.active {
  background: var(--sun-primary);
  border-color: var(--sun-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* ==========================================================================
   ПОИСКОВЫЕ БЛОКИ И СЕКЦИИ
   ========================================================================== */
.hero-search-section {
  padding: 12px 0 16px;
}

.hero-h1 {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--sun-text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.hero-sub {
  font-size: 0.90rem;
  color: var(--sun-text-muted);
  margin-bottom: 16px;
}

.search-box-card {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 14px;
  height: 48px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box-card:focus-within {
  border-color: var(--sun-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-box-card .search-icon {
  font-size: 1.05rem;
  color: #94a3b8;
  margin-right: 10px;
  flex-shrink: 0;
}

.search-box-card .search-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--sun-text);
  outline: none;
}

.search-box-card .search-input::placeholder {
  color: #94a3b8;
}

/* Секции и заголовки */
.all-routes-section, .hubs-section, .seo-info-card {
  margin-bottom: 28px;
}

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

.section-head-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--sun-text);
  letter-spacing: -0.01em;
}

.counter-badge {
  display: inline-block;
  padding: 3px 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sun-text-muted);
}

.section-all-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--sun-primary);
  text-decoration: none;
  transition: opacity 0.15s;
}

.section-all-link:hover {
  text-decoration: underline;
}

/* Узловые остановки (Hubs) */
.hubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.hub-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--sun-text);
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.hub-chip:hover {
  border-color: var(--sun-primary);
  color: var(--sun-primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.hub-count {
  display: inline-block;
  padding: 2px 7px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--sun-text-subtle);
}

/* SEO Info Card */
.seo-info-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.sun-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid var(--sun-border);
  border-radius: 8px;
  color: var(--sun-text);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--sun-shadow-sm);
}

.sun-btn-action:hover {
  border-color: var(--sun-primary);
  color: var(--sun-primary);
  background: #f8fafc;
}

.sun-status-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 0.84rem;
  color: #166534;
  font-weight: 600;
}

.sun-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  flex-shrink: 0;
}

.sun-control-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 681px) {
  .sun-control-panel {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }
  .sun-dir-selector {
    flex: 1;
  }
  .sun-segmented {
    width: 330px;
    flex-shrink: 0;
  }
}

.sun-dir-selector {
  width: 100%;
}

.sun-btn.dir-btn {
  width: 100%;
  min-height: 38px;
  background: #ffffff;
  border: 1.5px solid var(--sun-primary);
  color: var(--sun-primary);
  font-size: 0.86rem;
  font-weight: 800;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 0 14px;
  box-shadow: var(--sun-shadow-sm);
  transition: all 0.15s ease;
}

.sun-btn.dir-btn:hover {
  background: var(--sun-primary-bg);
  border-color: var(--sun-primary-hover);
}

.sun-segmented {
  display: flex;
  background: #e2e8f0;
  border: 1px solid var(--sun-border);
  border-radius: 8px;
  padding: 2px;
  gap: 3px;
  width: 100%;
}

@media (min-width: 681px) {
  .sun-segmented {
    width: 330px;
    max-width: 330px;
    flex-shrink: 0;
  }
}

.sun-btn {
  flex: 1;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--sun-text-muted);
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.sun-btn:hover {
  color: var(--sun-text);
  background: rgba(255, 255, 255, 0.6);
}

.sun-btn.active {
  background: #ffffff;
  color: var(--sun-primary);
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* Кнопка смены направления во всю ширину */
.direction-toggle-full-btn {
  width: 100%;
  min-height: 34px;
  background: #ffffff;
  border: 1.5px solid var(--sun-primary);
  color: var(--sun-primary);
  font-size: 0.84rem;
  font-weight: 800;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 10px;
}
.direction-toggle-full-btn:hover {
  background: var(--sun-primary-bg);
}

/* ==========================================================================
   КАРТОЧКА: БЛИЖАЙШИЕ ОТПРАВЛЕНИЯ (Как на скриншоте)
   ========================================================================== */
.upcoming-box-card {
  border: 1px solid var(--sun-primary-border);
  border-left: 4px solid var(--sun-primary);
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--sun-surface);
  box-shadow: var(--sun-shadow-sm);
}

.upcoming-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.upcoming-title {
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--sun-primary);
  letter-spacing: 0.04em;
}

.upcoming-now-clock {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sun-text-subtle);
}

.upcoming-trips-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.upcoming-trip-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1.5px solid var(--sun-border);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.upcoming-trip-btn.active {
  background: #eff6ff;
  border-color: var(--sun-primary);
}

.trip-time-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trip-time-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--sun-text);
}
.upcoming-trip-btn.active .trip-time-val {
  color: var(--sun-primary);
}

.trip-select-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sun-text-subtle);
}
.upcoming-trip-btn.active .trip-select-tag {
  color: var(--sun-primary);
  font-weight: 800;
}

.trip-diff-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sun-text-subtle);
}
.upcoming-trip-btn.active .trip-diff-val {
  color: var(--sun-primary);
  font-weight: 800;
}

/* ==========================================================================
   КАРТОЧКА: ОТ КАКОЙ ОСТАНОВКИ & ТЕРМОМЕТР (Как на скриншоте)
   ========================================================================== */
.stop-filter-box {
  margin-bottom: 8px;
}

.stop-filter-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--sun-text);
  margin-bottom: 4px;
}

.stop-filter-input {
  width: 100%;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--sun-border);
  background: #ffffff;
  color: var(--sun-text);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease;
}
.stop-filter-input:focus {
  border-color: var(--sun-primary);
}

.timeline-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 6px;
  flex-wrap: wrap;
  gap: 4px;
}

.timeline-title {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--sun-text);
}

.selected-trip-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--sun-primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 6px;
}

/* Линия термометра остановок */
.sun-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 6px 0 10px;
}

.sun-timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: var(--sun-surface);
  border-radius: 6px;
  position: relative;
  transition: background 0.15s ease;
}
.sun-timeline-item:hover {
  background: #eff6ff;
}

.sun-node-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid var(--sun-primary);
  background: #ffffff;
  margin: 0 auto;
  z-index: 2;
}

.sun-node-circle.terminal {
  background: var(--sun-primary);
  box-shadow: 0 0 0 2px #bfdbfe;
}

.sun-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 21px;
  top: 22px;
  bottom: -10px;
  width: 2px;
  background: #93c5fd;
  z-index: 1;
}

.stop-name-link {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--sun-text);
  text-decoration: underline;
  text-decoration-color: #cbd5e1;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.stop-name-link:hover {
  color: var(--sun-primary);
  text-decoration-color: var(--sun-primary);
}

.stop-time-col {
  text-align: right;
  line-height: 1.15;
  flex-shrink: 0;
}

.stop-calc-time {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--sun-primary);
}

.stop-offset-text {
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--sun-text-subtle);
}

/* ==========================================================================
   ПОЛНОЕ РАСПИСАНИЕ НА ВЕСЬ ДЕНЬ (Сворачиваемый блок)
   ========================================================================== */
.full-schedule-details {
  margin-bottom: 16px;
  border: 1.5px solid var(--sun-primary);
  border-radius: 8px;
  overflow: hidden;
  background: var(--sun-surface);
}

.full-schedule-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--sun-primary);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.full-schedule-summary::-webkit-details-marker {
  display: none;
}

.full-schedule-badge {
  background: #ffffff;
  color: var(--sun-primary);
  font-size: 0.75rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.sun-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px;
}

.sun-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.sun-table th {
  background: var(--sun-surface-subtle);
  color: var(--sun-text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid var(--sun-border);
  text-align: left;
}

.sun-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--sun-border-light);
  white-space: nowrap;
}

.sun-table tr.current-hour-row {
  background: #eff6ff;
  font-weight: 800;
}
.sun-table tr.current-hour-row th {
  color: var(--sun-primary);
}

/* ==========================================================================
   КАТАЛОГИ И КАРТОЧКИ (Главная, Поезда, Авиа, Остановки)
   ========================================================================== */
.hero-section {
  background: linear-gradient(180deg, #ffffff 0%, var(--sun-bg) 100%);
  border-bottom: 1px solid var(--sun-border);
  padding: 32px 0 24px;
}

.hero-content {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero-h1 {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--sun-text);
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-p {
  font-size: 1rem;
  color: var(--sun-text-muted);
  line-height: 1.4;
  margin-bottom: 20px;
}

.search-wrapper {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.search-input-box {
  display: flex;
  align-items: center;
  background: var(--sun-surface);
  border: 1.5px solid var(--sun-border);
  border-radius: var(--sun-radius-sm);
  padding: 5px 8px 5px 14px;
  box-shadow: var(--sun-shadow-sm);
  transition: border-color 0.15s ease;
}
.search-input-box:focus-within {
  border-color: var(--sun-primary);
}

.search-field {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--sun-text);
  outline: none;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--sun-surface);
  border: 1px solid var(--sun-border);
  border-radius: var(--sun-radius-sm);
  box-shadow: var(--sun-shadow-md);
  max-height: 360px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  text-align: left;
}
.search-dropdown.active {
  display: block;
}

.search-result-group-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--sun-text-subtle);
  background: var(--sun-surface-subtle);
  padding: 6px 12px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--sun-border-light);
}
.search-result-item:hover {
  background: var(--sun-surface-subtle);
}

/* Бейджи видов транспорта */
.route-badge {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  padding: 5px 10px;
  border-radius: var(--sun-radius-sm);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  max-width: 74px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  box-sizing: border-box;
}

.badge-bus {
  background: var(--mode-bus-bg);
  color: var(--mode-bus);
  border: 1px solid var(--mode-bus-border);
}
.badge-trolley {
  background: var(--mode-trolley-bg);
  color: var(--mode-trolley);
  border: 1px solid var(--mode-trolley-border);
}
.badge-shuttle {
  background: var(--mode-shuttle-bg);
  color: var(--mode-shuttle);
  border: 1px solid var(--mode-shuttle-border);
}
.badge-train {
  background: var(--mode-train-bg);
  color: var(--mode-train);
  border: 1px solid var(--mode-train-border);
}
.badge-suburban {
  background: var(--mode-suburban-bg);
  color: var(--mode-suburban);
  border: 1px solid var(--mode-suburban-border);
}
.badge-avia {
  background: var(--mode-avia-bg);
  color: var(--mode-avia);
  border: 1px solid var(--mode-avia-border);
}

.routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

.route-card {
  background: var(--sun-surface);
  border: 1px solid var(--sun-border);
  border-radius: var(--sun-radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--sun-shadow-sm);
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
}
.route-card:hover {
  border-color: var(--sun-primary);
  transform: translateY(-2px);
  box-shadow: var(--sun-shadow-md);
}
.route-card:hover .route-endpoints {
  color: var(--sun-primary);
}

.route-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  padding-right: 28px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.route-info-head {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.route-type-label {
  font-size: 0.70rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--sun-text-subtle);
  margin-bottom: 2px;
}

.route-endpoints {
  font-size: 0.90rem;
  font-weight: 700;
  color: var(--sun-text);
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: break-word;
}

.route-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--sun-text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--sun-surface-subtle);
}

.route-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--sun-text-subtle);
  padding: 4px;
  border-radius: 4px;
}
.route-fav-btn:hover, .route-fav-btn.active {
  color: #f59e0b;
}

/* Хабы */
.hubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.hub-card {
  background: var(--sun-surface);
  border: 1px solid var(--sun-border);
  border-radius: var(--sun-radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hub-card:hover {
  border-color: var(--sun-primary);
  background: var(--sun-primary-bg);
}

/* Таблицы отправлений вокзала и аэропорта */
.departures-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.departures-table th {
  background: var(--sun-surface-subtle);
  color: var(--sun-text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid var(--sun-border);
  text-align: left;
}

.departures-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sun-border-light);
}

.eta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--sun-radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  background: #dcfce7;
  color: #15803d;
}

/* Подвал сайта */
.site-footer {
  background: var(--sun-surface);
  border-top: 1px solid var(--sun-border);
  padding: 28px 0 20px;
  margin-top: auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 18px;
}

.footer-brand-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--sun-text);
  margin-bottom: 4px;
}

.footer-brand-desc {
  font-size: 0.82rem;
  color: var(--sun-text-muted);
  line-height: 1.45;
  max-width: 320px;
}

.footer-links-group {
  display: flex;
  gap: 28px;
}

.footer-col-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--sun-text-subtle);
  margin-bottom: 8px;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-link {
  font-size: 0.82rem;
  color: var(--sun-text);
}
.footer-link:hover {
  color: var(--sun-primary);
}

.footer-bottom {
  padding-top: 14px;
  border-top: 1px solid var(--sun-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--sun-text-subtle);
}

/* Мобильная адаптивность */
@media (max-width: 768px) {
  .hero-h1 {
    font-size: 1.55rem;
  }
  .routes-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .header-modes-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0 10px;
  }
  .sun-container-route,
  .station-container {
    padding: 12px 8px 30px;
  }
  .header-inner {
    height: 52px;
  }
  .header-modes-nav {
    display: none;
  }
}

/* ==========================================================================
   СТРАНИЦЫ ОСТАНОВОК, КАТАЛОГОВ И ИНФО-РАЗДЕЛОВ (V4 STANDARD)
   ========================================================================== */

.hero-stop-banner {
  background: linear-gradient(135deg, #0b192c 0%, #1e3e62 50%, #000000 100%);
  color: #ffffff;
  border-radius: var(--sun-radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.hero-stop-banner .hero-breadcrumbs a {
  color: rgba(255, 255, 255, 0.75);
}
.hero-stop-banner .hero-breadcrumbs a:hover {
  color: #ffffff;
}
.hero-stop-banner .hero-breadcrumbs .sep {
  color: rgba(255, 255, 255, 0.4);
}
.hero-stop-banner .hero-breadcrumbs .cur {
  color: #ffffff;
  font-weight: 600;
}

.hero-stop-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stop-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 260px;
}

.hero-stop-icon-box {
  width: 58px;
  height: 58px;
  background: var(--sun-primary);
  color: #ffffff;
  font-size: 1.8rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.35);
  flex-shrink: 0;
}

.hero-stop-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.hero-stop-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 4px;
}

.hero-stop-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.hero-stop-stat-badge {
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-stop-stat-num {
  font-size: 1.7rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.hero-stop-stat-lbl {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}

.hero-stop-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.stop-metric-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 8px;
}

.stop-metric-icon {
  font-size: 1.2rem;
}

.stop-metric-lbl {
  font-size: 0.70rem;
  color: rgba(255, 255, 255, 0.65);
  display: block;
}

.stop-metric-val {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
  display: block;
}

/* Двухколоночный макет страницы остановки */
.stop-content-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 900px) {
  .stop-content-layout {
    grid-template-columns: 1fr;
  }
}

.stop-section-card {
  background: var(--sun-surface);
  border: 1px solid var(--sun-border);
  border-radius: var(--sun-radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--sun-shadow-sm);
}

.stop-section-h2 {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--sun-text);
  margin-bottom: 4px;
}

.stop-section-sub {
  font-size: 0.82rem;
  color: var(--sun-text-muted);
  margin-bottom: 14px;
}

/* Маршруты через остановку */
.stop-route-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--sun-border-light);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--sun-surface);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.stop-route-row:hover {
  border-color: var(--sun-primary);
  background: var(--sun-surface-subtle);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.stop-route-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.stop-route-badge {
  font-size: 0.95rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--sun-primary);
  min-width: 44px;
  text-align: center;
}

.stop-route-row-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--sun-text);
}

.stop-route-row-dir {
  font-size: 0.78rem;
  color: var(--sun-text-muted);
}

.stop-route-row-btn {
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--sun-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Направления и времена отправлений на остановке */
.direction-matrix-block {
  border: 1px solid var(--sun-border-light);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--sun-surface-subtle);
}

.dir-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--sun-text);
}

.times-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.mini-time-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--sun-surface);
  border: 1px solid var(--sun-border-light);
  color: var(--sun-primary);
}

/* Сайдбар соседних остановок */
.nearby-stops-list {
  display: flex;
  flex-direction: column;
}

.nearby-stop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--sun-border-light);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--sun-text);
  transition: color 0.15s, background 0.15s;
}

.nearby-stop-item:last-child {
  border-bottom: none;
}

.nearby-stop-item:hover {
  color: var(--sun-primary);
  background: var(--sun-surface-subtle);
}

.nearby-stop-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sun-text-subtle);
  background: var(--sun-surface-subtle);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Ссылка на остановку в термометре маршрута */
.stop-name-link {
  font-size: 0.90rem;
  font-weight: 700;
  color: var(--sun-text);
  text-decoration: none;
  transition: color 0.15s;
}

.stop-name-link:hover {
  color: var(--sun-primary);
  text-decoration: underline;
}

/* Каталоги остановок и маршрутов */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.catalog-stop-card {
  display: block;
  background: var(--sun-surface);
  border: 1px solid var(--sun-border);
  border-radius: var(--sun-radius);
  padding: 14px;
  transition: all 0.15s ease;
}

.catalog-stop-card:hover {
  border-color: var(--sun-primary);
  box-shadow: var(--sun-shadow);
  transform: translateY(-1px);
}

.catalog-stop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.catalog-stop-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--sun-text);
  line-height: 1.3;
}

.catalog-stop-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sun-primary);
  background: var(--sun-primary-bg);
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.catalog-stop-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mini-route-pill {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--sun-surface-subtle);
  color: var(--sun-text-muted);
}

/* Страницы инфо / правил / оплаты */
.legal-page-card {
  background: var(--sun-surface);
  border: 1px solid var(--sun-border);
  border-radius: var(--sun-radius);
  padding: 26px 28px;
  margin: 18px 0 30px;
  box-shadow: var(--sun-shadow-sm);
}

.legal-h1 {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--sun-text);
  margin-bottom: 10px;
}

.legal-lead {
  font-size: 0.95rem;
  color: var(--sun-text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.legal-section-block {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--sun-border-light);
}

.legal-section-block:last-child {
  border-bottom: none;
}

.legal-h2 {
  font-size: 1.10rem;
  font-weight: 800;
  color: var(--sun-text);
  margin-bottom: 8px;
}

.legal-text {
  font-size: 0.88rem;
  color: var(--sun-text-muted);
  line-height: 1.6;
}

.legal-list {
  margin-left: 20px;
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--sun-text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   FAQ АККОРДЕОН
   ========================================================================== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: background 0.15s ease;
}

.faq-item[open] {
  background: #ffffff;
  border-color: #cbd5e1;
}

.faq-summary {
  padding: 14px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--sun-text);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "›";
  font-size: 1.2rem;
  font-weight: 800;
  color: #94a3b8;
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-summary::after {
  transform: rotate(-90deg);
  color: var(--sun-primary);
}

.faq-content {
  padding: 0 16px 14px;
  font-size: 0.88rem;
  color: var(--sun-text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   ИЗБРАННЫЕ МАРШРУТЫ (MY TRANSIT)
   ========================================================================== */
.my-transit-section {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.my-transit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.meta-tag-live {
  display: inline-block;
  color: #16a34a;
  font-weight: 700;
}

.stop-routes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   ЖЕЛЕЗНОДОРОЖНЫЕ КАРТОЧКИ (ПОЕЗДА И ЭЛЕКТРИЧКИ)
   ========================================================================== */
.trains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.train-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.train-card:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.12);
}

.train-card-action {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0284c7;
}

.train-card-action .action-arrow {
  transition: transform 0.15s ease;
  font-size: 0.95rem;
}

.train-card:hover .train-card-action .action-arrow {
  transform: translateX(4px);
}

.train-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.train-num-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.badge-suburban {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.badge-train {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.train-time-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.train-time-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: #0f172a;
}

.train-days-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

.train-route-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.4;
  margin-bottom: 12px;
}

.train-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.78rem;
  color: #64748b;
}

.train-carrier-lbl {
  font-weight: 600;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.train-stops-count {
  font-weight: 700;
  background: #f8fafc;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.train-stops-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #f1f5f9;
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.45;
}

.stops-lbl {
  font-weight: 700;
  color: #475569;
  display: block;
  margin-bottom: 3px;
}

.stops-text {
  color: #64748b;
  margin: 0;
  word-break: break-word;
}

.hero-catalog-banner {
  background: linear-gradient(135deg, #0b192c 0%, #1e3e62 60%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--sun-radius);
  padding: 24px 26px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.hero-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.hero-catalog-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.25;
}

.hero-catalog-lead {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
  max-width: 620px;
}

.hero-stat-badge {
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.stat-big-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.stat-small-text {
  display: block;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  margin-top: 3px;
}

/* Переключатель категорий ж/д транспорта (электрички / поезда) */
.rail-mode-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.rail-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  backdrop-filter: blur(8px);
}

.rail-mode-tab:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

.rail-mode-tab.active {
  background: #ffffff;
  color: #0b192c;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.rail-mode-tab .type-count-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
}

.rail-mode-tab.active .type-count-badge {
  background: #0284c7;
  color: #ffffff;
}

.catalog-search-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border-radius: 10px;
  padding: 6px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.search-ico {
  font-size: 1.05rem;
  flex-shrink: 0;
}

.catalog-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.92rem;
  font-family: inherit;
  color: #0f172a;
  padding: 6px 0;
  background: transparent;
}

.catalog-search-input::placeholder {
  color: #94a3b8;
}

.search-counter-badge {
  font-size: 0.74rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.empty-notice-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 36px 24px;
  text-align: center;
  max-width: 600px;
  margin: 30px auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   СТРАНИЦА ДЕТАЛЬНОГО РАСПИСАНИЯ ПОЕЗДА / ЭЛЕКТРИЧКИ (DETAIL VIEW)
   ========================================================================== */
.hero-train-banner {
  position: relative;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  border-radius: 16px;
  padding: 2.25rem 2.5rem;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.2);
}

.hero-train-banner .hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 20%, rgba(2, 132, 199, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero-train-banner .hero-content {
  position: relative;
  z-index: 2;
}

.hero-train-banner .hero-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.hero-train-banner .hero-breadcrumbs a {
  color: #cbd5e1;
  text-decoration: none;
}

.hero-train-banner .hero-breadcrumbs a:hover {
  color: #fff;
}

.hero-train-banner .hero-breadcrumbs .sep {
  color: #64748b;
}

.hero-train-banner .hero-breadcrumbs .cur {
  color: #fff;
  font-weight: 600;
}

.hero-main-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.train-hero-badge {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  flex-shrink: 0;
}

.train-num {
  font-size: 0.95rem;
  font-weight: 800;
  margin-top: 0.4rem;
  color: #38bdf8;
  white-space: nowrap;
}

.hero-text-box {
  flex-grow: 1;
}

.hero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: #fff;
  margin: 0 0 0.4rem;
  line-height: 1.25;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: #cbd5e1;
  margin: 0;
}

.hero-stat-badge {
  text-align: right;
  flex-shrink: 0;
}

.stat-big-num {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  display: block;
}

.stat-small-text {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-glass-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.metric-icon-box {
  font-size: 1.5rem;
}

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.75rem;
  color: #94a3b8;
}

.train-metric-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
}

.train-content-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 900px) {
  .train-content-layout {
    grid-template-columns: 1fr;
  }
  .hero-train-banner {
    padding: 1.5rem 1.25rem;
  }
  .hero-main-row {
    flex-direction: column;
    gap: 1rem;
  }
  .hero-stat-badge {
    text-align: left;
  }
  .hero-title {
    font-size: 1.45rem;
  }
}

.train-section-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.col-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.35rem;
}

.section-subtext {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 1.5rem;
}

.train-stops-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.train-stop-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  gap: 1rem;
  border-bottom: 1px solid #f8fafc;
}

.train-stop-item:last-child {
  border-bottom: none;
}

.stop-order-badge {
  font-family: monospace;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
  min-width: 32px;
}

.timeline-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 20px;
}

.node-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #0284c7;
  z-index: 2;
}

.node-circle.node-start {
  border-color: #16a34a;
  background: #16a34a;
}

.node-circle.node-end {
  border-color: #e11d48;
  background: #e11d48;
}

.node-circle.node-current-city {
  border-color: #f59e0b;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.node-line {
  position: absolute;
  top: 14px;
  bottom: -32px;
  width: 2px;
  background: #cbd5e1;
  z-index: 1;
}

.train-stop-item:last-child .node-line {
  display: none;
}

.stop-info-box {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.stop-name-text {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.current-city-name {
  color: #b45309;
  font-weight: 800;
}

.stop-role-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.start-badge {
  background: #dcfce7;
  color: #15803d;
}

.end-badge {
  background: #fee2e2;
  color: #b91c1c;
}

.current-city-badge {
  background: #fef3c7;
  color: #92400e;
}

.stop-time-cell {
  min-width: 60px;
  text-align: right;
}

.dep-time-tag {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0284c7;
  background: #e0f2fe;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.dep-time-tag.current-time-tag {
  color: #b45309;
  background: #fef3c7;
}

.widget-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 1rem;
}

.other-trains-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.other-train-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.other-train-item:hover {
  border-color: #0284c7;
  background: #fff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
  transform: translateY(-1px);
}

.other-train-num {
  background: #0284c7;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

.other-train-num.badge-train {
  background: #dc2626;
}

.other-train-info {
  flex-grow: 1;
  overflow: hidden;
}

.other-train-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.other-train-sub {
  font-size: 0.75rem;
  color: #64748b;
}

.other-train-arrow {
  color: #0284c7;
  font-weight: 700;
}

/* ==========================================================================
   МОБИЛЬНАЯ АДАПТИВНОСТЬ, КОМПАКТНЫЕ ЗАГОЛОВКИ И ЗАЩИТА ОТ OVERFLOW
   ========================================================================== */

/* 1. Защита шапки от распирания длинными названиями городов (Смоленск, Комсомольск-на-Амуре) */
@media (max-width: 480px) {
  .header-inner {
    gap: 8px !important;
  }
  .brand-link {
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }
  .brand-title {
    font-size: 0.95rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .header-fav-pill-btn {
    padding: 0 8px !important;
    flex-shrink: 0 !important;
  }
  .fav-pill-text {
    display: none !important;
  }
}

/* 2. Защита селектора направления в автобусах от распирания */
.sun-dir-selector {
  min-width: 0;
}
.sun-btn.dir-btn {
  min-width: 0;
}
.dir-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 3. Защита страниц остановок (stations/{slug}) от распирания */
.stop-content-layout {
  min-width: 0;
}
.stop-route-row {
  min-width: 0;
  flex-wrap: wrap;
}
.stop-route-row-left {
  min-width: 0;
}
.stop-route-row-btn {
  white-space: normal;
  flex-shrink: 0;
}
@media (max-width: 680px) {
  .stop-route-row-btn {
    font-size: 0.75rem;
  }
  .hero-stop-title {
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
  }
  .hero-stop-banner {
    padding: 16px 14px !important;
  }
}

/* 4. Защита таймлайна электричек и поездов (suburban / trains) */
.train-content-layout,
.train-main-col,
.train-sidebar-col,
.train-section-card,
.train-timeline-box,
.other-train-item,
.other-train-info,
.stop-info-box {
  min-width: 0 !important;
}

@media (max-width: 900px) {
  .train-content-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .hero-train-banner {
    padding: 1.25rem 1rem !important;
    margin-bottom: 1.25rem !important;
  }
  .hero-main-row {
    gap: 0.85rem !important;
    margin-bottom: 1.25rem !important;
  }
  .train-hero-badge {
    padding: 0.5rem 0.75rem !important;
    font-size: 1.6rem !important;
  }
  .hero-title {
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
  }
  .hero-subtitle {
    font-size: 0.90rem !important;
  }
  .train-section-card {
    padding: 1.15rem 1rem !important;
  }
  .train-stop-item {
    gap: 0.65rem !important;
    padding: 0.6rem 0 !important;
  }
  .stop-name-text {
    font-size: 0.88rem !important;
  }
  .stop-role-badge {
    font-size: 0.65rem !important;
    padding: 0.1rem 0.4rem !important;
  }
  .dep-time-tag {
    font-size: 0.82rem !important;
    padding: 0.15rem 0.45rem !important;
  }
  .stat-big-num {
    font-size: 1.4rem !important;
  }
}

/* 5. Аккуратные, компактные заголовки на мобилках в каталогах и защита футера */
@media (max-width: 680px) {
  .hero-header-box h1,
  .hero-h1 {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
  }
  .footer-links-group {
    flex-wrap: wrap;
    gap: 16px;
  }
}






