/* Lazy swiper CLS: skeleton, reserve heights, loaded state */
.bss-lazy-swiper:not(.bss-lazy-loaded) {
    overflow: hidden;
    contain: layout;
    box-sizing: border-box;
    min-height: var(--bss-swiper-reserve-mobile, 270px);
    max-height: var(--bss-swiper-reserve-mobile, 270px);
    height: var(--bss-swiper-reserve-mobile, 270px);
}

@media only screen and (min-width: 992px) {
    .bss-lazy-swiper:not(.bss-lazy-loaded) {
        min-height: var(--bss-swiper-reserve-md, 370px);
        max-height: var(--bss-swiper-reserve-md, 370px);
        height: var(--bss-swiper-reserve-md, 370px);
    }
}

@media only screen and (min-width: 1200px) {
    .bss-lazy-swiper:not(.bss-lazy-loaded) {
        min-height: var(--bss-swiper-reserve, 462px);
        max-height: var(--bss-swiper-reserve, 462px);
        height: var(--bss-swiper-reserve, 462px);
    }
}

.bss-lazy-swiper.bss-lazy-loaded {
    overflow: visible;
    contain: none;
    height: auto;
    max-height: none;
    min-height: 0;
}

.bss-swiper-skeleton {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    padding: 0;
    pointer-events: none;
    gap: 12px;
}

.bss-lazy-swiper:not(.bss-lazy-loaded) .bss-swiper-skeleton {
    overflow: hidden;
}

.bss-swiper-skeleton__banner {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border-radius: 6px;
}

.bss-swiper-skeleton__content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    box-sizing: border-box;
}

.bss-swiper-skeleton__content-left {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.bss-swiper-skeleton__content-right {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bss-swiper-skeleton__line {
    border-radius: 4px;
}

.bss-swiper-skeleton__line--heading {
    width: 70%;
    height: 28px;
}

.bss-swiper-skeleton__line--subtitle {
    width: 55%;
    height: 18px;
}

.bss-swiper-skeleton__line--button {
    width: 120px;
    height: 36px;
    margin-top: 8px;
}

.bss-swiper-skeleton__circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
}

@media only screen and (min-width: 992px) {
    .bss-swiper-skeleton__circle {
        width: 280px;
        height: 280px;
    }

    .bss-swiper-skeleton__line--heading {
        height: 36px;
    }
}

@media only screen and (min-width: 1200px) {
    .bss-swiper-skeleton__circle {
        width: 360px;
        height: 360px;
    }

    .bss-swiper-skeleton__line--heading {
        height: 48px;
    }
}

.bss-swiper-skeleton__pagination {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-bottom: 8px;
}

.bss-swiper-skeleton__pagination span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bss-skeleton-base, #e0e0e0);
}

/* Shimmer: compositor-friendly transform sweep instead of background-position repaints.
   Colors are theme-overridable via --bss-skeleton-base / --bss-skeleton-highlight. */
.bss-swiper-skeleton__banner,
.bss-swiper-skeleton__line,
.bss-swiper-skeleton__circle {
    position: relative;
    overflow: hidden;
    background: var(--bss-skeleton-base, #ececec);
}

.bss-swiper-skeleton__banner::after,
.bss-swiper-skeleton__line::after,
.bss-swiper-skeleton__circle::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 60%;
    background: linear-gradient(90deg, transparent, var(--bss-skeleton-highlight, #f5f5f5), transparent);
    animation: bss-skeleton-sweep 1.4s ease-in-out infinite;
}

@keyframes bss-skeleton-sweep {
    to { transform: translateX(280%); }
}

@media (prefers-reduced-motion: reduce) {
    .bss-swiper-skeleton__banner::after,
    .bss-swiper-skeleton__line::after,
    .bss-swiper-skeleton__circle::after {
        animation: none;
    }
}

/* Content fade-in: hide un-initialized slider markup until Swiper has laid out */
.bss-lazy-swiper.bss-swiper-content-pending > :not(.bss-swiper-skeleton) {
    opacity: 0;
}

.bss-lazy-swiper.bss-swiper-content-ready > :not(.bss-swiper-skeleton) {
    opacity: 1;
    transition: opacity 0.2s ease-out;
}

/* Cross-fade: the skeleton stays as an overlay above incoming content, then fades out */
.bss-lazy-swiper.bss-skeleton-cover {
    position: relative;
}

.bss-swiper-skeleton--overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    z-index: 2;
    opacity: 1;
    transition: opacity 0.25s ease-out;
    background: var(--bss-skeleton-cover-bg, #fff);
}

.bss-swiper-skeleton--fade {
    opacity: 0;
}
