/**
 * Frontend Styles for WooCommerce Product Video Slider (Story / Reels Vertical Format)
 */

.wc-pvs-section {
    margin: 40px 0 30px 0;
    padding: 20px 0;
    clear: both;
    position: relative;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
}

.wc-pvs-section-header {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wc-pvs-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wc-pvs-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: #e50914;
    border-radius: 2px;
}

/* Swiper Container */
.wc-pvs-swiper {
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 10px 4px 42px 4px !important;
    z-index: 1;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.wc-pvs-swiper .swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    transition-property: transform;
    box-sizing: content-box;
}

.wc-pvs-swiper .swiper-slide {
    flex-shrink: 0;
    height: auto;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1), opacity 0.35s ease;
    display: block;
    box-sizing: border-box;
}

/* Story / Reels Card (Vertical 9:16 Ratio) */
.wc-pvs-card {
    position: relative;
    background: #0d0e12;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 9 / 16; /* Story & Reels vertical ratio */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wc-pvs-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

/* Video Wrapper */
.wc-pvs-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-pvs-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Vertical story videos fill 100% of card seamlessly */
    display: block;
    background: #000;
}

/* Poster and Play Overlay */
.wc-pvs-overlay {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.2);
    transition: opacity 0.35s ease, visibility 0.35s ease;
    z-index: 2;
}

/* Subtle top and bottom gradients on poster */
.wc-pvs-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        transparent 30%,
        transparent 60%,
        rgba(0, 0, 0, 0.75) 100%
    );
    pointer-events: none;
}

.wc-pvs-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Story Play Button */
.wc-pvs-play-btn {
    position: relative;
    z-index: 3;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #111111;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, color 0.2s ease;
    padding: 0;
}

.wc-pvs-play-btn svg {
    margin-right: -3px; /* Optically centered play triangle */
    fill: currentColor;
    width: 28px;
    height: 28px;
}

.wc-pvs-card:hover .wc-pvs-play-btn {
    transform: scale(1.14);
    background: #ffffff;
    color: #e50914;
}

/* Story Badge in Top Corner */
.wc-pvs-story-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wc-pvs-card.is-playing .wc-pvs-story-badge {
    opacity: 0;
}

/* Story Bottom Title Overlay */
.wc-pvs-video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 34px 14px 14px 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 65%, transparent 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    z-index: 3;
    pointer-events: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide title and badge while video is actively playing with native controls */
.wc-pvs-card.is-playing .wc-pvs-video-title {
    opacity: 0;
    visibility: hidden;
}

/* Navigation Buttons (Swiper Prev / Next) */
.wc-pvs-swiper .swiper-button-prev,
.wc-pvs-swiper .swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    padding: 0;
}

.wc-pvs-swiper .swiper-button-prev:after,
.wc-pvs-swiper .swiper-button-next:after {
    display: none !important;
}

.wc-pvs-swiper .swiper-button-prev {
    right: -6px;
    left: auto;
}

.wc-pvs-swiper .swiper-button-next {
    left: -6px;
    right: auto;
}

.wc-pvs-swiper .swiper-button-prev:hover,
.wc-pvs-swiper .swiper-button-next:hover {
    background: #1a1a1a;
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
}

.wc-pvs-swiper .swiper-button-disabled {
    opacity: 0.2 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Pagination Dots */
.wc-pvs-swiper .swiper-pagination {
    position: absolute;
    bottom: 8px !important;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.wc-pvs-swiper .swiper-pagination-bullet {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999999;
    opacity: 0.35;
    margin: 0 4px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.wc-pvs-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    background: #e50914;
    width: 22px;
    border-radius: 4px;
}

/* Mobile specific styling: 1 story centered, 25% of left & right visible */
@media (max-width: 639px) {
    .wc-pvs-swiper {
        overflow: visible;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .wc-pvs-section {
        overflow: hidden;
    }

    .wc-pvs-slide {
        opacity: 0.55;
        transform: scale(0.92);
    }

    .wc-pvs-slide.swiper-slide-active {
        opacity: 1;
        transform: scale(1);
    }

    .wc-pvs-swiper .swiper-button-prev,
    .wc-pvs-swiper .swiper-button-next {
        display: none !important;
    }
}
