.footer__wrapper {
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.07);
    background: var(--belyy);
}

.footer {
    display: flex;
    flex-direction: column;
    padding-top: 15px;
    padding-bottom: 15px;

    z-index: 10;
    bottom: 0;
    margin-top: 70px;
}

/* .footer__wrapper already carries .limit; the inner .limit must not add a second gutter */
.footer__wrapper .footer {
    padding-inline: 0;
}

.footer--filter {
    width: 100%;
    left: 0;
    right: 0;
    position: fixed;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--belyy);
    padding: 15px;
}

.footer__logo {
    max-width: 110px;
    min-width: 40px;
    align-self: center;
    margin-bottom: 30px;
}

.footer__title {
    font-weight: 600;
    font-size: clamp(14px, 11.48px + 0.6vw, 23px);
    line-height: 130%;
    color: var(--chernyy);
    margin-bottom: 20px;
    white-space: nowrap;
}

.footer__catalog-wr {
    display: none;
}

.footer__info-wr {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-left: 20px;
    margin-bottom: 30px;
}

.footer__location-wr {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.footer__location {
    margin-bottom: 30px;
}

.footer__link {
    font-weight: 500;
    font-size: clamp(14px, 12.86px + 0.36vw, 18px);
    line-height: 140%;
    color: var(--seryy);
    white-space: nowrap;
}

.footer__link:hover {
    color: var(--chernyy);
}

.footer__created-at {
    font-weight: 500;
    font-size: clamp(14px, 12.86px + 0.36vw, 18px);
    line-height: 140%;
    text-align: center;
    color: var(--chernyy);
    display: flex;
    justify-content: center;
    align-items: end;
}

.footer__reset-btn {
    font-weight: 500;
    font-size: 15px;
    line-height: 140%;
    color: var(--chernyy);
    background: var(--svetlo-seryy);
    padding: 15px;
}

.footer__show-btn {
    font-weight: 500;
    font-size: 15px;
    line-height: 140%;
    color: var(--belyy);
    background: var(--chernyy);
    padding: 15px;
}

/* Mobile (Figma "М. Главная", 393px): 15px Medium, single 15px gutter */
@media (max-width: 767px) {
    .footer.limit {
        padding-inline: 0;
        padding-top: 30px;
    }
    .footer__title,
    .footer__link,
    .footer__created-at,
    .footer__location .location-block__title,
    .footer__location .location-block__info {
        font-size: 15px;
        line-height: 21px;
        font-weight: 500;
    }
    .footer__title {
        font-weight: 500;
    }
    .footer__location .location-block_adress {
        font-size: 15px;
        line-height: 21px;
    }
    /* Figma: phones 24px apart, room for two numbers in every card so the icon rows line up */
    .footer__location .location-block__info + .location-block__info {
        margin-top: 3px;
    }
    .footer__location .location-block__contact {
        min-height: 69px;
    }
}

/* Phones + tablets (mobile header and tab bar are shown): spacing per Figma "М. Главная", clearance for the tab bar */
@media (max-width: 1199px) {
    .footer__wrapper {
        padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }
    .footer__info-wr {
        gap: 15px;
    }
    .footer__location .location-block__links {
        gap: 10px;
        align-items: center;
    }
    .footer__location .location-block__icon img {
        width: 21px;
        height: 28px;
    }
    .footer__location .location-block__link img {
        width: 28px;
        height: 28px;
    }
}

/* Phone links: theme colour at every width (no default blue) */
.footer__location .location-block__info a {
    display: inline-flex;
    align-items: center;
    color: var(--chernyy);
}

/* Default WP archive/category widgets are not part of the design */
.footer__widgets .footer-widget:has([class*="wp-block-archives"], [class*="wp-block-categories"]) {
    display: none;
}

@media (min-width: 768px) {
    .footer {
        padding-top: 30px;
        padding-bottom: 30px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, auto);
        gap: 25px;
    }
    .footer__logo {
        margin: 0;
        grid-area: 2 / 1 / 3 / 2;
        align-self: self-end;
        max-width: 188px;
    }
    .footer__location {
        grid-area: 1 / 1 / 2 / 4;
        margin: 0;
        width: 100%;
    }
    .footer__location-wr {
        flex-direction: row;
        gap: 10px;
    }
    .footer__location-wr .location-block {
        flex: 1;
    }

    .footer__location .location-block__links {
        margin-top: auto;
    }

    .footer__catalog-wr {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .footer__info-wr {
        padding: 0;
        margin: 0;
    }
    .footer__catalog-button {
        grid-area: 1 / 2 / 2 / 3;
        border-radius: 5px;
        padding: 10px 25px;
        width: 163px;
        height: 45px;
        background: var(--svetlo-seryy);
        font-weight: 500;
        font-size: 18px;
        line-height: 140%;
        color: var(--chernyy);
    }
    .footer__created-at {
        grid-area: 3 / 1 / 4 / 4;
    }
}
@media (min-width: 1200px) {
    .footer {
        margin-top: 90px;
    }
    .footer__logo {
        max-width: 250px;
        align-self: auto;
    }
    .footer__catalog {
        width: min-content;
    }
    .footer__info {
        width: min-content;
    }
}
@media (min-width: 1800px) {
    .footer {
        display: grid;
        grid-template-columns: auto auto auto 1fr;
        grid-template-rows: minmax(335px, auto) auto;
        column-gap: 75px;
        row-gap: 20px;
        padding-top: 40px;
        padding-bottom: 40px;
        margin-top: 110px;
    }

    .footer__logo {
        grid-area: 1 / 1 / 3 / 2;
        align-self: center;
        max-width: 190px;
        margin-right: 35px;
    }

    .footer__catalog {
        width: 189px;
    }

    .footer__location {
        justify-self: stretch;
        grid-area: auto;
    }

    .footer__location-wr {
        gap: 20px;
        margin: 0;
    }

    .footer__created-at {
        grid-area: 2 / 2 / 3 / 5;
        justify-content: end;
    }
}

/* ---- Checkout desktop footer (Figma "Оплата"): logo + "Официальная информация"; phones keep the full footer ---- */
.footer-checkout {
    display: none;
}

@media (min-width: 1200px) {
    .footer__wrapper--checkout {
        display: none;
    }

    .footer-checkout {
        display: block;
        margin-top: 110px;
        background: var(--belyy);
        box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.07);
    }

    .footer-checkout__inner {
        display: flex;
        align-items: flex-end;
        gap: 110px;
        padding-block: 40px;
    }

    .footer-checkout__logo img {
        width: 188px;
        height: auto;
        display: block;
    }

    .footer-checkout__link {
        font: 500 18px/140% var(--font-family);
        color: var(--chernyy);
        text-decoration: underline;
    }
}
