/**
 * Общие стили для всех страниц
 */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-brand-primary: #e60000;
  --color-brand-primary-dark: #b30000;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    "Segoe UI Variable",
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "Noto Sans",
    "Liberation Sans",
    sans-serif;
  line-height: 1.5;
  color: #1f2937;
  background: #f8fafc;
  /* Страховка для мобилок: не даём случайным длинным строкам создавать горизонтальный скролл */
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

@media (max-width: 768px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
}

/* ===== BACK LINK ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid rgba(29, 78, 216, 0.25);
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.back-link:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.back-link:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.back-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28), 0 10px 22px rgba(37, 99, 235, 0.22);
}

.back-link svg {
  width: 20px;
  height: 20px;
}

/* ===== PAGE HEADER ===== */
/* Унифицированный header для внутренних страниц */
.page-header,
.route-header,
.category-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 0;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  transition: all 0.15s ease;
}

.btn:focus {
  outline: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.2), 0 4px 14px rgba(230, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-brand-primary) 0%, var(--color-brand-primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(230, 0, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(230, 0, 0, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: #1f2937;
  border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

/* ===== INPUTS ===== */
.input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.1);
}

.input::placeholder {
  color: #9ca3af;
}

/* ===== SUGGEST DROPDOWN ===== */
.suggest-wrapper {
  position: relative;
}

.suggest-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  max-height: 360px;
  overflow-y: auto;
  margin-top: 8px;
}

.suggest-item {
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #f3f4f6;
}

.suggest-item:last-child {
  border-bottom: none;
}

.suggest-item:hover,
.suggest-item--active {
  background: #f3f4f6;
}

.suggest-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1f2937;
}

.suggest-subtitle {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 2px;
}

.suggest-no-results {
  padding: 20px;
  text-align: center;
}

.suggest-no-results__icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.suggest-no-results__text {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.card-clickable {
  cursor: pointer;
}

/* ===== SECTION ===== */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: #1f2937;
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
  margin-bottom: 24px;
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.breadcrumbs__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs__item:not(:last-child)::after {
  content: '→';
  color: #9ca3af;
}

.breadcrumbs__link {
  color: #6b7280;
  transition: color 0.15s;
}

.breadcrumbs__link:hover {
  color: var(--color-brand-primary);
}

.breadcrumbs__item--current {
  color: #1f2937;
  font-weight: 500;
  /* Длинные названия на мобилке: переносим, чтобы не вылезало за контейнер */
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 480px) {
  .breadcrumbs__list {
    font-size: 0.8125rem;
  }
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  background: #f3f4f6;
  color: #4b5563;
}

.badge-red {
  background: #fef2f2;
  color: #dc2626;
}

/* ===== LINE BADGES (транспорт) ===== */
.line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 11px;
  color: white;
}

.aero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--color-brand-primary) 0%, var(--color-brand-primary-dark) 100%);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
}

/* ===== LUCIDE ICONS ===== */
.step-icon {
  width: 20px;
  height: 20px;
  stroke: #6b7280;
  stroke-width: 2;
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-muted { color: #6b7280; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.hidden { display: none; }

/* Атрибут hidden: должен выигрывать у любых display:* в author CSS (без !important) */
html [hidden] { display: none; }

/* ===== LOADING STATE ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--color-brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== FOOTER LEGAL ===== */
.footer {
  padding: 12px 0;
  text-align: center;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
}

.footer-disclaimer {
  width: 100%;
  max-width: none;
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}

.footer-legal {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

