.video-reels-container,
.video-reels-wrapper,
.rivax-posts-carousel-wrapper,
.video-reels-wrapper .swiper,
.video-reels-wrapper .swiper-wrapper {
    min-width: 0;
}

.video-reels-wrapper.layout-grid {
    display: grid;
}

.reel-link {
    display: block;
    text-decoration: none;
}

.reel-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #111;
}

.reel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reel-play-icon {
    display: none;
}

.video-reels-container .carousel-nav-prev.swiper-button-disabled,
.video-reels-container .carousel-nav-next.swiper-button-disabled {
    display: none;
}

.video-reels-container .carousel-nav-prev,
.video-reels-container .carousel-nav-next {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #111;
}

.video-reels-container .carousel-nav-prev {
    left: 10px;
}

.video-reels-container .carousel-nav-next {
    right: 10px;
}

.video-reels-container .carousel-nav-prev i,
.video-reels-container .carousel-nav-next i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.reel-badge {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    font-size: 11px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.reel-thumb::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, .8), rgba(0, 0, 0, 0));
    pointer-events: none;
    z-index: 1;
}

.reel-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px;
    font-size: 13px;
    line-height: 1.4;
    z-index: 2;
}

/* Popup */
.video-reels-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.video-reels-popup.active {
    display: flex;
}

body.reels-popup-open {
    overflow: hidden;
}

.video-reels-popup .popup-inner {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 9 / 16;
    max-height: 90vh;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-reels-popup .popup-media {
    width: 100%;
    height: 100%;
}

.video-reels-popup .popup-media video,
.video-reels-popup .popup-media iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 0;
}

.video-reels-popup .popup-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px;
    padding-bottom: 62px;
    color: #fff;
    font-size: 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, .75), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.video-reels-popup .popup-close {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 3;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 0;
    outline: 0;
    -webkit-appearance: none;
    appearance: none;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.video-reels-popup .popup-close svg {
    display: block;
    pointer-events: none;
}

.video-reels-popup .popup-nav-stack {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-reels-popup .popup-nav {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
}

@media (max-width: 767px) {
    .video-reels-popup .popup-inner {
        max-width: 92vw;
    }

    .video-reels-popup .popup-close,
    .video-reels-popup .popup-nav-stack {
        left: 12px;
    }

    .video-reels-popup .popup-close {
        top: 12px;
    }
}
