.contact-page-body {
    background-color: #F9F9F9;
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: hidden; 
}

.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.navbar {
    position: fixed;
    top: 8px;
    width: 93.8%;
    left: 50%;
    transform: translateX(-50%);
    height: 65px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    border-radius: 16px;
    z-index: 9999;
    
    background-color: transparent; 
}

.contact-header {
    position: relative;
    
    height: 380px !important; 
    flex-shrink: 0; 
    
    background-size: cover;
    background-position: center 24%; 
    
    border-radius: 24px; 
    overflow: hidden;
    
    display: flex;
    align-items: flex-end; 
    justify-content: flex-start; 
    padding: 0 0 50px 2%;

    box-shadow: inset 0 0 0 2000px rgba(0, 0, 0, 0.1);
    width: 93.8%;
    margin: 10px auto; 
}

.header-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    pointer-events: none;
}

.page-title {
    color: var(--white);
    font-size: 55px; 
    font-weight: 700;
    position: relative;
    z-index: 2;
    margin: 0;
    line-height: 1;
}

.contact-content {
    flex: 1; 
    display: flex;
    align-items: center; 
    padding: 20px 0; 
    min-height: 0; 
}

.contact-grid {
    display: flex;
    gap: 20px; 
    width: 93.8%; 
    padding: 0;
    
    height: auto; 
    margin: 0 auto;
}

.contact-card {
    background-color: var(--beige);
    border-radius: 16px;
    padding: 50px; 
    height: 100%; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
}

.info-card {
    width: 35%;
    gap: 40px; 
}

.contact-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.flag-icon img {
    width: 24px;
    border-radius: 4px;
    margin-top: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 5px; 
}

.contact-link {
    font-family: var(--font-heading);
    color: var(--brown);
    text-decoration: none;
    font-weight: 700;
    font-size: 18px; 
    line-height: 1.2;
    transition: color 0.2s;
}
.contact-link:hover { color: var(--orange); }

.contact-link.email {
    font-size: 16px;
    text-decoration: underline;
}

.contact-sub {
    font-size: 13px;
    color: var(--brown);
    opacity: 0.6;
}

.form-card {
    width: 65%;
    height: 430px;
    position: relative;
    overflow: hidden;
}

.form-card h2 {
    color: var(--brown);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
    width: 60%; 
    line-height: 1.3;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px; 
    position: relative;
    z-index: 2;
    width: 50%; 
}

.submit-btn.success {
    background-color: #28a745 !important;
    border-color: #28a745; 
    pointer-events: none; 
    color: #fff;
    font-size: 20px;
}

.form-group input:invalid:not(:placeholder-shown) {
    border: 1px solid red;
    background-color: #fff0f0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    color: var(--brown);
    opacity: 0.7;
}

.form-group input {
    background-color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 16px 20px; 
    font-size: 16px;
    font-family: var(--font-body);
    color: var(--brown);
    outline: none;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.form-checkbox label {
    font-size: 12px;
    color: var(--brown);
    opacity: 0.6;
    cursor: pointer;
}

.submit-btn {
    background-color: var(--orange);
    color: var(--white);
    height: 54px; 
    border: 2px solid transparent; 
    border-radius: 8px;
    padding: 0 16px; 
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s, border-color 0.3s;
    box-sizing: border-box; 
}
.submit-btn:hover { background-color: #e07e10; }

.bg-shape-form {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 300px;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-color: var(--white);
    -webkit-mask-image: url('../images/Union.svg');
    mask-image: url('../images/Union.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: bottom right;
    mask-position: bottom right;
    -webkit-mask-size: contain;
    mask-size: contain;
    opacity: 0.3;
}

.contact-footer {
    background-color: var(--brown);
    
    width: 93.7%;
    margin: 0 auto 20px auto;
    border-radius: 16px;
    
    padding: 0;
    color: var(--white);
    flex-shrink: 0;
}

.email-icon i {
    font-size: 26px;       /* Размер, визуально похожий на размер флагов */
    color: var(--brown);   /* Цвет бренда (можно поменять на var(--orange)) */
}


@media (max-height: 750px) {
    .contact-header { height: 300px !important; } 
    .form-group input { padding: 8px; }
}

@media (max-width: 900px) {
    .contact-page-body { height: auto; overflow: auto; }
    .contact-grid { flex-direction: column; max-height: none; }
    .info-card, .form-card { width: 100%; padding: 30px; }
    .contact-header { height: 320px !important; padding-left: 20px; }
    .page-title { font-size: 36px; }
    .contact-footer { width: 95%; margin-bottom: 10px; }
    .contact-form { width: 100%; }
    .form-card h2 { width: 100%; }
}

@media (max-width: 900px) {
    .contact-form { width: 100%; }
    .form-card h2 { width: 100%; }
}

/* =======================================
   АДАПТИВНОСТЬ (Планшеты и Телефоны)
   ======================================= */

/* Срабатывает на экранах уже 1024px (iPad Pro, горизонтальные телефоны) */
@media (max-width: 1024px) {
    
    /* 1. КОНТЕЙНЕР СЕТКИ */
    .contact-grid {
        /* Меняем направление на колонку (блоки друг под другом) */
        flex-direction: column !important; 
        
        /* Растягиваем контейнер на полную ширину экрана */
        width: 100% !important;
        max-width: 100% !important;
        
        /* Убираем лишние отступы, оставляем по 15px с краев */
        padding: 15px 10px !important; 
        
        /* Убираем ограничение высоты, если оно было */
        height: auto !important;
        max-height: none !important;
    }

    /* 2. БЛОКИ (КАРТОЧКИ) */
    .contact-card, 
    .info-card, 
    .form-card {
        /* Принудительно делаем их на всю ширину контейнера */
        width: 100% !important;
        min-width: 100% !important;
        
        /* Немного уменьшаем внутренние отступы для мобильных */
        padding: 25px !important; 
    }

    .form-card {
        height: auto; 
        min-height: 430px;
    }
    
    /* 3. ШАПКА */
    .contact-header {
        height: 300px !important;
        width: 94.8% !important;
        margin-top: 10px auto;
        border-radius: 24px !important;
        padding-left: 20px !important; /* Выравнивание текста */
    }
    
    .contact-header .page-title {
        top: 35px;
        right: 5px;
        font-size: 36px !important;
        width: 94.8% !important;
        padding: 0 !important;
    }
    
    /* 4. ФОРМА */
    .contact-form, 
    .form-card h2 {
        width: 100% !important; /* Форма внутри карточки тоже на всю ширину */
        font-size: 24px !important;
    }

    /* 5. ПОДВАЛ */
    .contact-footer {
        width: 95% !important;
    }

    .flag-icon {
    width: 28px;       /* Фиксируем ширину (как у флагов сейчас) */
    flex-shrink: 0;    /* Запрещаем блоку сжиматься */
    display: flex;     /* Центрируем содержимое */
    justify-content: center;
}

/* Обновляем стили для картинки внутри */
.flag-icon img {
    width: 100%;       /* Картинка растягивается на ширину родителя (28px) */
    border-radius: 4px;
    margin-top: 4px;   /* Отступ сверху для визуального выравнивания с текстом */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
}