/* Общие стили */
html {
  background-color: rgb(0, 2, 252);
  overscroll-behavior-y: none;
}

* {
  box-sizing: border-box;
}
body {
  font-family: 'Roboto', Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 16px;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  background-image: url('static/images/spb-rivers-background.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Для мобильных устройств основной текст выравниваем по ширине */
@media (max-width: 600px) {
  .mobile-header {
    background-color: rgba(0,2,252,0.55);
    color: #fff;
    padding: 8px 10px 10px;
    text-align: center;
  }

  .mobile-header .logo-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0 0 6px 0;
  }

  .mobile-header .logo-list li {
    margin: 0;
    line-height: 0;
  }

  .mobile-header .logo-list img {
    display: block;
    height: 24px;
    width: auto;
    object-fit: contain;
    max-width: 90vw;
  }

  .mobile-header .contact-messengers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 10px;
    margin: 0 0 8px 0;
    padding: 0;
  }

  .mobile-header .contact-number {
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .mobile-header .messengers {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .mobile-header .messengers a {
    margin: 0;
    display: flex;
    align-items: center;
  }

  .mobile-header .messenger-icon {
    width: 26px;
    height: 26px;
    margin: 0;
  }

  .mobile-header .whatsapp-icon,
  .mobile-header .vk-icon {
    width: 26px;
    height: 26px;
  }

  .top-nav {
    padding: 6px 0 8px;
  }

  .top-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .top-nav ul li {
    margin: 0;
  }

  .top-nav ul li a {
    font-size: 0.8rem;
    padding: 3px 7px;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only,
  .mobile-header {
    display: block;
  }
}

/* Для ПК (от 601px) сбрасываем выравнивание для названий и нижней части */
@media (min-width: 601px) {
  h2, h3, .route-description p, .intro p {
    text-align: left;
  }
  footer p {
    text-align: center;
  }
}

/* Десктопный заголовок */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0,2,252,0.5); /* Полупрозрачный */
  color: #fff;
  padding: 0.5rem 1rem;
  position: relative;
  z-index: 100;
}
/* Новая обёртка для элементов заголовка */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.header-left, .header-right {
  flex: 1;
}
.header-center {
  flex: 2;
  text-align: center;
}
.logo {
  max-height: 40px;
}
/* Показывать/скрывать по устройству */
.desktop-only { display: block; }
.mobile-only { display: none; }

/* Стили для иконок мессенджеров */
.messengers a {
  text-decoration: none;
  display: inline-block;
  vertical-align: middle;
}
.messenger-icon {
  width: 40px;
  height: 40px;
  margin: 0 8px;
  vertical-align: middle;
  object-fit: contain;
}
/* Увеличиваем значок WhatsApp для десктопа */
@media (min-width: 601px) {
  .whatsapp-icon {
    width: 50px;
    height: 50px;
  }
}
.messenger-icon:hover {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* ====================== ВЕРХНЕЕ МЕНЮ (приклеено к шапке) ====================== */
.top-nav {
  background-color: rgba(0,2,252,0.5); /* ТОЧНО ТАКОЙ ЖЕ цвет, как шапка */
  padding: 12px 0 10px 0;
  border-bottom: none;
  text-align: center;
  position: relative;
  z-index: 99;
}

/* Плотное приклеивание (убираем зазор между шапкой и меню) */
.top-header + .top-nav,
.mobile-header + .top-nav {
  margin-top: 0;
}

.top-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  justify-content: center;
  flex-wrap: wrap;
}
.top-nav ul li {
  margin: 3px 6px;
  position: relative;
}
.top-nav ul li a {
  text-decoration: none;
  color: orange; /* Оранжевые */
  font-size: 0.9rem; /* Меньше */
  padding: 4px 8px; /* Меньше */
  display: inline-block;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
  border-radius: 4px;
}
.top-nav ul li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background-color: orange;
  transition: width 0.3s ease, left 0.3s ease;
}
.top-nav ul li a:hover::after {
  width: 100%;
  left: 0;
}
.top-nav ul li a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: orange;
}

