html:has(body.home-ads-open),
body.home-ads-open {
    overflow: hidden;
}

#homeAdsPopup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    font-family: "Prompt", "Segoe UI", sans-serif;
}

#homeAdsPopup.is-open {
    display: flex;
}

#homeAdsPopup .home-ads__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(45, 27, 16, 0.62);
    backdrop-filter: blur(6px);
}

#homeAdsPopup .home-ads__dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    animation: home-ads-in 0.45s ease;
}

#homeAdsPopup .home-ads__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: rgba(247, 243, 236, 0.94);
    color: #2d1b10;
    box-shadow: 0 8px 24px rgba(45, 27, 16, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
}

#homeAdsPopup .home-ads__close:hover,
#homeAdsPopup .home-ads__close:focus-visible {
    background: #fff;
    outline: 2px solid #3e522d;
    outline-offset: 2px;
}

#homeAdsPopup .swiper-slide {
    width: 100% !important;
    height: auto;
    flex-shrink: 0;
}

#homeAdsPopup .home-ads__swiper {
    overflow: hidden;
    border-radius: 28px;
    background: #f7f3ec;
    box-shadow: 0 28px 70px rgba(45, 27, 16, 0.28);
}

#homeAdsPopup .home-ads__card {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    min-height: 440px;
    background: #f7f3ec;
}

#homeAdsPopup .home-ads__card--text {
    grid-template-columns: 1fr;
}

#homeAdsPopup .home-ads__card--text .home-ads__body {
    align-items: center;
    text-align: center;
    padding: 3.5rem 4.4rem;
}

#homeAdsPopup .home-ads__media {
    min-height: 440px;
    background: #e7dfd2;
}

#homeAdsPopup .home-ads__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#homeAdsPopup .home-ads__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.85rem;
    padding: 2.5rem 4.4rem 3.5rem 2.25rem;
    color: #4a3f35;
}

#homeAdsPopup .home-ads__badge {
    align-self: flex-start;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: rgba(62, 82, 45, 0.12);
    color: #3e522d;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

#homeAdsPopup .home-ads__card--text .home-ads__badge,
#homeAdsPopup .home-ads__card--text .home-ads__headline {
    align-self: center;
}

#homeAdsPopup .home-ads__headline {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    color: #3e522d;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

#homeAdsPopup .home-ads__headline::before {
    content: "";
    width: 1.35rem;
    height: 2px;
    border-radius: 999px;
    background: #3e522d;
    flex-shrink: 0;
}

#homeAdsPopup .home-ads__title,
#homeAdsPopup .home-ads__excerpt {
    max-width: 100%;
    overflow-wrap: anywhere;
}

#homeAdsPopup .home-ads__title {
    margin: 0;
    color: #2d1b10;
    font-family: "PT Serif", Georgia, serif;
    font-size: clamp(1.55rem, 2.4vw, 2.15rem);
    font-weight: 700;
    line-height: 1.25;
}

#homeAdsPopup .home-ads__excerpt {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.7;
}

#homeAdsPopup .home-ads__cta {
    align-self: flex-start;
    margin-top: 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.72rem 1.35rem;
    border-radius: 999px;
    background: #3e522d;
    color: #f7f3ec;
    text-decoration: none;
    font-weight: 600;
}

#homeAdsPopup .home-ads__card--text .home-ads__cta {
    align-self: center;
}

#homeAdsPopup .home-ads__cta:hover,
#homeAdsPopup .home-ads__cta:focus-visible {
    background: #2d3d21;
    color: #fff;
}

#homeAdsPopup .home-ads__nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 2.6rem;
    height: 2.6rem;
    margin-top: -1.3rem;
    border: 0;
    border-radius: 999px;
    background: rgba(247, 243, 236, 0.94);
    color: #2d1b10;
    box-shadow: 0 8px 20px rgba(45, 27, 16, 0.16);
}

#homeAdsPopup .home-ads__nav--prev { left: 0.85rem; }
#homeAdsPopup .home-ads__nav--next { right: 0.85rem; }

#homeAdsPopup .home-ads__nav::after {
    font-family: swiper-icons;
    font-size: 0.85rem;
}

#homeAdsPopup .home-ads__nav--prev::after { content: "prev"; }
#homeAdsPopup .home-ads__nav--next::after { content: "next"; }

#homeAdsPopup.home-ads--single .home-ads__nav,
#homeAdsPopup.home-ads--single .home-ads__pagination {
    display: none;
}

#homeAdsPopup .home-ads__pagination {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: 0.95rem;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    width: auto;
    transform: translateX(-50%);
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(247, 243, 236, 0.94);
    box-shadow: 0 6px 16px rgba(45, 27, 16, 0.12);
}

#homeAdsPopup .home-ads__pagination .swiper-pagination-bullet {
    width: 0.5rem;
    height: 0.5rem;
    background: rgba(45, 27, 16, 0.28);
    opacity: 1;
}

#homeAdsPopup .home-ads__pagination .swiper-pagination-bullet-active {
    background: #3e522d;
    width: 1.15rem;
    border-radius: 999px;
}

@keyframes home-ads-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 767.98px) {
    #homeAdsPopup {
        padding: 0.75rem;
        align-items: center;
    }

    #homeAdsPopup .home-ads__dialog {
        width: 100%;
        max-height: calc(100dvh - 1.5rem);
    }

    #homeAdsPopup .home-ads__swiper,
    #homeAdsPopup .swiper-slide,
    #homeAdsPopup .home-ads__card {
        max-height: calc(100dvh - 1.5rem);
    }

    #homeAdsPopup .home-ads__card,
    #homeAdsPopup .home-ads__card--text {
        display: flex;
        flex-direction: column;
        min-height: 0;
        text-align: left;
    }

    #homeAdsPopup .home-ads__media {
        flex: 0 0 auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
        max-height: 42dvh;
    }

    #homeAdsPopup .home-ads__body,
    #homeAdsPopup .home-ads__card--text .home-ads__body {
        align-items: flex-start;
        text-align: left;
        overflow: auto;
        min-height: 0;
        padding: 1.15rem 1.15rem 2.8rem;
        gap: 0.65rem;
    }

    #homeAdsPopup .home-ads__card--text .home-ads__badge,
    #homeAdsPopup .home-ads__card--text .home-ads__headline,
    #homeAdsPopup .home-ads__card--text .home-ads__cta {
        align-self: flex-start;
    }

    #homeAdsPopup .home-ads__title {
        font-size: 1.35rem;
    }

    #homeAdsPopup .home-ads__nav {
        top: 5.6rem;
        margin-top: 0;
    }

    #homeAdsPopup .home-ads__nav--prev { left: 0.45rem; }
    #homeAdsPopup .home-ads__nav--next { right: 0.45rem; }
}

@media (prefers-reduced-motion: reduce) {
    #homeAdsPopup .home-ads__dialog {
        animation: none;
    }
}
