/* ==============================
   CAROUSEL â€” mobile-first
============================== */

.carousel {
    width: 100%;
    max-width: 100%;
    height: clamp(300px, 92vw, 380px);
    border-radius: 0;
    overflow: hidden;
    position: relative;
    background: var(--primary-blue);
    box-sizing: border-box;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .55s ease;
    background-size: cover;
    background-position: center;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(1, 64, 82, .84) 0%,
        rgba(1, 85, 109, .45) 38%,
        rgba(1, 106, 136, .12) 62%,
        rgba(15, 23, 42, .52) 100%
    );
}

.slide-container {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 16px 14px 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    box-sizing: border-box;
}

.top-ad {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(219, 234, 254, .55);
    background: rgba(1, 85, 109, .25);
    color: var(--white);
    font-size: .65rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.content {
    width: 100%;
    max-width: 100%;
    padding-right: 68px;
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    flex-shrink: 0;
}

.content h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.32;
    color: var(--white);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content p {
    margin: 0;
    width: 100%;
    font-size: .8rem;
    line-height: 1.55;
    color: rgba(219, 234, 254, .92);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    flex-shrink: 0;
}

.buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 18px;
    border-radius: var(--btn-radius, 999px);
    background: var(--btn-primary);
    color: var(--white);
    border: none;
    font-family: inherit;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, transform .2s ease;
    flex-shrink: 0;
}

.buy-btn:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-1px);
}

.navigation {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.nav {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--light-blue);
    color: var(--primary-blue);
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
    flex-shrink: 0;
}

.nav:hover {
    background: #b3e0ea;
    color: var(--btn-primary);
    transform: scale(1.04);
}

.carousel-dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(1, 64, 82, .6);
    backdrop-filter: blur(4px);
    pointer-events: auto;
    max-width: calc(100% - 28px);
}

.carousel-dot {
    width: 6px;
    height: 6px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(219, 234, 254, .35);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
    flex-shrink: 0;
}

.carousel-dot.is-active {
    background: var(--white);
    transform: scale(1.08);
}

.home-carousel-wrap {
    /* Full-bleed: this sits directly under the header now (moved outside
       .container in index.php) — no top margin, so it meets the header with
       no gap and spans edge to edge. Bottom margin only, before the grid. */
    margin: 0 0 24px;
}

/* Small phones */
@media (max-width: 380px) {
    .carousel {
        height: clamp(290px, 96vw, 340px);
    }

    .content {
        padding-right: 0;
        max-width: 72%;
    }

    .top-ad {
        top: 10px;
        right: 10px;
        font-size: .6rem;
        padding: 3px 8px;
    }

    .buy-btn {
        padding: 8px 14px;
        font-size: .72rem;
    }

    .nav {
        width: 32px;
        height: 32px;
        font-size: 1.05rem;
    }
}

/* Tablet */
@media (min-width: 640px) and (max-width: 1023px) {
    .carousel {
        height: clamp(300px, 52vw, 360px);
    }

    .slide-container {
        padding: 20px 20px 52px;
    }

    .content {
        max-width: 58%;
        padding-right: 0;
    }

    .content h2 {
        font-size: clamp(1.1rem, 2.8vw, 1.35rem);
        -webkit-line-clamp: 3;
    }

    .content p {
        max-width: 320px;
        font-size: .82rem;
        -webkit-line-clamp: 4;
    }

    .top-ad {
        top: 16px;
        right: 16px;
        font-size: .7rem;
        padding: 5px 12px;
    }

    .buy-btn {
        min-height: 38px;
        padding: 9px 22px;
        font-size: .8125rem;
    }

    .nav {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .carousel-dots {
        bottom: 14px;
    }
}

/* Large screens */
@media (min-width: 1024px) {
    .carousel {
        height: clamp(280px, 24vw, 360px);
    }

    .slide {
        background-position: 62% center;
    }

    .overlay {
        background: linear-gradient(
            100deg,
            rgba(1, 64, 82, .88) 0%,
            rgba(1, 85, 109, .52) 34%,
            rgba(1, 106, 136, .14) 60%,
            rgba(15, 23, 42, .28) 100%
        );
    }

    .slide-container {
        padding: clamp(18px, 2.5vw, 28px);
        padding-bottom: clamp(18px, 2.5vw, 28px);
    }

    .content {
        max-width: min(420px, 46%);
        padding-right: 0;
    }

    .content h2 {
        font-size: clamp(1.15rem, 1.6vw, 1.5rem);
        -webkit-line-clamp: unset;
        display: block;
        overflow: visible;
    }

    .content p {
        max-width: 360px;
        font-size: .875rem;
        line-height: 1.6;
        -webkit-line-clamp: unset;
        display: block;
        overflow: visible;
    }

    .top-ad {
        top: clamp(14px, 2.5vw, 24px);
        right: clamp(14px, 2.5vw, 24px);
        font-size: .7rem;
        padding: 5px 12px;
    }

    .buy-btn {
        min-height: 38px;
        padding: 9px 24px;
        font-size: .8125rem;
    }

    .nav {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .carousel-dots {
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        bottom: clamp(18px, 2.5vw, 28px);
    }

    .carousel-dot {
        width: 7px;
        height: 7px;
        background: rgba(219, 234, 254, .4);
    }

    .home-carousel-wrap {
        margin: 0 0 40px;
    }
}
