/* ========== ПРАВИЛЬНЫЙ ФУТЕР ========== */
@import url('/css/font-tt-norms-pro.css');

:root {
    --primary-color: #D91656;
    --primary-light: #FF4D87;
    --primary-dark: #B3003D;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #E0E0E0;
    --gray-divider: #E5E5E5;
}

/* СБРОС ДЛЯ ФУТЕРА */
footer * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

footer {
    padding: 50px 0 30px;
    width: 100%;
    position: relative;
    clear: both;
}

/* КОНТЕЙНЕР - ПРАВИЛЬНАЯ ШИРИНА */
.footer-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 4 КОЛОНКИ - РАВНОМЕРНОЕ РАСПРЕДЕЛЕНИЕ */
.footer-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--gray-divider);
    align-items: stretch; /* Важно: растягиваем колонки на всю высоту */
}

/* КОЛОНКИ */
.footer-column {
    display: flex;
    flex-direction: column;
}

/* ОСОБЫЕ СТИЛИ ДЛЯ КОЛОНКИ С ЛОГОТИПОМ И БАННЕРОМ */
.footer-logo-banner-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Логотип сверху, баннер снизу */
    height: 100%; /* Занимаем всю доступную высоту */
    min-height: 300px; /* Минимальная высота для правильного отображения */
}

/* ВСЕ ТЕКСТЫ ПО ЛЕВОМУ КРАЮ */
.footer-column h5,
.footer-column ul,
.footer-contacts,
.footer-phone,
.footer-email,
.footer-info,
.footer-policy {
    text-align: left;
}

.footer-column h5 {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    font-family: 'TT Norms Pro', sans-serif;
}

.footer-column ul {
    list-style: none;
    padding-left: 0px !important;
   

}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    transition: color 0.3s ease;
    display: block;
    padding: 3px 0;
    font-family: 'TT Norms Pro', sans-serif;

}

.footer-column ul li a:hover {
    color: var(--primary-color);
}

