/* GBP Carousel Banner — widget styles. Swiper-bundle.css is loaded
   separately (registered handle gbp-cb-swiper). */

.gbp-cb {
    position: relative;
    width: 100%;
}

.gbp-cb__swiper {
    width: 100%;
    overflow: hidden;
}

/* ── Slide card ────────────────────────────────────────── */

.gbp-cb-slide {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 21 / 9;
    overflow: hidden;
}

.gbp-cb-slide__link {
    position: absolute;
    inset: 0;
    z-index: 4;
    text-decoration: none;
    color: inherit;
}

.gbp-cb-slide__image {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    display: block;
}

/* ── Image Fit: Contain ──────────────────────────────────
   Slide drops its fixed aspect-ratio box and grows to the
   image's natural height, capped by --gbp-cb-contain-max
   (the "Max Height (Contain)" control) and never exceeding
   the image's own height (--gbp-cb-nat-h, set per slide).
   When clamped, object-fit: contain letterboxes the image
   so it is never cropped. Cover mode is left untouched, so
   existing carousels render exactly as before. */

.gbp-cb--fit-contain .gbp-cb-slide {
    aspect-ratio: auto !important;
    height: auto !important;
}

.gbp-cb--fit-contain .gbp-cb-slide__image {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    max-height: min( var(--gbp-cb-contain-max, 600px), var(--gbp-cb-nat-h, 100000px) );
    object-fit: contain;
    object-position: center;
}

.gbp-cb-slide__gradient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
    z-index: 1;
}

/* ── Overlay (caption block) ──────────────────────────── */

.gbp-cb-slide__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 32px;
    color: #fff;
    pointer-events: none; /* Let clicks pass through to .gbp-cb-slide__link when present */
}

.gbp-cb-slide__overlay > * {
    pointer-events: auto;
}

.gbp-cb--overlay-bottom-left .gbp-cb-slide__overlay {
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
}

.gbp-cb--overlay-bottom-center .gbp-cb-slide__overlay {
    justify-content: flex-end;
    align-items: center;
    text-align: center;
}

.gbp-cb--overlay-bottom-right .gbp-cb-slide__overlay {
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
}

.gbp-cb--overlay-center .gbp-cb-slide__overlay {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.gbp-cb--overlay-top-left .gbp-cb-slide__overlay {
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
}

.gbp-cb-slide__heading {
    margin: 0;
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
    line-height: 1.25;
    font-weight: 600;
    max-width: 60ch;
}

.gbp-cb-slide__subheading {
    margin: 0;
    font-size: clamp(0.95rem, 1.4vw, 1.05rem);
    line-height: 1.5;
    max-width: 60ch;
}

.gbp-cb-slide__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    padding: 12px 24px;
    background-color: #6c4cf1;
    color: #fff;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.gbp-cb-slide__button:hover,
.gbp-cb-slide__button:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* ── Arrows ────────────────────────────────────────────── */

.gbp-cb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #6c4cf1;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, filter 0.15s ease, opacity 0.2s ease;
}

.gbp-cb-arrow:hover,
.gbp-cb-arrow:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-50%) scale(1.04);
    outline: none;
}

.gbp-cb-arrow svg {
    width: 60%;
    height: 60%;
    fill: #fff;
}

.gbp-cb-arrow--prev { left: -28px; }
.gbp-cb-arrow--next { right: -28px; }

.gbp-cb-arrow.swiper-button-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* ── Pagination ────────────────────────────────────────── */

.gbp-cb-pagination {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.gbp-cb-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.gbp-cb-pagination .swiper-pagination-bullet-active {
    width: 28px;
    border-radius: 5px;
    background-color: #fff;
}

.gbp-cb-pagination.swiper-pagination-fraction {
    color: #fff;
    font-weight: 600;
}

.gbp-cb-pagination.swiper-pagination-progressbar {
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.25);
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 1024px) {
    .gbp-cb-arrow {
        width: 44px;
        height: 44px;
    }
    .gbp-cb-arrow--prev { left: 8px; }
    .gbp-cb-arrow--next { right: 8px; }
    .gbp-cb-slide__overlay { padding: 24px; }
}

@media (max-width: 600px) {
    .gbp-cb-arrow {
        width: 38px;
        height: 38px;
    }
    .gbp-cb-arrow--prev { left: 8px; }
    .gbp-cb-arrow--next { right: 8px; }
    .gbp-cb-slide__overlay { padding: 18px; gap: 6px; }
    .gbp-cb-pagination { bottom: 10px; }
}

/* ── Fade effect: stack slides so the cross-fade works ── */

.gbp-cb__swiper.swiper-fade .swiper-slide {
    pointer-events: none;
}
.gbp-cb__swiper.swiper-fade .swiper-slide-active {
    pointer-events: auto;
}

/* ── Scroll effect: continuous marquee needs linear motion so the
   zero-delay autoplay glides instead of easing on every slide. ── */

.gbp-cb--scroll .swiper-wrapper {
    transition-timing-function: linear !important;
}

