/* Базовые стили */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #0056a4;
    --secondary-color: #1c85e8;
    --dark-color: #002c54;
    --light-color: #f5f8ff;
    --white: #ffffff;
    --gray: #f0f0f0;
    --dark-gray: #333333;

    --header-height: 90px; /* fallback, реальное значение проставит JS */
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-color);
    line-height: 1.6;
    background-color: var(--white);

    /* фикс: шапка не перекрывает контент */
    padding-top: var(--header-height);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    color: var(--dark-color);
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 15px auto 0;
}

/* чтобы якорные ссылки не прятались под шапкой */
section {
    scroll-margin-top: calc(var(--header-height) + 20px);
}

/* Шапка сайта */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo img { height: 60px; }

.nav__list { display: flex; }
.nav__list li { margin-left: 25px; }

.nav__list a {
    font-weight: 500;
    position: relative;
}

.nav__list a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav__list a:hover::after { width: 100%; }

.header__contacts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.phone {
    font-weight: 600;
    margin-bottom: 10px;
}

/* Главный экран */
.hero {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height)); /* лучше на мобилках, где есть */
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('Web/club.jpg') top center no-repeat;
    background-size: cover;
    z-index: -1;
}

/* О нас */
.about {
    padding: 100px 0;
    background-color: var(--light-color);
    margin-top: -1px;
}

.about__content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about__text { flex: 1; }
.about__text p { margin-bottom: 20px; font-size: 18px; }

.about__image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Преимущества */
.advantages { padding: 100px 0; }

.advantages__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.advantage-card {
    flex: 1;
    min-width: 280px;
    max-width: 300px;
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    background-color: var(--white);
}

.advantage-card:hover { transform: translateY(-10px); }

.advantage-card__title {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.advantage-card__text {
    font-size: 16px;
    line-height: 1.5;
    color: var(--dark-gray);
}

/* Виджеты */
.widgets {
    padding: 100px 0;
    background-color: var(--light-color);
}

.widgets__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.widget-card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    height: 300px;
    display: flex;
    flex-direction: column;
}

.widget-card__title {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 20px;
    font-size: 20px;
}

.widget-card__content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

/* Индикатор загрузки */
.widget-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ошибка */
.widget-error {
    text-align: center;
    padding: 30px 20px;
}

.widget-error p { color: #dc3545; margin-bottom: 15px; }

.retry-button {
    padding: 8px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.retry-button:hover { background-color: var(--dark-color); }

/* Вода */
.water-level-info {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.water-level-data {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.water-level-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--light-color);
    border-radius: 5px;
}

.water-level-item .label { font-weight: 500; color: var(--dark-color); }
.water-level-item .value { font-size: 18px; font-weight: 600; color: var(--primary-color); }

.water-level-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding-top: 15px;
    border-top: 1px solid var(--gray);
}

.water-level-time .label { font-size: 14px; color: var(--dark-gray); }
.water-level-time .value { font-weight: 500; }

/* Мосты */
.bridge-schedule-widget {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.bridge-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bridge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--light-color);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.bridge-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bridge-name { font-weight: 600; color: var(--primary-color); }

.bridge-schedule {
    color: var(--dark-gray);
    font-size: 14px;
    text-align: right;
    max-width: 60%;
}

@media (max-width: 768px) {
    .bridge-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .bridge-schedule {
        text-align: center;
        max-width: 100%;
    }
}

/* Контакты */
.contacts { padding: 100px 0; }

.contacts__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contacts__info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contacts__item h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.contacts__map {
    height: 100%;
    min-height: 400px;
    border-radius: 10px;
    overflow: hidden;
}

/* Документы */
.documents {
    padding: 80px 0;
    background-color: var(--light-color);
}

.documents__list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.documents__link {
    display: block;
    padding: 14px 18px;
    border: 1px solid var(--gray);
    border-radius: 10px;
    background-color: var(--light-color);
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.documents__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Подвал */
.footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.footer__logo img { height: 60px; }

.footer__nav-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__nav-list a:hover { color: var(--secondary-color); }

.footer__contacts { text-align: right; }

.footer__bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Адаптивность */
@media (max-width: 992px) {
    .header__inner { flex-direction: column; gap: 15px; }
    .nav__list { margin-top: 15px; flex-wrap: wrap; justify-content: center; }
    .nav__list li { margin: 5px 10px; }
    .about__content { flex-direction: column; }
    .contacts__inner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .section-title { font-size: 30px; }
    .footer__inner { flex-direction: column; text-align: center; }
    .footer__contacts { text-align: center; }
}

@media (max-width: 1240px) {
    .advantage-card { flex: 0 1 calc(50% - 30px); max-width: 500px; }
}

@media (max-width: 640px) {
    .advantage-card { flex: 1 1 100%; max-width: 100%; }
}

/* Стили для карты ветров */
#wind-map {
    height: 300px;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

#wind-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.water-level-place {
    font-size: 13px;
    color: var(--dark-gray);
    opacity: 0.85;
}