/**
 * Rosila Shoppable Video Reels Stylesheet
 * Ultra-Smooth 360° Infinite Buffer Carousel + Split Luxury Modal
 */

/* ==========================================================================
   1. SECTION & HEADER
   ========================================================================== */
.afeem-shoppable-reels-section {
    padding: 75px 0 65px;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.afeem-shoppable-reels-section.context-pdp {
    padding: 55px 0 45px;
    border-top: 1px solid var(--rosila-border, #e8ecf1);
    background: #fafbfc;
}

.afeem-reels-header {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 35px;
}

.afeem-reels-header-centered {
    justify-content: center;
    text-align: center;
}

.afeem-reels-title-box {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.afeem-reels-title-box .afeem-reels-subtitle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--rosila-accent, #007D71);
    margin-bottom: 8px;
}

.afeem-reels-title-box .afeem-reels-subtitle i {
    font-size: 14px;
}

.afeem-reels-title {
    font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
    font-size: 38px;
    font-weight: 600;
    color: var(--rosila-primary, #121417);
    line-height: 1.2;
    margin: 0;
    text-align: center;
}

.afeem-reels-nav-controls {
    display: none;
}

.afeem-reel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 30;
}

.afeem-reel-nav-btn.prev {
    left: 20px;
}

.afeem-reel-nav-btn.next {
    right: 20px;
}

.afeem-reel-nav-btn:hover {
    background: var(--rosila-accent, #007D71);
    border-color: var(--rosila-accent, #007D71);
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 10px 28px rgba(0, 125, 113, 0.35);
}

.afeem-reel-nav-btn:active {
    transform: translateY(-50%) scale(0.96);
}

@media (max-width: 768px) {
    .afeem-reel-nav-btn {
        width: 40px;
        height: 40px;
    }
    .afeem-reel-nav-btn.prev {
        left: 10px;
    }
    .afeem-reel-nav-btn.next {
        right: 10px;
    }
}

/* ==========================================================================
   2. 360° CIRCULAR VIEWPORT & TRACK
   ========================================================================== */
.afeem-reels-viewport-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.afeem-reels-viewport {
    width: 100%;
    overflow-x: auto;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    padding: 10px 0 25px;
}

.afeem-reels-viewport::-webkit-scrollbar {
    display: none;
}

.afeem-reels-viewport.is-dragging {
    cursor: grabbing !important;
}

.afeem-reels-track {
    display: flex;
    width: max-content;
    align-items: stretch;
    will-change: transform;
}

.afeem-reels-set {
    display: flex;
    gap: 22px;
    padding: 0 11px;
}

/* ==========================================================================
   3. 9:16 VERTICAL REEL CARDS
   ========================================================================== */
.afeem-reel-card {
    width: 255px;
    height: 450px;
    flex-shrink: 0;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #000000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
    cursor: pointer;
}

.afeem-reel-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
}

.afeem-reel-media {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.afeem-reel-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #0f172a;
}

/* Floating Product Badge */
.afeem-reel-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    z-index: 4;
    overflow: visible;
}

.afeem-reel-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.afeem-badge-pulse {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #ffffff;
    animation: afeemPulse 1.8s infinite;
}

@keyframes afeemPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Centered Play Trigger Icon */
.afeem-reel-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3;
    pointer-events: none;
}

.afeem-reel-play-icon svg {
    margin-left: 3px;
}

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

/* Bottom Dark Vignette Gradient & Meta Overlay */
.afeem-reel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 55px 14px 14px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.45) 35%, rgba(0, 0, 0, 0.92) 100%);
    z-index: 4;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.afeem-reel-card-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    color: #f8fafc;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Glassmorphism Product Card Pill */
.afeem-reel-product-pill {
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.afeem-reel-card:hover .afeem-reel-product-pill {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
}

.afeem-pill-left {
    flex: 1;
    min-width: 0;
}

.afeem-pill-name {
    font-size: 11.5px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.afeem-pill-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.afeem-pill-price {
    font-size: 12.5px;
    font-weight: 700;
    color: #facc15;
}

.afeem-pill-price del,
.afeem-pill-price .woocommerce-Price-currencySymbol {
    font-weight: 700;
}

.afeem-pill-price del {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    margin-right: 4px;
}

.afeem-pill-discount {
    font-size: 9.5px;
    font-weight: 700;
    background: #ef4444;
    color: #ffffff;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.2;
}

.afeem-pill-buy-btn {
    background: var(--rosila-accent, #007D71);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
}

.afeem-pill-buy-btn:hover {
    background: var(--rosila-accent-hover, #00645a);
    transform: scale(1.04);
}

/* ==========================================================================
   4. FULL-SCREEN SPLIT SHOPPABLE LIGHTBOX MODAL
   ========================================================================== */
.shoppable-reel-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
}

.shoppable-reel-modal.active {
    visibility: visible;
    opacity: 1;
}

.shoppable-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 11, 16, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.shoppable-modal-container {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 920px;
    height: 85vh;
    max-height: 640px;
    background: #ffffff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    transform: scale(0.94);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.shoppable-reel-modal.active .shoppable-modal-container {
    transform: scale(1);
}

/* Modal Close Button */
.shoppable-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    backdrop-filter: blur(6px);
    transition: background 0.2s, transform 0.2s;
}

.shoppable-modal-close:hover {
    background: #0f172a;
    transform: scale(1.08);
}

/* Floating Modal Navigation (Prev / Next) */
.shoppable-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.shoppable-modal-nav:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.1);
    color: var(--rosila-accent, #007D71);
}

.shoppable-modal-nav.prev {
    left: 14px;
}

.shoppable-modal-nav.next {
    left: calc(42% - 24px); /* Positioned right on the border between video and product */
}

/* Modal Split Columns */
.shoppable-modal-split {
    display: grid;
    grid-template-columns: 42% 58%;
    width: 100%;
    height: 100%;
}

/* Left Column: HD Video Player */
.shoppable-modal-video-col {
    background: #000000;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.shoppable-video-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

#shoppable-modal-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shoppable-video-header-bar {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.shoppable-control-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.shoppable-control-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.08);
}

.shoppable-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.shoppable-play-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.shoppable-video-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.shoppable-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--rosila-accent, #007D71);
    transition: width 0.1s linear;
}

