/* Footer Styles for mebel-garda.ru - по дизайну Figma */

.footer-main {
    width: 100%;
    min-height: 850px; /* Изменяем на min-height, чтобы контент не обрезался */
    background-color: #FFFFFF;
    position: relative;
}

.footer-wrapper {
    max-width: 1920px;
    margin: 0 auto;
    min-height: 850px; /* Минимальная высота, может увеличиваться */
    position: relative;
    padding: 0;
    overflow: visible; /* Позволяем контенту расширяться */
    display: flex;
    flex-direction: column;
}

/* Логотип */
.footer-logo {
    position: absolute;
    left: 120px;
    top: 80px;
    width: 138px;
    height: 60px;
}

.footer-logo__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Контейнер для навигации (две строки) - всегда две строки через flex column */
.footer-nav-top {
    position: absolute;
    top: 80px;
    left: auto; /* На больших разрешениях привязка к правому краю */
    right: 170px; /* Привязка к правому краю с отступом 170px */
    display: flex;
    flex-direction: column; /* Две строки всегда */
    gap: 50px; /* Расстояние между строками */
    align-items: flex-start; /* Выравниваем содержимое по левому краю */
    padding-left: 200px; /* Padding слева для десктопа и планшетов */
    z-index: 2; /* Выше линии */
}

/* Первая строка - контейнер для колонок */
.footer-nav-cols-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* Позволяем перенос на новую строку */
    justify-content: flex-start; /* Выравниваем по левому краю */
    gap: 16px;
    align-items: flex-start;
    width: 100%;
}

/* Колонка навигации */
.footer-nav-col {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: flex-start;
    flex-shrink: 1; /* Позволяем сжиматься */
    flex-basis: auto; /* Автоматический базовый размер */
    min-width: 0; /* Позволяем сжиматься меньше содержимого */
}

/* Каталог - имеет фиксированную ширину */
.footer-nav-col:nth-child(1) {
    width: 173px;
}

/* Коллекции */
.footer-nav-col:nth-child(2) {
    width: 173px;
}

/* Сотрудничество - может переноситься на новую строку */
.footer-nav-col:nth-child(3) {
    width: auto;
    flex-basis: auto; /* Автоматический размер, переносится при нехватке места */
}

.footer-nav-col__title {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 16px;
    line-height: 112%;
    text-transform: uppercase;
    color: #0C181A;
    margin: 0;
    padding: 0;
}

.footer-nav-col__links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
}

.footer-nav-col__links a {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 112%;
    text-transform: uppercase;
    color: #0C181A;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-nav-col__links a:hover {
    opacity: 0.7;
}

/* Нижняя навигация - строка 2 (О бренде) - всегда на второй строке */
.footer-nav-bottom {
    display: flex;
    flex-direction: column;
    gap: 34px; /* Отступ между линией и ссылками */
    width: 261px; /* Фиксированная ширина */
    align-self: flex-start; /* Выравниваем по левому краю, как и .footer-nav-cols-row */
    margin-left: 0; /* Одинаковое пространство слева как у первой строки */
    margin-bottom: 30px;
    padding-left: 0;
}

/* Разделительная линия 1 (внутри footer-nav-bottom) */
.footer-separator-line {
    width: 240px;
    height: 1px;
    background: #0C181A;
    flex-shrink: 0;
}

.footer-nav-bottom__links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.footer-nav-bottom__links a {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 14px;
    line-height: 112%;
    text-transform: uppercase;
    color: #0C181A;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-nav-bottom__links a:hover {
    opacity: 0.7;
}

/* Разделительная линия 2 - полная ширина рабочей области (сразу под footer-nav-top) */
.footer-separator-full {
    position: absolute;
    left: 0;
    right: 0;
    top: 626px; /* Базовая позиция: 80px (top) + ~546px (высота footer-nav-top), будет обновляться через JS */
    width: 100%;
    height: 1px;
    background: rgba(119, 119, 119, 0.3);
    margin: 0;
    padding: 0;
    z-index: 1;
    transition: top 0.2s ease; /* Плавное изменение позиции */
}

/* Footer Bottom Section (PD Documents + Copyright) */
.footer-bottom {
    position: absolute;
    left: 0;
    right: 0;
    top: 680px; /* Базовая позиция, будет обновляться через JS */
    padding: 0 120px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: top 0.2s ease; /* Плавное изменение позиции */
}

.footer-bottom__row {
    display: flex;
    width: 100%;
}

/* Строка 1: Заголовок + Текст про ПД */
.footer-bottom__row--pd {
    flex-direction: column;
    gap: 20px;
}

.footer-pd-documents__title {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.4;
    color: #0C181A;
    margin: 0;
    padding: 0;
}