/* КОНТАКТЫ */
.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.footer-phone,
.footer-email {
    color: var(--text-light);
    font-size: 16px;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-phone:hover,
.footer-email:hover {
    color: var(--primary-color);
}

/* ========== ЛОГОТИП В ФУТЕРЕ (100px) ========== */
.footer-logo-wrapper {
    width: 100%;
    text-align: center;
    margin-bottom: 48px; /* Минимальное расстояние 48px до баннера */
    flex-shrink: 0; /* Запрещаем сжатие */
}

.footer-logo-link {
    display: inline-block;
    text-decoration: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-logo-img {
    height: 100px; /* Увеличенный логотип 100px */
    width: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    padding: 10px;
}

/* ========== БАННЕР МИНЗДРАВА ========== */
.footer-minzdrav-wrapper {
    width: 100%;
    margin: 0 auto;
    margin-top: auto; /* Это прижмет баннер ко дну колонки */
    flex-shrink: 0; /* Запрещаем сжатие */
}

/* КАСТОМНЫЙ БАННЕР МИНЗДРАВА - ФИКСИРОВАННЫЙ РАЗМЕР 320×120px */
.custom-minzdrav-banner {
    display: block;
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    width: 320px;
    height: 120px;
    box-shadow: none;
    flex-shrink: 0;
    font-family: 'TT Norms Pro', sans-serif;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-minzdrav-banner:hover {
    border-color: var(--primary-light);
}

/* Исправляем сетку чтобы соответствовала новому размеру 320×120px */
.minzdrav-grid {
    display: grid;
    grid-template-columns: 120px 200px; /* Левая: квадрат 120px, Правая: 200px */
    grid-template-rows: 90px 30px; /* 3:1 соотношение - текст 90px, кнопка 30px */
    height: 120px;
    width: 320px;
    margin: 0;
    padding: 0;
}

/* ЛЕВАЯ ЯЧЕЙКА - ИКОНКА (120×120px - квадрат) */
.minzdrav-icon-cell {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    padding: 20px;
    box-sizing: border-box;
}

.minzdrav-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
}

/* ПРАВАЯ ВЕРХНЯЯ ЯЧЕЙКА - ТЕКСТ (200×90px - 75% высоты) */
.minzdrav-text-cell {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 200px;
    height: 90px;
    padding: 10px 1px 10px;
    overflow: hidden;
    box-sizing: border-box;
}

.minzdrav-text {
    color: #333;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 700;
    font-family: 'TT Norms Pro', sans-serif;
    text-align: left;
    margin: 0;
    padding: 0;
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    width: 170px;
    height: 72px;
    max-height: 72px;
}

/* ПРАВАЯ НИЖНЯЯ ЯЧЕЙКА - КНОПКА (200×30px - 25% высоты) */
.minzdrav-button-cell {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: left;
    width: 200px;
    height: 30px;
    padding: 0 15px 8px;
    box-sizing: border-box;
}

.minzdrav-button {
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: 700;
    font-family: 'TT Norms Pro', sans-serif;
    padding: 6px 20px;
    border-radius: 15px;
    text-transform: uppercase;
    text-align: center;
    margin: 0;
    min-width: 100px;
    height: 24px;
    line-height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: none;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.minzdrav-button:hover {
    background: var(--primary-dark);
}

/* НИЖНЯЯ ЧАСТЬ */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.6;
    flex: 1;
    max-width: 800px;
    text-align: left;
}

.footer-policy {
    text-align: right;
}

.footer-policy a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.footer-policy a:hover {
    color: var(--primary-color);
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 1200px) {
    .footer-container {
        padding: 0 30px;
    }
    
    .footer-columns {
        gap: 30px;
    }
}

@media (max-width: 992px) {
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 30px;
    }
    
    .footer-column:nth-child(3) {
        grid-column: 1;
    }
    
    .footer-column:nth-child(4) {
        grid-column: 2;
    }
    
    .footer-logo-banner-column {
        min-height: 280px;
    }
}

@media (max-width: 768px) {
    .footer-container {
        padding: 0 20px;
    }
    
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    .footer-column:nth-child(4) {
        grid-column: 1;
        display: flex;
        justify-content: center;
    }
    
    .footer-logo-banner-column {
        min-height: 260px;
        align-items: center;
    }
    
    .footer-logo-wrapper {
        margin-bottom: 40px;
    }
    
    .footer-logo-img {
        height: 85px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: left;
        gap: 15px;
        align-items: flex-start;
    }
    
    .footer-info,
    .footer-policy {
        width: 100%;
        text-align: left;
    }
    
    /* Центрируем баннер на мобильных */
    .custom-minzdrav-banner {
        margin: 0 auto;
    }
}

/* Масштабирование для мобильных устройств */
@media (max-width: 480px) {
    .footer-container {
        padding: 0 15px;
    }
    
    .footer-logo-banner-column {
        min-height: 240px;
    }
    
    .footer-logo-img {
        height: 75px;
    }
    
    .footer-logo-wrapper {
        margin-bottom: 36px;
    }
    
    .custom-minzdrav-banner {
        width: 300px;
        height: 112px;
        transform: scale(0.94);
        transform-origin: center;
    }
    
    .minzdrav-grid {
        width: 300px;
        height: 112px;
        grid-template-columns: 112px 188px;
        grid-template-rows: 84px 28px; /* 112 * 0.75 = 84, 112 * 0.25 = 28 */
    }
    
    .minzdrav-icon-cell {
        width: 112px;
        height: 112px;
        padding: 18px;
    }
    
    .minzdrav-icon {
        width: 75px;
        height: 75px;
    }
    
    .minzdrav-text-cell {
        width: 188px;
        height: 84px;
        padding: 10px 12px 5px;
    }
    
    .minzdrav-text {
        font-size: 11px;
        width: 164px;
        height: 69px;
        max-height: 69px;
    }
    
    .minzdrav-button-cell {
        width: 188px;
        height: 28px;
        padding: 0 12px 6px;
    }
    
    .minzdrav-button {
        font-size: 11px;
        padding: 5px 18px;
        min-width: 90px;
        height: 22px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
    .footer-container {
        padding: 0 15px;
    }
    
    .footer-logo-banner-column {
        min-height: 220px;
    }
    
    .footer-logo-img {
        height: 65px;
    }
    
    .footer-logo-wrapper {
        margin-bottom: 32px;
    }
    
    .custom-minzdrav-banner {
        width: 280px;
        height: 105px;
        transform: scale(0.88);
    }
    
    .minzdrav-grid {
        width: 280px;
        height: 105px;
        grid-template-columns: 105px 175px;
        grid-template-rows: 79px 26px; /* 105 * 0.75 = 78.75, 105 * 0.25 = 26.25 */
    }
    
    .minzdrav-icon-cell {
        width: 105px;
        height: 105px;
        padding: 15px;
    }
    
    .minzdrav-icon {
        width: 70px;
        height: 70px;
    }
    
    .minzdrav-text-cell {
        width: 175px;
        height: 79px;
        padding: 8px 10px 4px;
    }
    
    .minzdrav-text {
        font-size: 10px;
        width: 155px;
        height: 67px;
        max-height: 67px;
    }
    
    .minzdrav-button-cell {
        width: 175px;
        height: 26px;
        padding: 0 10px 5px;
    }
    
    .minzdrav-button {
        font-size: 10px;
        padding: 4px 16px;
        min-width: 80px;
        height: 20px;
    }
}

/* ========== ВЕРСИЯ ДЛЯ СЛАБОВИДЯЩИХ ========== */
.eye-version footer {
    background: #111;
    border-top-color: #333;
}

.eye-version .footer-column h5 {
    color: white;
    border-bottom-color: #FFD700;
}

.eye-version .footer-column ul li a,
.eye-version .footer-phone,
.eye-version .footer-email,
.eye-version .footer-info,
.eye-version .footer-policy a {
    color: #ccc;
}

.eye-version .footer-column ul li a:hover,
.eye-version .footer-phone:hover,
.eye-version .footer-email:hover,
.eye-version .footer-policy a:hover {
    color: #FFD700;
}

.eye-version .footer-logo-img {
    filter: brightness(0) invert(1);
    box-shadow: 0 3px 12px rgba(255, 215, 0, 0.15);
    background-color: #222;
}

.eye-version .footer-logo-link:hover .footer-logo-img {
    filter: brightness(0) invert(1) drop-shadow(0 0 5px #FFD700);
}

.eye-version .custom-minzdrav-banner {
    background: #222;
    border-color: #444;
}

.eye-version .minzdrav-icon-cell {
    background: #333;
}

.eye-version .minzdrav-text-cell,
.eye-version .minzdrav-button-cell {
    background: #222;
}

.eye-version .minzdrav-text {
    color: #eee;
}

.eye-version .minzdrav-button {
    background: #FFD700;
    color: #333;
}

.eye-version .minzdrav-button:hover {
    background: #FFED4E;
}

/* ========== ФОЛБЭК ДЛЯ SVG ========== */
.minzdrav-icon-cell:after {
    content: "НОК";
    font-size: 20px;
    font-weight: bold;
    color: #D91656;
    display: none;
    position: absolute;
}

.minzdrav-icon[src$=".svg"]:error + .minzdrav-icon-cell:after {
    display: block;
}

/* ========== ЗАЩИТА ОТ СЖАТИЯ ========== */
.footer-logo-banner-column {
    min-width: 320px;
}

@media (max-width: 768px) {
    .footer-logo-banner-column {
        min-width: 100%;
    }
}