/* ==========================================================================
   Подвал сайта — стиль новой главной (footer/footer_1.php).
   Подключается на всех страницах, поэтому токены задаются здесь, а не берутся из home.css.
   Сейчас выводится тёмный вариант (.pg-footer--dark); без этого класса — светлый.
   ========================================================================== */

.pg-footer {
    --f-ink: #151833;
    --f-text: #1c1f3a;
    --f-muted: #6a6d8a;
    --f-dim: #a3a6c6;
    --f-line: #e9e9ee;
    --f-soft: #f0f0f7;
    --f-btn: #252871;
    --f-btn-hover: #1b1e5a;
    --f-card: #fff;
    --f-blush: linear-gradient(160deg, #dfe2fb 0%, #ecdff4 48%, #f9dbd6 100%);
    --f-ease: cubic-bezier(.22, 1, .36, 1);

    position: relative;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 32px 32px 0 0;
    background: var(--f-card);
    color: var(--f-text);
}

.pg-footer__box {
    /* Ширину и боковые отступы задаёт .container темы — контент подвала на одной линии с сайтом */
    padding-top: 48px;
}

.pg-footer a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Верхний блок записи ---------- */
.pg-footer__cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px 48px;
    align-items: center;
    margin-bottom: 64px;
    padding: 32px 40px;
    border-radius: 24px;
    background:
        radial-gradient(30% 90% at 100% 0%, rgba(255, 255, 255, .6), transparent 70%),
        var(--f-blush);
}

.pg-footer__cta-title {
    margin: 0;
    font-size: clamp(24px, 2.6vw, 36px);
    font-weight: 400;
    line-height: 1.12;
    color: var(--f-ink);
}

.pg-footer__cta-title span {
    color: var(--f-dim);
}

.pg-footer__cta-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
}

.pg-footer__phone {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.pg-footer__phone small {
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--f-muted);
}

.pg-footer__phone b {
    font-size: 32px;
    font-weight: 500;
    color: var(--f-ink);
    font-variant-numeric: tabular-nums;
}

.pg-footer__phone:hover b {
    color: var(--f-btn);
}

.pg-footer__btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 8px 0 24px;
    border-radius: 999px;
    background: var(--f-btn);
    font-size: 15px;
    font-weight: 500;
    color: #fff !important;
    white-space: nowrap;
    transition: background-color .3s var(--f-ease);
}

.pg-footer__btn:hover {
    background: var(--f-btn-hover);
}

.pg-footer__btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    transition: transform .3s var(--f-ease);
}

.pg-footer__btn:hover span {
    transform: translateX(3px);
}

/* ---------- Основная часть ---------- */
.pg-footer__main {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 40px 32px;
    padding-bottom: 48px;
}

.pg-footer__logo img {
    display: block;
    width: 240px;
    height: auto;
}

.pg-footer__about {
    max-width: 320px;
    margin: 24px 0 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--f-muted);
}

.pg-footer__contacts {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
}

.pg-footer__contacts {
    gap: 16px;
}

.pg-footer__contacts li {
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.3;
}

.pg-footer__contacts small {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    color: var(--f-muted);
}

.pg-footer .pg-footer__contacts.pg-footer__contacts--brand {
    margin-top: 24px;
}

.pg-footer__contacts li > span {
    min-width: 0;
}

.pg-footer__contacts svg {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 11px;
    border-radius: 50%;
    background: var(--f-soft);
    color: var(--f-btn);
}

.pg-footer__contacts a:hover {
    color: var(--f-btn);
}

.pg-footer .pg-footer__col-title {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--f-dim);
}

.pg-footer__menu {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pg-footer__menu a {
    position: relative;
    display: inline-block;
    font-size: 16px;
    color: var(--f-text);
    transition: color .2s;
}

.pg-footer__menu a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -2px;
    left: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s var(--f-ease);
}

.pg-footer__menu a:hover {
    color: var(--f-btn);
}

.pg-footer__menu a:hover::after {
    transform: scaleX(1);
}

/* Ссылка «Все адреса на карте» под партнёрами */
.pg-footer__more {
    display: inline-block;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--f-btn) !important;
    text-decoration: underline !important;
    text-decoration-color: rgba(37, 40, 113, .25) !important;
    text-underline-offset: 4px;
}

.pg-footer--dark .pg-footer__more {
    color: #fff !important;
    text-decoration-color: rgba(255, 255, 255, .35) !important;
}

/* Правовые ссылки в нижней строке */
.pg-footer__legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    font-size: 14px;
}

.pg-footer__legal a {
    color: var(--f-text);
}

.pg-footer__legal a:hover {
    color: var(--f-btn);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.pg-footer__copy {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 32px;
    padding: 0 0 24px;
    font-size: 14px;
    color: var(--f-muted);
}

/* ---------- Нижняя строка ---------- */
.pg-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 32px;
    padding: 24px 0;
    border-top: 1px solid var(--f-line);
    font-size: 14px;
    color: var(--f-muted);
}

.pg-footer__bottom-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
}