/* Анимация переходов */
.page-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: auto;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.page-container.fade-in {
  opacity: 1;
}
.page-container.fade-out {
  opacity: 0;
}
.page-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: auto;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.page-container.fade-in {
  opacity: 1;
}
.page-container.fade-out {
  opacity: 0;
}

/* Контейнеры для страниц */
.intro,
.gallery,
.video {
  display: block;
  margin-bottom: 20px;
  padding: 0 20px;
}
main {
  padding: 20px;
  line-height: 1.6;
}

/* Главное описание на главной */
.intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  background-color: rgba(255,255,255,0.7); /* Полупрозрачная рамка */
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 20px;
}
.intro p {
  font-weight: bold;
}

/* БЕЛЫЕ ЗАГОЛОВКИ «Фотогалерея» и «Видео» только на главной */
.gallery h2,
.video h2 {
  color: #ffffff !important;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.85);
}

/* Видео */
video {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
  margin: 0 auto 20px;
  border: 2px solid rgb(0,2,252);
  border-radius: 5px;
}

/* Кнопки */
button {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  transition: border-color 0.3s ease, border-radius 0.3s ease;
  background-color: #e9e9e9;
}
button:hover {
  background-color: #ddd;
}
button:focus {
  border-color: rgb(0,2,252);
  outline: none;
}
button.clicked {
  border-color: rgb(0,2,252);
}

/* Футер */
footer {
  background-color: rgba(0,2,252,0.5);
  color: #fff;
  text-align: center;
  padding: 15px;
}

/* Стили для страницы маршрутов */
.routes-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 0 20px;
}
.route-item {
  border: 2px solid rgb(0,2,252);
  border-radius: 5px;
  padding: 15px;
  background-color: rgba(255,255,255,0.8); /* Полупрозрачная рамка для читаемости */
}
.route-item h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

/* Для ПК: левая колонка (фото + карта), правая (описание) */
@media (min-width: 601px) {
  .route-item {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background-color: rgba(255,255,255,0.82);
    border: 2px solid rgb(0, 2, 252);
    border-radius: 8px;
    padding: 20px;
  }

  .route-left-column {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .route-right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .route-left-column h3 {
    margin: 0 0 12px 0;
    font-size: 1.35rem;
  }

  .route-photo {
    margin: 0;
  }

  .route-photo img,
  .route-photo video {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 2px solid rgb(0,2,252);
  }

  .route-map-container {
    margin: 0;
  }

  .route-description {
    font-size: 1.05rem;
    line-height: 1.55;
  }

  .route-description p {
    margin: 0.8em 0;
  }

  .route-description p strong {
    color: #d35400;          /* можно оранжевый для акцента */
  }
}

/* На мобильных оставляем как было (колонка сверху вниз) */
@media (max-width: 600px) {
  .route-item {
    flex-direction: column;
  }
  .route-left-column,
  .route-right-column {
    width: 100%;
  }
  .route-left-column h3 {
    margin-bottom: 12px;
  }
}

/* Контейнер с картой и кнопкой сворачивания */
.route-map-container {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.route-map-container .toggle-map {
  align-self: flex-start;
}
.route-map-content {
  transition: max-height 0.4s ease, opacity 0.4s ease;
  overflow: hidden;
}
.route-map-content.hidden {
  max-height: 0;
  opacity: 0;
  padding: 0;
}
.route-map-content iframe {
  width: 100%;
  height: 400px;
  border: 2px solid rgb(0,2,252);
  border-radius: 5px;
}

/* Фото маршрутов */
.route-photo {
  margin-bottom: 15px;
  text-align: center;
}
.route-photo img, .route-photo video {
  max-width: 100%;
  height: auto;
  border: 2px solid rgb(0,2,252);
  border-radius: 5px;
  display: block;
  margin: 0 auto;
}
.route-description {
  font-weight: bold;
}
.route-description p {
  margin: 5px 0;
}

/* Галерея для мобильных устройств */
.photos {
  display: none;
}
.photos img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 2px solid rgb(0,2,252);
  border-radius: 5px;
}

/* Слайдер для десктопа */
.slider-container {
  position: relative;
  overflow: hidden;
  display: block;
}
.slider-track {
  display: flex;
  gap: 10px;
  transition: transform 0.5s ease;
}
.slider-track img {
  width: calc(50% - 5px);
  object-fit: cover;
  border: 2px solid rgb(0,2,252);
  border-radius: 5px;
}
.slider-prev, .slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255,255,255,0.8);
  border: none;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
}
.slider-prev { left: 10px; }
.slider-next { right: 10px; }
@media (min-width: 601px) {
  .slider-container { display: block; }
  .photos { display: none !important; }
}
@media (max-width: 600px) {
  .slider-container { display: none; }
  .photos {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
  }
}

