/* ==========================================================================
   Shoppable Reels Gallery Styles
   ========================================================================== */

.shoppable-reels-container {
    padding: 20px 0;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

.shoppable-reels-gallery {
    padding: 20px 0;
}

.shoppable-reel-card {
    width: 250px;
    height: auto;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    position: relative;
    background: #0f172a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.shoppable-reel-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.reel-thumbnail {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Subtle dark gradient overlay at bottom of card */
.reel-thumbnail::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.gallery-preview-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.85;
    pointer-events: none;
    z-index: 3;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.shoppable-reel-card:hover .play-icon-overlay {
    transform: translate(-50%, -50%) scale(1.12);
    opacity: 1;
}

/* Inner Label Badges */
.reel-inner-label {
    position: absolute;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 5px rgba(0,0,0,0.85);
    z-index: 4;
    letter-spacing: 0.4px;
    pointer-events: none;
}

.shoppable-reel-card.has-product .reel-inner-label {
    bottom: 85px;
    left: 14px;
    right: 14px;
    font-size: 0.95rem;
}

.shoppable-reel-card.no-product .reel-inner-label {
    top: 14px;
    left: 14px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.25);
}

/* Title overlay when no product is attached */
.reel-title-overlay {
    position: absolute;
    bottom: 14px;
    left: 14px;
    right: 14px;
    z-index: 4;
    pointer-events: none;
}

.reel-title-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-shadow: 0 2px 6px rgba(0,0,0,0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Glassmorphism Product Card on Gallery Preview */
.product-glass-card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    margin: 10px;
    padding: 9px 12px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    z-index: 5;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.product-thumb img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.product-info {
    flex: 1;
    overflow: hidden;
}

.product-title {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.25;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.product-price {
    font-size: 12px;
    color: #1e293b;
    font-weight: 600;
    margin-top: 2px;
}

.product-price del {
    color: #64748b;
    margin-left: 4px;
    font-weight: 400;
}

.product-add-action {
    flex-shrink: 0;
}

.add-btn-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #0f172a;
    color: #ffffff !important;
    border-radius: 50%;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.18);
    transition: transform 0.2s ease, background 0.2s ease;
}

.add-btn-circle:hover {
    transform: scale(1.1);
    background: #2563eb;
    color: #ffffff !important;
}

/* ==========================================================================
   Full-Screen Lightbox Experience
   ========================================================================== */

.reels-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

/* Prominent Global Close / Exit Button */
.reels-global-close {
    position: fixed;
    top: 22px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000005;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding: 0;
    outline: none;
}

.reels-global-close:hover {
    background: #ffffff;
    color: #0f172a;
    transform: scale(1.08) rotate(90deg);
    box-shadow: 0 6px 24px rgba(255, 255, 255, 0.3);
}

.reels-global-close svg {
    display: block;
    stroke: currentColor;
}

/* Global Up / Down Navigation Controls */
.reels-global-nav {
    position: fixed;
    left: calc(50% + 265px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 10000002;
}

.reels-global-nav .nav-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    padding: 0;
    outline: none;
}

.reels-global-nav .nav-btn:hover:not(.is-disabled) {
    background: #ffffff;
    color: #0f172a;
    transform: scale(1.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.reels-global-nav .nav-btn:active:not(.is-disabled) {
    transform: scale(0.95);
}

.reels-global-nav .nav-btn.is-disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

.reels-global-nav .nav-btn svg {
    display: block;
    stroke: currentColor;
}

/* Swiper Container */
.lightbox-swiper {
    width: 100%;
    height: 100%;
}

.lightbox-slide {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: transparent;
}

/* Centered Vertical Reel Container */
.lightbox-video-container {
    width: 100%;
    height: 100%;
    max-width: 480px;
    max-height: 94vh;
    position: relative;
    overflow: hidden;
    background: #000000;
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.lightbox-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

/* Top Progress Bar */
.reels-progress-bar-container {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    z-index: 100;
    overflow: hidden;
    pointer-events: none;
}

.reels-progress-bar {
    height: 100%;
    width: 0%;
    background: #ffffff;
    transition: width 0.1s linear;
}

/* In-player Top Controls */
.reels-top-controls {
    position: absolute;
    top: 22px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 105;
}

.action-btn {
    cursor: pointer;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    color: #ffffff;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.08);
}

.action-btn svg {
    display: block;
}

/* Side Actions (Share) */
.reels-side-actions {
    position: absolute;
    right: 14px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 95;
}

.action-circle {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.action-circle:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: scale(1.1);
}

.action-circle svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Lightbox Overlay Content (Product / Caption) */
.lightbox-overlay-content {
    position: absolute;
    bottom: 18px;
    left: 12px;
    right: 68px; /* Leave breathing room for side share button */
    z-index: 95;
    pointer-events: auto;
}

.lightbox-overlay-content .product-glass-card {
    margin: 0;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

.lightbox-overlay-content.lightbox-non-product {
    bottom: 24px;
    left: 14px;
    right: 68px;
}

.reel-caption-card {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 14px;
    border-radius: 14px;
    display: inline-block;
    max-width: 100%;
}

.reel-caption-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reel-caption-text {
    margin: 0;
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.35;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

/* Feedback Toast Notification (Sound On / Muted popup) */
.reels-toast-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 120;
    pointer-events: none;
}

.reels-toast-msg {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    animation: reelsToastPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reelsToastPop {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1080px) {
    .reels-global-nav {
        left: auto;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .shoppable-reel-card {
        width: 165px;
        border-radius: 14px;
    }

    .lightbox-video-container {
        max-height: 100vh;
        border-radius: 0;
    }

    .reels-global-close {
        top: 14px;
        right: 14px;
        width: 40px;
        height: 40px;
    }

    .reels-global-nav {
        right: 12px;
        gap: 12px;
    }

    .reels-global-nav .nav-btn {
        width: 40px;
        height: 40px;
    }

    .lightbox-overlay-content {
        left: 10px;
        right: 60px;
        bottom: 14px;
    }

    .reels-side-actions {
        bottom: 110px;
        right: 10px;
    }
}