.pg-footer__top {
    display: inline-flex;
    padding: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--f-soft);
    color: var(--f-btn);
    cursor: pointer;
    transition: background-color .3s var(--f-ease), color .3s var(--f-ease);
}

.pg-footer__top:hover {
    background: var(--f-btn);
    color: #fff;
}

/* ---------- Предупреждение (обязательная надпись) ---------- */
.pg-footer__warning {
    margin: 0;
    padding: 24px 0 40px;
    border-top: 1px solid var(--f-line);
    font-size: clamp(16px, 2vw, 30px);
    font-weight: 500;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
    text-wrap: balance;
    background: linear-gradient(90deg, #252871 0%, #6b62c9 55%, #c26c93 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ==========================================================================
   Вариант Б — тёмный фирменный
   ========================================================================== */
.pg-footer--dark {
    --f-ink: #fff;
    --f-text: rgba(255, 255, 255, .92);
    --f-muted: rgba(255, 255, 255, .62);
    --f-dim: rgba(255, 255, 255, .45);
    --f-line: rgba(255, 255, 255, .12);
    --f-soft: rgba(255, 255, 255, .08);
    --f-btn: #fff;
    --f-btn-hover: #e9e9f7;
}

.pg-footer--dark {
    background:
        radial-gradient(40% 60% at 100% 0%, rgba(201, 163, 230, .28), transparent 70%),
        radial-gradient(30% 50% at 0% 100%, rgba(249, 219, 214, .14), transparent 70%),
        linear-gradient(160deg, #2b2f86 0%, #252871 45%, #1b1e5a 100%);
}

.pg-footer--dark .pg-footer__cta {
    background: rgba(255, 255, 255, .06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.pg-footer--dark .pg-footer__btn {
    color: #252871 !important;
}

.pg-footer--dark .pg-footer__btn span {
    background: rgba(37, 40, 113, .1);
}

.pg-footer--dark .pg-footer__contacts svg {
    color: #fff;
}

.pg-footer--dark .pg-footer__menu a:hover,
.pg-footer--dark .pg-footer__contacts a:hover,
.pg-footer--dark .pg-footer__phone:hover b {
    color: #fff;
    opacity: .8;
}

.pg-footer--dark .pg-footer__top {
    color: #fff;
}

.pg-footer--dark .pg-footer__top:hover {
    background: #fff;
    color: #252871;
}

.pg-footer--dark .pg-footer__warning {
    background: linear-gradient(90deg, #fff 0%, #dcd6fa 55%, #f9dbd6 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ---------- Адаптив ---------- */
@media (max-width: 1199px) {
    .pg-footer__main {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .pg-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1099px) {
    .pg-footer__main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pg-footer__brand {
        grid-column: 1 / -1;
    }

    .pg-footer__cta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .pg-footer {
        border-radius: 24px 24px 0 0;
    }

    .pg-footer__box {
        padding-top: 24px;
    }

    .pg-footer__cta {
        margin-bottom: 40px;
        padding: 24px 20px;
        border-radius: 20px;
    }

    .pg-footer__cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .pg-footer__btn {
        justify-content: space-between;
    }

    .pg-footer__main {
        grid-template-columns: 1fr 1fr;
        gap: 32px 16px;
        padding-bottom: 32px;
    }

    .pg-footer__col--contacts,
    .pg-footer__col--partners {
        grid-column: 1 / -1;
    }

    .pg-footer__logo img {
        width: 200px;
    }

    .pg-footer__menu a {
        font-size: 15px;
    }

    .pg-footer__bottom {
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    .pg-footer__legal {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .pg-footer__top {
        flex: 0 0 40px;
    }

    .pg-footer__copy {
        flex-direction: column;
        font-size: 13px;
    }

    .pg-footer__warning {
        padding: 20px 0 32px;
        font-size: 18px;
        line-height: 1.25;
        text-align: left;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pg-footer *,
    .pg-footer *::after {
        transition: none !important;
    }
}

/* ==========================================================================
   Совместимость с Porto и меню WordPress
   ========================================================================== */
.footer-wrapper:has(> .pg-footer),
.footer-wrapper:has(> #footer-boxed > .pg-footer) {
    background: transparent;
}

/* Списки подвала: сброс отступов Porto (ul { padding-left }) */
.pg-footer .pg-footer__menu,
.pg-footer .pg-footer__contacts,
.pg-footer .pg-footer__legal,
.pg-footer .pg-footer__menu li,
.pg-footer .pg-footer__contacts li,
.pg-footer .pg-footer__legal li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pg-footer img {
    max-width: 100%;
}

.pg-footer__menu .current-menu-item > a {
    color: var(--f-btn);
}

.pg-footer--dark .pg-footer__menu .current-menu-item > a {
    color: #fff;
    opacity: .7;
}

/* Правовое меню в нижней строке — пункты в ряд */
.pg-footer__legal li {
    display: inline-flex;
}

.pg-footer__bottom > nav {
    min-width: 0;
}

.pg-footer__btn:focus-visible,
.pg-footer a:focus-visible,
.pg-footer__top:focus-visible {
    outline: 3px solid rgba(201, 163, 230, .8);
    outline-offset: 3px;
}