/* Показывать/скрывать для мобильных и десктопных */
.desktop-only { display: block; }
.mobile-only { display: none; }

/* Условия аренды */
.conditions {
  background-color: rgba(255,255,255,0.7); /* Полупрозрачная рамка */
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}
.conditions p, .conditions ul li {
  font-weight: bold;
}

.white-word {
  color: #ffffff !important;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
}

@media (max-width: 600px) {
  .mobile-header {
    background-color: rgba(0,2,252,0.55);
    color: #fff;
    padding: 8px 10px 6px;
    text-align: center;
  }

  .mobile-header .logo-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0 0 3px 0;
  }

  .mobile-header .logo-list li {
    margin: 0;
    line-height: 0;
  }

  .mobile-header .logo-list img {
    display: block;
    height: 24px;
    width: auto;
    object-fit: contain;
    max-width: 90vw;
  }

  .mobile-header .contact-messengers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 8px;
    margin: 0 0 2px 0;
    padding: 0;
  }

  .mobile-header .contact-number {
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .mobile-header .messengers {
    display: flex;
    align-items: center;
    gap: 3px;
  }

  .mobile-header .messengers a {
    margin: 0;
    display: flex;
    align-items: center;
  }

  .mobile-header .messenger-icon {
    width: 26px;
    height: 26px;
    margin: 0;
  }

  .mobile-header .whatsapp-icon,
  .mobile-header .vk-icon {
    width: 26px;
    height: 26px;
  }

  .top-nav {
    padding: 2px 0 4px;
    background-color: rgba(0,2,252,0.55);
  }

  .top-nav ul {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 0 4px;
    width: 100%;
  }

  .top-nav ul li {
    margin: 0;
    flex: 1 1 0;
    text-align: center;
  }

  .top-nav ul li a {
    display: block;
    font-size: 0.76rem;
    padding: 4px 2px;
    background-color: rgba(255, 165, 0, 0.12);
    border: 1px solid rgba(255, 165, 0, 0.25);
    border-radius: 6px;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only,
  .mobile-header {
    display: block;
  }
}

/* Финальная раскладка шапки: телефон, логотип и мессенджеры не переносятся */
.top-header.desktop-only {
  display: block;
  padding: 12px 20px;
}

.top-header .header-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  min-height: 56px;
}

.top-header .contact-number {
  justify-self: start;
  white-space: nowrap;
}

.top-header .logo {
  display: block;
  width: min(72vw, 1100px);
  max-width: 72vw;
  height: auto;
}

.top-header .messengers {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  white-space: nowrap;
}

.top-header .messengers a {
  display: flex;
  align-items: center;
}

@media (min-width: 601px) and (max-width: 1199px) {
  .top-header .logo {
    width: 60vw;
    max-width: 60vw;
  }
}

@media (max-width: 600px) {
  .top-header.desktop-only {
    display: none;
  }

  .mobile-header .contact-messengers {
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
  }

  .mobile-header .contact-number {
    flex: 0 0 auto;
  }

  .mobile-header .messengers {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

.season-discount {
  color: #d35400;
  font-size: 1.3rem;
  margin-top: 0;
}

.season-discount a {
  color: inherit;
}