/* Right Column: Interactive Shoppable Product Card */
.shoppable-modal-product-col {
    height: 100%;
    overflow-y: auto;
    background: #ffffff;
    padding: 34px 34px 28px;
    display: flex;
    flex-direction: column;
}

.shoppable-product-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.shoppable-brand-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--rosila-accent, #007D71);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.live-pulse-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #10b981;
    font-weight: 700;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 12px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: afeemPulse 1.5s infinite;
}

.shoppable-prod-title {
    font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
    font-size: 26px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 8px 0;
}

.shoppable-prod-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.shoppable-prod-rating .stars {
    color: #f59e0b;
    font-size: 13px;
    letter-spacing: 1px;
}

.shoppable-prod-rating .rating-text {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 600;
}

.shoppable-prod-thumb-box {
    width: 78px;
    height: 78px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 6px;
    background: #f8fafc;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shoppable-prod-thumb-box img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.shoppable-prod-price-box {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
}

.shoppable-prod-price-box .current-price {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.shoppable-prod-price-box .regular-price {
    font-size: 15px;
    color: #94a3b8;
    text-decoration: line-through;
}

.shoppable-prod-price-box .discount-pill {
    font-size: 11px;
    font-weight: 700;
    background: #fee2e2;
    color: #dc2626;
    padding: 2px 7px;
    border-radius: 6px;
}

.shoppable-size-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.shoppable-size-selector .selector-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
}

.size-pills {
    display: flex;
    gap: 8px;
}

.size-pill {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.size-pill.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.shoppable-prod-caption {
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
    margin-bottom: 22px;
}

.shoppable-actions-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.shoppable-add-to-bag-btn {
    width: 100%;
    background: var(--rosila-accent, #007D71);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.shoppable-add-to-bag-btn:hover {
    background: var(--rosila-accent-hover, #00645a);
}

.shoppable-add-to-bag-btn:active {
    transform: scale(0.98);
}

.shoppable-view-details-btn {
    width: 100%;
    background: #f1f5f9;
    color: #1e293b;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.shoppable-view-details-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.shoppable-trust-row {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
    margin-top: auto;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.shoppable-trust-row .trust-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.shoppable-trust-row .trust-item i {
    color: var(--rosila-accent, #007D71);
}

/* Toast Notification */
.shoppable-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000000;
}

.shoppable-toast.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   5. MOBILE RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .shoppable-modal-container {
        width: 95%;
        height: 90vh;
        max-height: 90vh;
    }

    .shoppable-modal-nav.next {
        left: auto;
        right: 14px;
    }
}

@media (max-width: 768px) {
    .afeem-shoppable-reels-section {
        padding: 50px 0 40px;
    }

    .afeem-reels-header {
        margin-bottom: 20px;
    }

    .afeem-reels-title {
        font-size: 26px;
    }

    .afeem-reel-card {
        width: 210px;
        height: 375px;
        border-radius: 16px;
    }

    .afeem-reel-card-title {
        font-size: 12px;
    }

    /* Modal Mobile Layout */
    .shoppable-modal-container {
        width: 100%;
        height: 95vh;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        top: auto;
        transform: translateY(100%);
    }

    .shoppable-reel-modal.active .shoppable-modal-container {
        transform: translateY(0);
    }

    .shoppable-modal-split {
        grid-template-columns: 1fr;
        grid-template-rows: 52% 48%;
    }

    .shoppable-modal-product-col {
        padding: 20px 20px 24px;
    }

    .shoppable-prod-title {
        font-size: 20px;
    }

    .shoppable-modal-nav.next {
        left: auto;
        right: 14px;
        top: 26%;
    }

    .shoppable-modal-nav.prev {
        top: 26%;
    }
}
