/**
 * Slideshow Banner Widget Styles
 * 复刻 water.viomi.com Shopify slideshow section 的视觉效果
 */

.viomi-slideshow-widget {
    --vsb-ratio: 40.98360655737705%;
    --vsb-ratio-mobile: 75%;
    --vsb-radius: clamp(0.625rem, 1.053vw, 1.25rem);
    --vsb-content-padding: clamp(1rem, 2.105vw, 2.25rem);
}

.vsb-container {
    position: relative;
}

/* 轮播容器：圆角 + 裁切，对应 .page-width .slideshow */
.vsb-swiper {
    border-radius: var(--vsb-radius);
    overflow: hidden;
    transform: translateZ(0);
}

/* 比例自适应横幅，对应 .banner.media--adapt */
.vsb-banner {
    position: relative;
    height: 0;
    padding-bottom: var(--vsb-ratio);
    overflow: hidden;
}

@media screen and (max-width: 767px) {
    .vsb-banner {
        padding-bottom: var(--vsb-ratio-mobile);
    }
}

.vsb-banner picture,
.vsb-banner img {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vsb-banner img {
    object-fit: cover;
}

/* 图片 zoom-out 入场动画，对应 animate-element[data-animate="zoom-out"] */
.vsb-has-zoom .vsb-banner img {
    will-change: transform;
}

.vsb-has-zoom .vsb-banner.vsb-zooming img {
    animation: vsbZoomOut 1.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes vsbZoomOut {
    from { transform: scale(1.1); }
    to   { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .vsb-has-zoom .vsb-banner.vsb-zooming img {
        animation: none;
    }
}

/* 渐变覆盖层，对应 .banner__overlay */
.vsb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 底部覆盖层，对应 .page-width.absolute.bottom-0 > .slideshow-content */
.vsb-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    padding: var(--vsb-content-padding);
    pointer-events: none;
    color: #ffffff;
}

/* 文字层：堆叠 + 交叉淡入淡出，对应 slideshow-words */
.vsb-words {
    display: grid;
}

.vsb-word {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.vsb-word[aria-current="true"] {
    opacity: 1;
    visibility: visible;
    transition-delay: 0.25s;
}

.vsb-subheading {
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}

/* 对应 .slideshow-style2-content .title-xl */
.vsb-heading {
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 500;
    color: inherit;
    margin: 0 0 1rem;
}

/* 对应 .slideshow-description */
.vsb-desc {
    max-width: 430px;
    font-size: 1.125rem;
    line-height: 1.5;
}

.vsb-desc-second {
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* 按钮容器，对应 .slideshow-style2-box */
.vsb-box {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-top: 1.5rem;
}

.vsb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    padding: 0.75rem 2rem;
    border-radius: 3.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.vsb-button:hover {
    opacity: 0.85;
}

/* 控制行：箭头 + 圆点，对应 .slideshow-dots */
.vsb-dots-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

@media screen and (min-width: 640px) {
    .vsb-dots-row.vsb-has-divider {
        margin-top: 2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        border-top-color: color-mix(in srgb, currentColor 12%, transparent);
    }

    .vsb-dots-row .vsb-dots {
        margin-top: clamp(1rem, 2.105vw, 2.5rem);
        margin-bottom: -0.375rem;
    }
}

/* 长箭头按钮：仅桌面显示，圆形容器保证主题 hover 背景为正圆且 hover 偏移不出圆 */
.vsb-arrow {
    display: none;
    pointer-events: auto;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    min-width: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    overflow: hidden;
    padding: 0;
    margin: 0;
    color: inherit;
    cursor: pointer;
    line-height: 0;
}

@media screen and (min-width: 768px) {
    .vsb-arrow {
        display: flex;
    }
}

.vsb-arrow svg {
    width: clamp(1.75rem, 1.85vw, 2.125rem);
    height: auto;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.vsb-prev:hover svg {
    transform: translateX(-3px);
}

.vsb-next:hover svg {
    transform: translateX(3px);
}

/* 圆点分页，对应 .flickity-page-dots */
.vsb-dots {
    display: flex;
    align-items: center;
    pointer-events: auto;
    margin: 0 -0.59375rem;
}

.vsb-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: transparent;
    border: 0;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    color: inherit;
}

.vsb-dot::before {
    content: "";
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: currentColor;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.vsb-dot[aria-current="true"]::before {
    background-color: transparent;
    box-shadow: 0 0 0 2px currentColor;
}

.vsb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
