/* ===== INFLUENCER VIDEO SLIDER - SLIDING WINDOW APPROACH ===== */
/* ใช้ prefix "influ-vdo-" เพื่อไม่ให้ซ้ำกับ CSS อื่น */

.influ-vdo-section {
    padding: 120px 0;
    background: #ffffff;
    overflow: hidden; /* ซ่อน videos ที่อยู่นอกจอ */
    position: relative;
}

.influ-vdo-section-title {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 64px;
    font-weight: 600;
    color: #333;
    margin: 0 0 80px 0;
    text-align: center;
    line-height: 1.2;
}

/* Main Container */
.influ-vdo-container {
    max-width: 100%;
    width: 100%;
    padding: 0 40px;
    margin: 0 auto;
    position: relative;
}

.influ-vdo-wrapper {
    position: relative;
    overflow: hidden; /* ซ่อน videos ที่อยู่นอก viewport */
    padding: 40px 0; /* เพิ่ม padding เพื่อให้ scaled video ไม่ถูกตัด */
    margin: -40px 0; /* ชดเชย padding */
}

/* Video Track */
.influ-vdo-track {
    display: flex;
    gap: 20px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    justify-content: flex-start;
}

/* Video Item */
.influ-vdo-item {
    flex: 0 0 17.1%;
    position: relative;
    border-radius: 20px;
    overflow: visible; /* อนุญาตให้ scale effect โผล่ออก */
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.influ-vdo-item-inner {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%; /* 9:16 aspect ratio */
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 30px; /* เพิ่มระยะห่างด้านบนสำหรับ desktop */
}

/* Active Video */
.influ-vdo-item.influ-active {
    flex: 0 0 20.9%;
    transform: scale(1.05);
    z-index: 10;
}

.influ-vdo-item.influ-active .influ-vdo-item-inner {
    border-radius: 22px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Video Element */
.influ-vdo-item video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay for inactive videos */
.influ-vdo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.influ-vdo-item.influ-active .influ-vdo-overlay {
    opacity: 0;
}

/* Badge - SALE/PROMOTION */
.influ-vdo-badge {
    position: absolute;
    top: 20px;
    left: 0;
    padding: 8px 20px;
    background: #ffffff;
    border-radius: 0;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.influ-vdo-badge.influ-sale {
    color: #E63946;
}

.influ-vdo-badge.influ-promotion {
    color: #FF6B35;
}

/* Box Counter */
.influ-vdo-counter {
    position: absolute;
    top: 20px;
    right: 0;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    z-index: 5;
    color: #325D53;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mute Button */
.influ-vdo-mute {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    transition: all 0.3s ease;
    opacity: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.influ-vdo-item.influ-active .influ-vdo-mute {
    opacity: 1;
}

.influ-vdo-mute:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.influ-vdo-mute svg {
    width: 20px;
    height: 20px;
    fill: #325D53;
}

/* Product Info Zone */
.influ-vdo-info {
    padding: 20px 15px;
    background: #ffffff;
    border-radius: 0 0 20px 20px;
    position: relative;
    z-index: 1;
}

.influ-vdo-product-name {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.4;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.influ-vdo-price-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.influ-vdo-price-current {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #E63946;
}

.influ-vdo-price-original {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #999;
    text-decoration: line-through;
}

.influ-vdo-discount {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #E63946;
}

/* Add to Cart Button */
.influ-vdo-addcart {
    width: 100%;
    padding: 13px 24px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(45, 95, 93, 0.3);
    border-radius: 30px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #2D5F5D;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.influ-vdo-addcart:hover {
    background: linear-gradient(135deg, #2D5F5D 0%, #3A7875 100%);
    border-color: #2D5F5D;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 95, 93, 0.35);
}

.influ-vdo-addcart:visited,
.influ-vdo-addcart:active,
.influ-vdo-addcart:focus {
    color: #2D5F5D;
    text-decoration: none;
}

.influ-vdo-addcart:hover:visited,
.influ-vdo-addcart:hover:active,
.influ-vdo-addcart:hover:focus {
    color: #ffffff;
}

.influ-vdo-addcart::after {
    content: ' →';
    font-size: 16px;
    margin-left: 6px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.influ-vdo-addcart:hover::after {
    transform: translateX(4px);
}

/* Hide WooCommerce "View cart" button */
.influ-vdo-info .added_to_cart {
    display: none !important;
}

/* New ADD TO CART button (WooCommerce integrated) */
.influ-vdo-add-to-cart {
    width: 100%;
    padding: 13px 24px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(45, 95, 93, 0.3);
    border-radius: 30px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #2D5F5D;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.influ-vdo-add-to-cart:hover {
    background: linear-gradient(135deg, #2D5F5D 0%, #3A7875 100%);
    border-color: #2D5F5D;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 95, 93, 0.35);
}

.influ-vdo-add-to-cart::after {
    content: ' →';
    font-size: 16px;
    margin-left: 6px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.influ-vdo-add-to-cart:hover::after {
    transform: translateX(4px);
}

/* OUT OF STOCK button */
.influ-vdo-out-of-stock {
    width: 100%;
    padding: 13px 24px;
    background: rgba(230, 57, 70, 0.1);
    border: 2px solid rgba(230, 57, 70, 0.3);
    border-radius: 30px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #E63946;
    cursor: not-allowed;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    text-align: center;
    opacity: 0.7;
}

.influ-vdo-out-of-stock::before {
    content: '⚠ ';
    margin-right: 6px;
}

/* Default Video Placeholder */
.influ-vdo-default-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(45, 95, 93, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 5;
}

.influ-vdo-default-placeholder svg {
    margin-bottom: 20px;
    opacity: 0.8;
}

.influ-vdo-default-placeholder .placeholder-title {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 10px 0;
    text-align: center;
}

.influ-vdo-default-placeholder .placeholder-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    text-align: center;
    padding: 0 20px;
    max-width: 300px;
    line-height: 1.5;
}

.influ-vdo-player.has-default-video {
    background: linear-gradient(135deg, rgba(45, 95, 93, 0.3) 0%, rgba(58, 120, 117, 0.3) 100%);
}

.influ-vdo-player.has-default-video .influ-vdo-play-btn,
.influ-vdo-player.has-default-video .influ-vdo-progress-container {
    display: none;
}

/* Navigation Arrows */
.influ-vdo-nav {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.influ-vdo-nav:hover {
    background: #325D53;
    transform: translateY(-50%) scale(1.1);
}

.influ-vdo-nav:hover svg path {
    stroke: #ffffff;
}

.influ-vdo-nav.influ-prev {
    left: 10px;
}

.influ-vdo-nav.influ-next {
    right: 10px;
}

.influ-vdo-nav svg {
    width: 24px;
    height: 24px;
}

.influ-vdo-nav svg path {
    stroke: #325D53;
    stroke-width: 2;
    transition: stroke 0.3s ease;
}

.influ-vdo-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.influ-vdo-nav:disabled:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-50%);
}

.influ-vdo-nav:disabled:hover svg path {
    stroke: #325D53;
}

/* Dots Indicator for Mobile */
.influ-vdo-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-bottom: 10px;
}

.influ-vdo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d9d9d9;
    transition: all 0.3s ease;
    cursor: pointer;
}

.influ-vdo-dot.influ-dot-active {
    width: 24px;
    border-radius: 4px;
    background: #325D53;
}

/* Sticky Popup Bar for Mobile */
.influ-vdo-sticky-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
    display: none;
}

.influ-vdo-sticky-popup.influ-visible {
    transform: translateY(0);
    opacity: 1;
}

.influ-vdo-sticky-content {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 100%;
}

.influ-vdo-sticky-info {
    flex: 1;
    min-width: 0;
}

.influ-vdo-sticky-product-name {
    font-family: 'Prompt', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.influ-vdo-sticky-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.influ-vdo-sticky-price-current {
    font-family: 'Prompt', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #E63946;
}

.influ-vdo-sticky-price-original {
    font-family: 'Prompt', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #999;
    text-decoration: line-through;
}

.influ-vdo-sticky-discount {
    font-family: 'Prompt', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #E63946;
    background: #FFE5E7;
    padding: 2px 8px;
    border-radius: 4px;
}

.influ-vdo-sticky-addcart {
    padding: 12px 24px;
    background: linear-gradient(135deg, #2D5F5D 0%, #3A7875 100%);
    border: 2px solid #2D5F5D;
    border-radius: 30px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    box-shadow: 0 4px 12px rgba(45, 95, 93, 0.3);
    text-decoration: none;
}

.influ-vdo-sticky-addcart:active {
    transform: scale(0.97);
}

.influ-vdo-sticky-addcart:hover {
    background: linear-gradient(135deg, #234947 0%, #2D5F5D 100%);
    box-shadow: 0 6px 20px rgba(45, 95, 93, 0.45);
}

.influ-vdo-sticky-addcart:visited,
.influ-vdo-sticky-addcart:focus {
    color: #ffffff;
    text-decoration: none;
}

/* Hide View cart in sticky popup */
.influ-vdo-sticky-popup .added_to_cart {
    display: none !important;
}

/* Responsive */
@media (max-width: 1400px) {
    .influ-vdo-item {
        flex: 0 0 18.05%;
    }
    
    .influ-vdo-item.influ-active {
        flex: 0 0 22.8%;
    }
    
    .influ-vdo-item-inner {
        border-radius: 18px;
    }
    
    .influ-vdo-item.influ-active .influ-vdo-item-inner {
        border-radius: 20px;
    }
}

@media (max-width: 1200px) {
    .influ-vdo-section-title {
        font-size: 54px;
        margin-bottom: 60px;
    }

    .influ-vdo-item {
        flex: 0 0 20.9%;
    }
    
    .influ-vdo-item.influ-active {
        flex: 0 0 26.6%;
    }
    
    .influ-vdo-item-inner {
        border-radius: 18px;
    }
    
    .influ-vdo-item.influ-active .influ-vdo-item-inner {
        border-radius: 20px;
    }
}

@media (max-width: 1024px) {
    .influ-vdo-section {
        padding: 100px 0;
    }

    .influ-vdo-section-title {
        font-size: 48px;
        margin-bottom: 50px;
    }

    .influ-vdo-container {
        padding: 0 30px;
    }

    .influ-vdo-track {
        gap: 15px;
    }

    .influ-vdo-item {
        flex: 0 0 26.6%;
    }
    
    .influ-vdo-item.influ-active {
        flex: 0 0 33.25%;
    }
    
    .influ-vdo-item-inner {
        border-radius: 16px;
    }
    
    .influ-vdo-item.influ-active .influ-vdo-item-inner {
        border-radius: 18px;
    }
}

/* Mobile - Desktop section hidden (Mobile uses separate influ-mobile-section + home-influ-mobile.css) */
@media (max-width: 768px) {
    .influ-vdo-section {
        display: none !important;
    }
}

/* ========================================== */
/* SHOP CARD (Card 6) - Desktop Only */
/* ========================================== */

.influ-vdo-shop-card {
    /* Hidden by default - will show via JS when scrolled */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.influ-vdo-shop-card.shop-card-visible {
    opacity: 1;
    visibility: visible;
}

.influ-vdo-shop-card .influ-shop-card-inner {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%; /* 9:16 aspect ratio same as video cards */
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 30px;
}

.influ-vdo-shop-card.influ-active .influ-shop-card-inner {
    border-radius: 22px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.influ-shop-card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.influ-shop-card-link img {
    max-width: 80%;
    max-height: 60%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: all 0.4s ease;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
}

.influ-shop-card-img-normal {
    display: block;
}

.influ-shop-card-img-hover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    max-width: 80%;
    max-height: 60%;
}

.influ-vdo-shop-card.influ-active .influ-shop-card-link:hover .influ-shop-card-img-normal {
    opacity: 0;
}

.influ-vdo-shop-card.influ-active .influ-shop-card-link:hover .influ-shop-card-img-hover {
    opacity: 1;
}

.influ-vdo-shop-card.influ-active .influ-shop-card-link:hover img {
    transform: translate(-50%, -50%) scale(1.05);
}

.influ-vdo-shop-card.influ-active .influ-shop-card-link:hover .influ-shop-card-img-normal {
    transform: scale(1.05);
}

/* Shop card doesn't have product info section */
.influ-vdo-shop-card .influ-vdo-info {
    display: none;
}

/* Hide Shop Card on Mobile */
@media (max-width: 768px) {
    .influ-vdo-shop-card {
        display: none !important;
    }
}
/* ========================================== */
/* SHOP BUTTON CARD (Desktop) */
/* ========================================== */

.influ-shop-btn-card {
    cursor: pointer;
}

.influ-shop-btn-card .influ-shop-btn-link {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.influ-shop-btn-card .influ-shop-btn-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* Hide overlays/badges on shop button card */
.influ-shop-btn-card .influ-vdo-badge,
.influ-shop-btn-card .influ-vdo-counter,
.influ-shop-btn-card .influ-vdo-mute,
.influ-shop-btn-card .influ-vdo-info,
.influ-shop-btn-card .influ-vdo-product-info,
.influ-shop-btn-card .influ-vdo-card-video {
    display: none !important;
}
