/* --- ГЛОБАЛЬНЫЕ СТИЛИ И ОБНУЛЕНИЕ --- */
:root {
    --primary-color: #a21620;
    --text-color-dark: #111111;
    --text-color-light: #ffffff;
    --bg-color-light: #fafafa; /* Чуть светлее для блоков */
    --grid-gap: 20px;
    --container-width: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.5; color: var(--text-color-dark); background-color: #ffffff; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 25px; width: 100%; }
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* Утилиты */
.bg-light { background-color: var(--bg-color-light); }
.bg-white { background-color: #ffffff; }
.text-center { text-align: center; }
.pb-0 { padding-bottom: 0 !important; }

/* Общие стили кнопок */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border: none; border-radius: 4px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background-color: var(--primary-color); color: var(--text-color-light); }
.btn-primary:hover { background-color: #912727; }
.btn-icon { margin-left: 10px; }
.btn-outline { background-color: transparent; color: var(--primary-color); border: 1px solid var(--primary-color); width: 100%; }
.btn-outline:hover { background-color: var(--primary-color); color: var(--text-color-light); }

/* --- ШАПКА --- */
.main-header { background-color: #ffffff; }
.header-top { padding: 15px 0; display: flex; align-items: center; }
.logo-link { display: flex; align-items: center; }
.logo-img { height: 50px; margin-right: 15px; filter: grayscale(1) opacity(0.7); }
.logo-text { font-size: 18px; font-weight: 700; max-width: 400px; line-height: 1.2; }
.logo-text-city { color: #888; font-weight: 400; }

.main-nav { background-color: var(--primary-color); color: var(--text-color-light); }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.nav-list { display: flex; }
.nav-list > li > a { display: block; padding: 15px 20px; font-size: 15px; font-weight: 500; color: var(--text-color-light); }
.nav-list > li > a:hover, .nav-list > li > a.active { background-color: rgba(255, 255, 255, 0.15); }

/* Выпадающее меню */
.has-submenu { position: relative; }
.has-submenu > a::after { content: '▼'; font-size: 10px; margin-left: 7px; opacity: 0.7; transition: transform 0.3s ease; display: inline-block; }
.has-submenu:hover > a::after { transform: rotate(180deg); }
.submenu { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    background-color: #ffffff; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); 
    /* Делаем меню пошире, чтобы длинный текст смотрелся хорошо */
    min-width: 320px; 
    max-width: 400px;
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(10px); 
    transition: all 0.3s ease; 
    z-index: 100; 
    border-radius: 0 0 4px 4px; 
}
.has-submenu:hover .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu li a { 
    display: flex; /* Включаем Flexbox, чтобы иконка и текст встали в ряд */
    align-items: flex-start; /* Выравниваем по верхнему краю (для длинного текста) */
    gap: 12px; /* Расстояние между иконкой и текстом */
    padding: 12px 20px; 
    color: #333; 
    font-size: 14px; 
    line-height: 1.4; /* Межстрочный интервал для длинных названий */
    border-bottom: 1px solid #eee; 
}

/* Стили для иконки в меню */
.submenu-icon {
    flex-shrink: 0; /* Запрещаем иконке сплющиваться */
    width: 18px; /* Иконка чуть меньше, чем в сетке, чтобы смотрелась изящно */
    height: 18px;
    color: var(--primary-color);
    margin-top: 2px; /* Легкая корректировка по высоте */
}

/* Стили для текста '702' в меню */
.submenu-icon-text {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    color: var(--primary-color);
    margin-top: 2px;
}

.submenu li:last-child a { border-bottom: none; }
.submenu li a:hover { background-color: #f9f9f9; color: var(--primary-color); }

.header-contact { display: flex; align-items: center; }
.phone-link { display: flex; align-items: center; font-weight: 600; color: var(--text-color-light); }
.phone-icon { margin-right: 8px; }

/* --- ГЛАВНЫЙ ЭКРАН (Hero) --- */
.hero-section { 
    padding: 140px 0 210px 0; 
    /* Добавляем путь к картинке */
  
    /* Растягиваем картинку на весь блок */
    background-size: cover; 
    /* Центрируем картинку */
    background-position: center; 
    /* Запрещаем повторение картинки */
    background-repeat: no-repeat; 
}
.hero-container {
    /* Мы убрали max-width: 800px, чтобы блок растянулся на всю ширину сетки (1200px) */
    text-align: left; /* Принудительно прижимаем текст и кнопку к левому краю */
}

.hero-title {
    font-size: 42px;
    line-height: 1.2;
    font-weight: 800;
    /* Меняем цвет на белый */
    color: #ffffff; 
    margin-bottom: 7px;
}

.hero-text {
    font-size: 18px;
    /* Меняем цвет на белый */
    color: #ffffff; 
    opacity: 0.9;
    margin-bottom: 15px;
    max-width: 600px;
}
/* --- СЕТКА ИКОНОК --- */
.services-grid-section { padding: 60px 0; background-color: var(--bg-color-light); margin-top: -50px; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--grid-gap); }
.service-item { background-color: #ffffff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); display: flex; align-items: flex-start; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.service-item:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.service-icon-wrap { flex-shrink: 0; width: 50px; height: 50px; border-radius: 50%; background-color: var(--bg-color-light); color: var(--primary-color); display: flex; align-items: center; justify-content: center; margin-right: 20px; }
.service-icon-text { font-size: 14px; font-weight: 700; }
.service-title { font-size: 15px; font-weight: 600; line-height: 1.4; }

/* --- ТЕКСТОВЫЕ БЛОКИ --- */
.about-section { padding: 60px 0; }
.text-container { 
    max-width: var(--container-width); /* Возвращаем стандартную ширину сайта (1200px) */
    margin: 0 auto; /* Возвращаем центрирование блока по экрану */
    text-align: left; /* Прижимаем всё к левому краю контейнера */
}
/* Ограничиваем ширину только для текстовых элементов */
.text-container .about-title,
.text-container .about-text {
    max-width: 1000px; 
}
.about-title { font-size: 28px; font-weight: 700; margin-bottom: 25px; }
.about-text { margin-bottom: 20px; color: #555; line-height: 1.6; }
.text-link-red { color: var(--primary-color); font-weight: 500; }
.text-link-red:hover { text-decoration: underline; }

/* --- КАРТОЧКИ УСЛУГ (Тарифы) --- */
.booking-section { padding: 70px 0; }
.section-title { font-size: 28px; font-weight: 800; margin-bottom: 30px; text-align: left; }
.booking-grid-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 30px; }
.booking-grid-bottom { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.booking-card { background-color: #ffffff; padding: 30px; border-radius: 4px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); display: flex; }
.tall-card { flex-direction: column; justify-content: space-between; }
.card-body-wrap { flex-grow: 1; }
.card-header { margin-bottom: 25px; }
.card-title { font-size: 22px; font-weight: 800; margin-bottom: 5px; line-height: 1.2; }
.card-subtitle { font-size: 13px; color: #666; line-height: 1.4; }
.check-list { margin-bottom: 30px; }
.check-list li { position: relative; padding-left: 28px; margin-bottom: 18px; font-size: 14px; line-height: 1.4; color: #333; }
.check-list li::before { content: ''; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236bbd5b'%3E%3Crect width='24' height='24' rx='4'/%3E%3Cpath d='M7 12l3.5 3.5 6.5-7' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E"); background-size: contain; background-repeat: no-repeat; }
.wide-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 30px 40px; }
.wide-card-content { flex-grow: 1; padding-right: 20px; }
.card-subtitle-small { font-size: 14px; color: #555; margin-top: 5px; line-height: 1.4; }
.wide-card-action .btn-outline { width: auto; min-width: 150px; }
.booking-contact { margin-top: 50px; text-align: center; font-size: 18px; line-height: 1.6; }
.booking-contact strong { font-weight: 800; }
.link-red-dashed { color: var(--primary-color); text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 4px; cursor: pointer; font-weight: 500; }
.link-red-dashed:hover { color: #912727; }

/* --- НОВЫЙ БЛОК: CTA ФОРМА --- */
.cta-section { padding: 80px 0; border-bottom: 1px solid #eaeaea; }
.cta-title { font-size: 24px; font-weight: 800; margin-bottom: 15px; }
.cta-subtitle { font-size: 15px; color: #555; margin-bottom: 40px; max-width: 700px; margin-left: auto; margin-right: auto; }

.inline-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 8px;
    flex-grow: 1;
}

.input-icon {
    width: 20px;
    height: 20px;
    color: #999;
    margin-right: 10px;
    flex-shrink: 0;
}

.input-group input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 15px;
    color: #333;
    padding: 5px 0;
}

.input-group input::placeholder { color: #999; }
.btn-cta { padding: 14px 40px; border-radius: 0; font-size: 16px; }

/* --- НОВЫЙ БЛОК: ПОДВАЛ (Footer) --- */
.main-footer { background-color: var(--bg-color-light); padding: 50px 0 20px; }
.footer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }

.footer-logo { display: flex; align-items: center; opacity: 0.5; filter: grayscale(1); }
.footer-logo-img { height: 45px; margin-right: 15px; }
.footer-logo-text { font-size: 13px; font-weight: 600; line-height: 1.3; color: #555; }

.footer-info { display: flex; gap: 50px; }
.info-block { display: flex; flex-direction: column; }
.info-label { color: var(--primary-color); font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.info-value { font-size: 15px; font-weight: 600; color: #333; }
.info-value[href]:hover { color: var(--primary-color); }

.footer-bottom { border-top: 1px solid #e0e0e0; padding-top: 20px; text-align: center; }
.footer-bottom p { font-size: 10px; color: #999; line-height: 1.5; max-width: 1000px; margin: 0 auto; }

/* --- ПОПАП --- */
.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 1000; padding: 20px; }
.popup-overlay.is-active { opacity: 1; visibility: visible; }
.popup-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    
    /* НОВЫЕ СТРОКИ ДЛЯ ПРОКРУТКИ: */
    max-height: 90vh; /* Максимальная высота окна — 90% от экрана устройства */
    overflow-y: auto; /* Включаем вертикальную прокрутку внутри окна */
}
.popup-overlay.is-active .popup-content { transform: scale(1); }
.popup-close { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 28px; cursor: pointer; color: #aaa; line-height: 1; }
.popup-close:hover { color: var(--text-color-dark); }
.popup-title { font-size: 24px; font-weight: 700; margin-bottom: 25px; }
.popup-form input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 4px; }
.popup-form .btn { width: 100%; }

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 992px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .booking-grid-top, .booking-grid-bottom { grid-template-columns: repeat(2, 1fr); }
    .booking-grid-top .tall-card:nth-child(3) { grid-column: span 2; }
    
    .inline-form { flex-direction: column; gap: 20px; }
    .input-group { width: 100%; }
    .btn-cta { width: 100%; }
}

@media (max-width: 768px) {
    .header-top { justify-content: center; text-align: center; }
    .logo-link { flex-direction: column; }
    .logo-img { margin-right: 0; margin-bottom: 10px; height: 40px; }
    .nav-container { flex-direction: column; padding: 10px 0; }
    .nav-list { flex-wrap: wrap; justify-content: center; width: 100%; margin-bottom: 10px; }
    .nav-list > li > a { padding: 8px; font-size: 13px; }
    .has-submenu:hover .submenu { display: none; }

    .hero-title { font-size: 26px; }
    .services-grid { grid-template-columns: 1fr; }
    
    .booking-grid-top, .booking-grid-bottom { grid-template-columns: 1fr; }
    .booking-grid-top .tall-card:nth-child(3) { grid-column: span 1; }
    .wide-card { flex-direction: column; align-items: flex-start; padding: 25px; }
    .wide-card-content { padding-right: 0; margin-bottom: 20px; }
    .wide-card-action { width: 100%; }
    .wide-card-action .btn-outline { width: 100%; }
    
    /* Адаптив подвала */
    .footer-top { flex-direction: column; align-items: flex-start; gap: 30px; }
    .footer-info { flex-direction: column; gap: 20px; }
}



/* --- СЕТКА ДЛЯ ВАРИАНТОВ ВНЖ (vnzh.html) --- */
.vnzh-table-section {
    padding: 60px 0;
}

.vnzh-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 колонки на компьютере */
    gap: 20px;
}

.vnzh-card {
    background-color: #ffffff;
    padding: 20px 25px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-color-dark);
    border-left: 4px solid var(--primary-color); /* Красная полоска слева как акцент */
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.vnzh-card:hover {
    transform: translateY(-3px);
}

/* Адаптивность для таблицы ВНЖ */
@media (max-width: 992px) {
    .vnzh-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 колонки на планшете */
    }
}

@media (max-width: 768px) {
    .vnzh-grid {
        grid-template-columns: 1fr; /* 1 колонка на телефоне */
    }
}

/* Стили для вложенного меню ВНЖ */
        .has-nested-submenu {
            position: relative;
        }
        .nested-submenu {
            display: none;
            position: absolute;
            left: 100%;
            top: 0;
            background: #fff;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            min-width: 320px;
            z-index: 100;
            border-radius: 4px;
            padding: 10px 0;
            list-style: none;
        }
        .has-nested-submenu:hover > .nested-submenu {
            display: block;
        }
        .nested-submenu li a {
            display: block;
            padding: 10px 20px;
            color: #333;
            text-decoration: none;
            font-size: 14px;
            line-height: 1.4;
            transition: background 0.2s;
        }
        .nested-submenu li a:hover {
            background: #f5f5f5;
            color: #952727;
        }

        /* Адаптивность для мобильного меню */
        @media (max-width: 992px) {
            .nested-submenu {
                position: static;
                box-shadow: none;
                border-left: 2px solid #eee;
                margin-left: 20px;
                display: none;
                min-width: auto;
            }
            .has-nested-submenu:hover > .nested-submenu {
                display: block;
            }
        }







/* --- ГАМБУРГЕР И МОБИЛЬНОЕ МЕНЮ --- */

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1001;
    outline: none;
}

/* Жестко задаем белые полоски гамбургера */
.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #ffffff; 
    position: absolute;
    left: 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Расставляем полоски по высоте */
.mobile-menu-toggle span:nth-child(1) { top: 0px; }
.mobile-menu-toggle span:nth-child(2) { top: 10px; }
.mobile-menu-toggle span:nth-child(3) { top: 20px; }

/* Анимация превращения в крестик при открытии */
.mobile-menu-toggle.is-active span:nth-child(1) { transform: rotate(45deg); top: 10px; }
.mobile-menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.is-active span:nth-child(3) { transform: rotate(-45deg); top: 10px; }

/* Адаптив меню для экранов меньше 992px */
@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav {
        position: relative;
    }

    /* ИСПРАВЛЕНИЕ ОТСТУПОВ: Возвращаем 25px по бокам */
    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row !important;
        flex-wrap: wrap;
        width: 100%;
        padding: 12px 25px !important; 
    }

    /* Белая подложка выпадающего меню */
    .nav-list {
        display: none; 
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff; 
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 25px; 
        gap: 5px;
        z-index: 1000;
        box-shadow: 0 10px 20px rgba(0,0,0,0.15);
        border-top: 1px solid #eee;
    }

    .nav-list.is-active {
        display: flex;
    }

    .nav-list li {
        width: 100%;
    }

    /* Темный цвет текста для главных ссылок на белом фоне */
    .nav-list > li > a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
        color: #111111 !important; 
        font-weight: 600;
    }

    /* Убираем hover для телефонов */
    .has-submenu:hover > .submenu,
    .has-nested-submenu:hover > .nested-submenu {
        display: none; 
    }

    /* Раскрытие внутренних пунктов по клику */
    .has-submenu.is-open > .submenu,
    .has-nested-submenu.is-open > .nested-submenu {
        display: block;
        position: static;
        background: transparent;
        box-shadow: none;
        padding-left: 15px;
        margin-top: 5px;
        border-left: 2px solid #a21620; /* Красная линия-ориентир */
    }
    
    /* Красные иконки на белом фоне */
    .submenu-icon {
        stroke: #a21620 !important; 
    }
    .submenu-icon-text {
        color: #a21620 !important;
        border-color: #a21620 !important;
    }
    
    /* Темно-серый текст для дочерних пунктов (ВНЖ по браку и т.д.) */
    .submenu li a, .nested-submenu li a {
        color: #555 !important; 
        border-bottom: none;
        padding: 10px 0;
        font-weight: normal;
    }
    
    .submenu li a:hover, .nested-submenu li a:hover {
        background: #fdfdfd !important;
        color: #a21620 !important;
    }
}
