/* Carousel wrapper styles */
.pw-carousel {
    position: relative;
}

.pw-carousel-wrapper {
    position: relative;
}

/* ── Header row ─────────────────────────────────────────── */
.pw-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Title sits on the left; grows to fill available space */
.pw-carousel-title {
    flex: 1 1 auto;
    min-width: 0; /* prevent overflow pushing arrows out */
}

/* Top-right navigation sits flush right */
.pw-carousel-navigation--top {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0; /* override any global margin */
}

/* ── Embla viewport ─────────────────────────────────────── */
.pw-carousel-swiper {
    overflow: hidden;
    box-sizing: border-box;
}

/* ── Embla container ────────────────────────────────────── */
.swiper-wrapper {
    display: flex;
    align-items: stretch;
    box-sizing: border-box;
    transition-timing-function: ease-in-out;
    /* Default: apply gap offset (negative margin) */
    margin-left: calc(var(--gap, 20px) * -1);
}

/* No-offset mode: remove negative margin so slides sit flush */
.pw-carousel[data-no-offset="true"] .swiper-wrapper {
    margin-left: 0;
}

/* ── Individual slides ──────────────────────────────────── */
.swiper-slide {
    height: auto;
    min-width: 0;
    padding-left: var(--gap, 20px);
}

/* No-offset mode: remove left padding from slides too */
.pw-carousel[data-no-offset="true"] .swiper-slide {
    padding-left: 0;
}

/* Mobile: all slides 90% width */
@media (max-width: 767px) {
    .swiper-slide {
        width: 90% !important;
        flex: 0 0 90%;
    }
}

/* Tablet: nudge narrow slides wider */
@media (min-width: 768px) and (max-width: 1023px) {
    .swiper-slide[style*="width: 25%"],
    .swiper-slide[style*="width:25%"] {
        width: 30% !important;
        flex: 0 0 30%;
    }

    .swiper-slide[style*="width: 33.33%"],
    .swiper-slide[style*="width:33.33%"] {
        width: 40% !important;
        flex: 0 0 40%;
    }

    .swiper-slide[style*="width: 50%"],
    .swiper-slide[style*="width:50%"] {
        width: 60% !important;
        flex: 0 0 60%;
    }
}

/* ── Below navigation ───────────────────────────────────── */
.pw-carousel-navigation--below {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* ── Arrow buttons (shared) ─────────────────────────────── */
.pw-carousel-arrow {
    border: 0;
    background: transparent;
    padding: 0.5rem;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.pw-carousel-arrow:hover {
    opacity: 0.7;
}

.pw-carousel-arrow:disabled,
.pw-carousel-arrow.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.pw-carousel-arrow img {
    max-width: 80px;
    max-height: 80px;
}

.pw-carousel-arrow span {
    font-size: 1.5rem;
    line-height: 1;
}
