/* Добавление базовых стилей для всего сайта */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    /* убираем фоновое изображение с body */
    background-color: #f8f9fa;
    min-height: 100vh;
    color: white;
    /* добавляем flex структуру для правильного позиционирования футера */
    display: flex;
    flex-direction: column;
}

/* применяем фоновое изображение к существующему контейнеру .container */
.container {
    background-image: url("../images/bg.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    position: relative;
}

/* Стили для главной страницы с формами */
main {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding-top: 80px;
    /* убираем flex-grow так как теперь main находится внутри hero-section */
}

.auth-form,
.registration-form {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 10px;
    width: 300px;
    display: none;
    flex-direction: column;
}

.auth-form {
    display: flex;
}

.registration-form {
    display: none;
}

.auth-form h2,
.registration-form h2 {
    margin-bottom: 20px;
}

.auth-form input,
.registration-form input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: none;
    border-radius: 5px;
}

.auth-form button,
.registration-form button {
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.auth-form button:hover,
.registration-form button:hover {
    background-color: #0056b3;
}

/* Добавлены стили для дополнительных офисов на главной странице */
.additional-offices {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border-radius: 10px;
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    text-align: center;
}

.additional-offices h2 {
    color: white;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.office-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.office-item:last-child {
    margin-bottom: 0;
}

.office-item h3 {
    color: #007bff;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.office-item h4 {
    color: #007bff;
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.office-item p {
    color: white;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Группировка по городам */
.office-city-group {
    margin-bottom: 20px;
}

.office-city-group:last-child {
    margin-bottom: 0;
}

.office-city-title {
    color: #7ec8ff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 123, 255, 0.3);
}

/* Подофисы внутри одной плашки */
.office-sub-item {
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.office-sub-item:first-of-type {
    border-top: none;
    padding-top: 4px;
}

.office-sub-label {
    color: #7ec8ff;
    font-weight: 600;
    font-size: 0.9rem;
}

.office-sub-schedule {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.85rem !important;
    margin-bottom: 0 !important;
}

footer {
    /* Изменяем фон футера на черный как у навигации */
    width: 100%;
    text-align: center;
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    margin-top: auto;
    font-size: 14px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.footer-policy-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
    transition: color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-policy-link:hover {
    color: #7ec8ff;
    border-bottom-color: #7ec8ff;
}

/* Добавлены стили для навигационного меню */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    /* увеличиваем минимальную высоту для размещения двух строк контактов */
    min-height: 90px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
    font-size: 18px;
    /* добавили flex-shrink для предотвращения сжатия логотипа */
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    gap: 30px;
    /* исправляем вертикальное выравнивание пунктов меню */
    align-items: center;
    height: auto;
    flex-shrink: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #007bff;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #007bff;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Добавлены стили для раздела "О компании" */
.about-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 80px 0;
    min-height: 100vh;
    /* добавляем flex-grow чтобы about-section занимал доступное пространство */
    flex-grow: 1;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.about-title {
    text-align: center;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 50px;
    position: relative;
}

.about-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #007bff;
    border-radius: 2px;
}

.about-content {
    display: grid;
    gap: 40px;
}

.about-item {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.about-icon {
    flex-shrink: 0;
}

.about-text h3 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.about-text p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.about-text ul {
    color: #666;
    line-height: 1.6;
    padding-left: 20px;
}

.about-text li {
    margin-bottom: 8px;
}

.about-conclusion {
    background: #007bff;
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin-top: 20px;
}

.about-conclusion h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.about-conclusion p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Стили для раздела "Подготовка к отопительному сезону" */
.heating-section {
    background: linear-gradient(135deg, #0d1b2a 0%, #1a2e45 100%);
    padding: 60px 0;
}

.heating-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.heating-title {
    font-size: 1.9rem;
    color: white;
    margin-bottom: 35px;
    position: relative;
    line-height: 1.3;
}

.heating-title::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 4px;
    background: #007bff;
    border-radius: 2px;
}

.heating-files {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.heating-file-link {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 10px;
    padding: 18px 24px;
    color: white;
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    text-align: left;
}

.heating-file-link:hover {
    background: rgba(0, 123, 255, 0.15);
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.2);
}

.heating-file-link svg {
    flex-shrink: 0;
}

.heating-file-link span:not(.heating-file-badge) {
    flex-grow: 1;
    font-size: 1rem;
    line-height: 1.4;
}

.heating-file-badge {
    flex-shrink: 0;
    background: rgba(0, 123, 255, 0.25);
    border: 1px solid rgba(0, 123, 255, 0.5);
    color: #7ec8ff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Добавлена плавная прокрутка */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body.menu-open {
    /* не блокируем body — это мешает скроллу меню на iOS Safari */
}

/* Блокируем взаимодействие с контентом под открытым меню */
body.menu-open .container,
body.menu-open .heating-section,
body.menu-open .about-section,
body.menu-open footer {
    pointer-events: none;
    user-select: none;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 900px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        height: calc(100dvh - 70px);
        background: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 30px;
        padding-bottom: env(safe-area-inset-bottom, 20px);
        transition: left 0.3s ease;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        font-size: 1.2rem;
        padding: 15px 0;
    }

    /* Скрываем nav-contacts в мобильной версии */
    .nav-contacts {
        display: none !important;
    }

    /* Скрываем nav-logo-contacts в мобильной версии */
    .nav-logo-contacts {
        display: none !important;
    }

    /* Контакты прижаты к низу меню */
    .mobile-contacts {
        width: 100%;
        margin-top: auto;
        padding: 20px 30px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(0, 0, 0, 0.3);
    }

    .mobile-contact-item {
        margin-bottom: 15px;
        text-align: left;
        padding-left: 20px;
    }

    .mobile-contact-label {
        color: #007bff;
        font-weight: 600;
        display: inline;
        margin-right: 8px;
    }

    .mobile-contact-info {
        color: white;
        font-size: 14px;
        line-height: 1.4;
        display: inline;
    }

    /* Добавлены стили для дополнительных адресов на мобильных устройствах */
    .mobile-contact-item:last-child,
    .mobile-contact-item:nth-last-child(2) {
        margin-bottom: 5px;
    }

    .mobile-contact-item:last-child .mobile-contact-info,
    .mobile-contact-item:nth-last-child(2) .mobile-contact-info {
        font-size: 13px;
    }

    /* адаптивные стили для контактов на мобильных устройствах */
    .contacts {
        flex-direction: column;
        gap: 8px;
        align-items: center;
        text-align: center;
    }

    .contact-item {
        justify-content: center;
        white-space: normal;
        text-align: center;
    }

    /* Исправление расположения иконок в разделе О компании для мобильных */
    .about-item {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .about-icon {
        align-self: center;
        margin-bottom: 10px;
    }

    .about-text {
        text-align: left;
    }

    .about-text h3 {
        text-align: center;
        margin-bottom: 20px;
    }

    /* Стили для списка услуг - каждая услуга в отдельном блоке */
    .about-text ul {
        list-style: none;
        padding: 0;
    }

    .about-text li {
        background: #f8f9fa;
        margin-bottom: 12px;
        padding: 15px;
        border-radius: 8px;
        border-left: 4px solid #007bff;
        text-align: left;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s ease;
    }

    .about-text li:hover {
        transform: translateX(5px);
    }

    .about-title {
        font-size: 2rem;
    }

    .container {
        margin-top: 0; /* убираем отступ сверху */
    }

    footer {
        font-size: 12px;
    }

    html {
        scroll-padding-top: 80px;
    }

    /* Адаптивные стили для дополнительных офисов на мобильных устройствах */
    .additional-offices {
        padding: 20px;
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .additional-offices h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .office-item {
        padding: 15px;
    }

    .office-item h3 {
        font-size: 1.2rem;
    }

    .office-item p {
        font-size: 0.9rem;
    }

    /* Адаптивные стили для раздела отопительного сезона на мобильных */
    .heating-title {
        font-size: 1.4rem;
    }

    .heating-file-link {
        padding: 14px 16px;
        gap: 12px;
    }

    .heating-file-link span:not(.heating-file-badge) {
        font-size: 0.9rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 8px;
    }

    .footer-policy-link {
        white-space: normal;
        text-align: center;
    }

}

/* Адаптивные стили для планшетов и десктопа */
@media (min-width: 901px) {
    /* Новая структура навигации: логотип слева, контакты по центру, меню справа */
    .nav-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 30px;
        min-height: 90px;
        position: relative;
    }

    /* Новая секция для логотипа с адресом и лицензией */
    .nav-logo-section {
        display: flex;
        flex-direction: column;
        gap: 5px;
        flex-shrink: 0;
    }

    .nav-logo {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }

    /* Стили для адреса и лицензии под логотипом */
    .nav-logo-contacts {
        display: flex;
        flex-direction: column;
        gap: 3px;
        font-size: 10px;
        color: white;
        padding-left: 0;
    }

    .logo-contact-item {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* Добавляем стилизацию для меток адреса и лицензии */
    .nav-logo-contacts .contact-label {
        color: #007bff;
        font-weight: 600;
        flex-shrink: 0;
    }

    .nav-menu {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 30px;
        height: auto;
        flex-shrink: 0;
    }

    /* На планшетах контакты скрыты — не хватает места */
    .nav-contacts {
        display: none;
    }

    .contact-row {
        display: flex;
        gap: 15px;
        align-items: center;
        flex-wrap: wrap;
    }

    .nav-contacts .contact-item {
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
    }

    .nav-contacts .contact-label {
        color: #007bff;
        font-weight: 600;
    }

    /* Добавлены стили для дополнительных адресов на десктопе */
    .nav-contacts .contact-item span:not(.contact-label) {
        color: white;
        line-height: 1.3;
        white-space: normal;
    }

    /* Скрываем мобильные контакты на планшетах */
    .mobile-contacts {
        display: none !important;
    }

    /* Возвращаем нормальную ширину формы */
    .auth-form,
    .registration-form {
        width: 300px;
        max-width: 300px;
        padding: 40px;
    }
}

/* На широких экранах показываем контакты по центру */
@media (min-width: 1100px) {
    .nav-contacts {
        display: flex;
        flex-direction: column;
        gap: 5px;
        font-size: 12px;
        color: white;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        align-items: center;
    }
}

/* Уменьшаем gap в меню на промежуточных размерах */
@media (min-width: 901px) and (max-width: 1099px) {
    .nav-menu {
        gap: 16px;
    }

    .nav-link {
        font-size: 14px;
    }
}

@media (min-width: 1025px) {
    /* Убираем увеличение ширины формы на больших экранах */
    .auth-form,
    .registration-form {
        width: 300px;
        max-width: 300px;
        padding: 40px;
    }

    /* Улучшаем отображение дополнительных офисов на больших экранах */
    .additional-offices {
        max-width: 600px;
        padding: 40px;
    }

    .additional-offices h2 {
        font-size: 2rem;
    }

    .office-item {
        padding: 25px;
    }

    .office-item h3 {
        font-size: 1.4rem;
    }
}

/* Добавлены стили для nav-contacts */
.nav-contacts {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: white;
}

.nav-contacts .contact-item {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.nav-contacts .contact-label {
    color: #007bff;
    font-weight: 600;
}

/* Добавлены стили для дополнительных адресов */
.nav-contacts .contact-item span {
    color: white;
    line-height: 1.4;
}

.nav-contacts .contact-item span br {
    display: none;
}

/* Новые стили для контактных ссылок с иконками */
.contact-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: white;
    text-decoration: none;
    padding: 3px 8px;
    background: rgba(0, 123, 255, 0.15);
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 11px;
    white-space: nowrap;
}

.contact-link:hover {
    background: rgba(0, 123, 255, 0.3);
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.2);
}

.contact-link svg {
    flex-shrink: 0;
}

.phone-link {
    color: white;
}

.telegram-link {
    color: white;
}

/* Стили для мобильных контактных ссылок */
.mobile-contact-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.mobile-contacts .contact-link {
    width: 100%;
    justify-content: center;
    font-size: 14px;
    padding: 8px 12px;
}