.footer-pd-documents__intro {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 11px;
    line-height: 1.6;
    color: #0C181A;
    margin: 0;
    padding: 0;
}

/* Строка 2: Копирайт + Ссылки на документы */
.footer-bottom__row--copyright {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Копирайт */
.footer-copyright {
    display: contents; /* Элементы становятся детьми родителя */
}

.footer-copyright__left {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 10px;
    line-height: 112%;
    text-transform: uppercase;
    color: #0C181A;
    white-space: nowrap;
}

.footer-copyright__right {
}

.footer-copyright__right a {
    font-family: 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 10px;
    line-height: 112%;
    text-transform: uppercase;
    color: #777777;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.footer-copyright__right a:hover {
    opacity: 0.7;
}

/* Десктоп стили */
@media screen and (min-width: 1200px) {
    .footer-wrapper {
        display: flex;
        flex-direction: column;
    }
    
    .footer-bottom {
        padding: 0 120px;
        gap: 20px;
    }
    
    .footer-nav-bottom {
        margin-bottom: 30px;
    }
    
    .footer-nav-top {
        left: auto; /* Убираем привязку к левому краю */
        right: 170px; /* Привязка к правому краю с отступом 170px */
    }
}

/* Адаптивность */
@media screen and (max-width: 1920px) {
    .footer-wrapper {
        padding: 0 clamp(20px, 120px, 120px);
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .footer-main {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    .footer-logo {
        left: clamp(20px, 120px, 120px);
    }
    
    .footer-nav-top {
        left: auto; /* Убираем привязку к левому краю на больших разрешениях */
        right: 170px; /* Привязка к правому краю с отступом 170px */
        gap: 50px; /* Расстояние между строками */
        padding-left: 200px;
    }
    
    .footer-nav-cols-row {
        gap: clamp(40px, 87px, 87px);
    }

    .footer-separator-line {
        width: clamp(240px, 261px, 261px);
        max-width: 261px;
    }
    
    .footer-nav-bottom {
        width: clamp(240px, 261px, 261px);
        max-width: 261px;
    }
    
    .footer-separator-full {
        position: absolute;
        left: 0;
        right: 0;
        top: 626px; /* Позиция сразу после footer-nav-top (80px top + ~546px высота = 626px) */
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .footer-bottom {
        padding: 0 clamp(20px, 120px, 120px);
    }
}

/* Адаптивный padding-left для диапазона 1156px - 1549px */
@media screen and (min-width: 1156px) and (max-width: 1549px) {
    .footer-nav-top {
        left: auto; /* Убираем привязку к левому краю */
        padding-left: 200px;
        right: 170px; /* Привязка к правому краю с отступом 170px */
    }
}

/* Фиксированный padding-left для >= 1550px */
@media screen and (min-width: 1550px) {
    .footer-nav-top {
        left: auto; /* Убираем привязку к левому краю */
        padding-left: 200px;
        right: 170px; /* Привязка к правому краю с отступом 170px */
    }
}

@media screen and (max-width: 1155px) {
    .footer-main {
        height: auto;
        min-height: 850px;
        padding-bottom: 40px;
    }
    
    .footer-nav-top {
        flex-direction: column; /* Две строки всегда */
        gap: 50px; /* Расстояние между строками */
        position: relative;
        top: 80px;
        left: 0;
        right: 0;
        padding: 0 20px 0 200px;
        padding-left: 200px !important; /* Padding слева для планшетов */
        align-items: flex-start; /* Выравниваем по левому краю */
    }
    
    .footer-nav-cols-row {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: flex-start; /* Выравниваем по левому краю */
        width: 100%;
    }
    
    .footer-nav-col {
        position: relative !important;
        left: auto !important;
        width: auto;
        min-width: 150px;
        flex-shrink: 0;
    }
    
    .footer-nav-col__title {
        white-space: nowrap;
    }
    
    .footer-nav-bottom {
        width: 261px;
        margin-top: 0;
        margin-left: 0; /* Одинаковое пространство слева как у первой строки */
        margin-right: 0;
        align-self: flex-start; /* Выравниваем по левому краю */
    }
    
    .footer-separator-full {
        position: absolute;
        left: 0;
        right: 0;
        top: 626px; /* Позиция сразу после footer-nav-top для разрешения <= 1400px */
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .footer-pd-documents {
        position: relative;
        top: 100px;
        padding: 0 20px;
    }
    
    .footer-copyright {
    flex-direction: column;
        gap: 20px;
        align-items: flex-start;
        padding: 0 20px;
        margin-top: 120px;
}

    .footer-copyright__left,
    .footer-copyright__right {
        position: relative;
        left: auto;
        right: auto;
    }
}

/* Tablet and Mobile (768px и меньше) */
@media screen and (max-width: 768px) {
    .footer-main {
        min-height: auto;
        padding: 40px 0;
}

    .footer-logo {
        position: relative;
        left: auto;
        top: auto;
        margin: 0 auto 40px;
        width: 120px;
        height: auto;
    }

    .footer-nav-top {
        top: 0;
        flex-direction: column;
        gap: 30px;
        padding: 0 20px 0 200px;
        padding-left: 200px !important;
        margin-left: 16px;
    }

    .footer-nav-col {
        width: 100% !important;
}

    .footer-separator-line {
        width: 100%;
        left: 0;
    }

    .footer-nav-bottom {
        width: 100%;
        left: 0;
        padding: 0 20px 0 0;
        padding-left: 0;
    }

    .footer-separator-full {
        position: absolute;
        left: 0;
        right: 0;
        top: 480px; /* Позиция сразу после footer-nav-top для разрешения <= 768px */
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .footer-pd-documents {
        top: 60px;
        padding: 0 20px;
    }
    
    .footer-copyright {
        top: 80px;
        padding: 0 20px;
    }
}

/* Mobile (640px и меньше) */
@media screen and (max-width: 639px) {
    #t-footer {
        padding-top: 48px;
    }
    
    .footer-main {
        padding: 48px 0 40px;
    }
    
    .footer-wrapper {
        padding: 0;
}

    .footer-logo {
        position: relative !important;
        left: auto;
        top: auto;
        width: 110px;
        height: auto;
        margin-left: 32px;
        margin-bottom: 72px !important;
}

    .footer-nav-top {
        gap: 24px;
        padding: 0 32px;
        margin-left: 16px;
    }
    
    .footer-nav-col__title {
        font-size: 16px;
    }
    
    /* В мобильном футере показываем ссылки для каталога и коллекций */
    .footer-nav-col__links {
        display: flex;
}

    .footer-nav-bottom {
        position: static;
        top: 0;
        padding: 0 32px 0 0 !important;
        padding-left: 0 !important;
        margin-top: 62px;
        gap: 34px;
    }
    
    .footer-nav-bottom__links a {
        font-size: 14px;
}

    /* Первая линия внутри блока без отступов, во всю ширину контейнера */
    .footer-separator-line {
        position: static;
    top: 0;
    width: 100%;
        margin: 0;
    }
    
    .footer-separator-full {
        position: absolute;
        left: 0;
        right: 0;
        top: 420px; /* Позиция сразу после footer-nav-top для разрешения <= 640px */
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .footer-pd-documents {
        top: 48px;
        padding: 0 20px;
    }
    
    .footer-pd-documents__title {
        font-size: 11px;
    }
    
    .footer-pd-documents__intro {
        font-size: 10px;
    }
    
    
    .footer-bottom {
        padding: 0 35px;
    }
    
    .footer-copyright {
        top: 68px;
        padding: 0 20px;
    flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .footer-copyright__left,
    .footer-copyright__right {
        font-size: 9px;
}
}

/* Small Mobile (480px и меньше) */
@media screen and (max-width: 479px) {
    .footer-main {
        padding: 24px 0 40px;
}

    .footer-logo {
        width: 90px;
        margin-bottom: 24px;
}

    .footer-nav-top {
        gap: 20px;
        padding: 0 16px;
        margin-left: 16px;
}

    .footer-nav-col__title {
        font-size: 13px;
    }
    
    .footer-nav-col__links {
        gap: 8px;
}

    .footer-nav-col__links a {
        font-size: 11px;
}

    .footer-nav-bottom {
        padding: 0 16px 0 0 !important;
        padding-left: 0 !important;
        margin-top: 24px;
        gap: 20px;
}

    .footer-nav-bottom__links {
        gap: 8px;
}

    .footer-nav-bottom__links a {
        font-size: 11px;
    }
    
    .footer-separator-full {
        position: absolute;
        left: 0;
        right: 0;
        top: 380px; /* Позиция сразу после footer-nav-top для разрешения <= 480px */
        width: 100%;
        margin: 0;
        padding: 0;
}

    .footer-pd-documents {
        top: 40px;
        padding: 0 16px;
    }
    
    .footer-pd-documents__title {
        font-size: 10px;
    }
    
    .footer-pd-documents__intro {
        font-size: 9px;
    }
    
    
    .footer-bottom__row--copyright {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .footer-copyright {
        top: 60px;
        padding: 0 16px;
        gap: 12px;
    }

    .footer-copyright__left,
    .footer-copyright__right {
        font-size: 8px;
    }
}
