/* ===== 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: 12px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 25px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.influ-vdo-addcart:hover {
    background: #325D53;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(50, 93, 83, 0.3);
}

/* 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: #325D53;
    border: none;
    border-radius: 25px;
    font-family: 'Prompt', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* 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 - แสดง 1 video เต็มจอ */
@media (max-width: 768px) {
    .influ-vdo-section {
        padding: 80px 0 20px 0;
    }

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

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

    .influ-vdo-wrapper {
        margin-bottom: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
    }

    .influ-vdo-track {
        gap: 0;
        justify-content: flex-start;
    }

    .influ-vdo-item {
        flex: 0 0 100%;
        transform: scale(1);
        overflow: hidden;
    }
    
    .influ-vdo-item.influ-active {
        flex: 0 0 100%;
        transform: scale(1);
    }

    .influ-vdo-overlay {
        display: none;
    }

    .influ-vdo-item-inner {
        border-radius: 16px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        margin-top: 0;
    }
    
    .influ-vdo-item.influ-active .influ-vdo-item-inner {
        border-radius: 16px;
    }

    .influ-vdo-badge {
        top: 15px;
        padding: 6px 14px;
        font-family: 'Prompt', sans-serif;
        font-size: 17px;
        border-top-right-radius: 15px;
        border-bottom-right-radius: 15px;
    }

    .influ-vdo-counter {
        top: 15px;
        padding: 6px 12px;
        font-family: 'Prompt', sans-serif;
        font-size: 17px;
        border-top-left-radius: 15px;
        border-bottom-left-radius: 15px;
    }

    .influ-vdo-mute {
        width: 36px;
        height: 36px;
        bottom: 15px;
        right: 15px;
        opacity: 1;
    }

    .influ-vdo-mute svg {
        width: 18px;
        height: 18px;
    }

    .influ-vdo-info {
        display: none;
    }

    .influ-vdo-nav {
        display: none;
    }

    .influ-vdo-dots {
        display: flex;
    }

    .influ-vdo-sticky-popup {
        display: block;
    }
}

@media (max-width: 480px) {
    .influ-vdo-section {
        padding: 60px 0 20px 0;
    }

    .influ-vdo-section-title {
        font-size: 32px;
        margin-bottom: 30px;
    }

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

    .influ-vdo-item-inner {
        border-radius: 12px;
    }

    .influ-vdo-badge {
        top: 12px;
        padding: 5px 12px;
        font-size: 17px;
    }

    .influ-vdo-counter {
        top: 12px;
        padding: 5px 10px;
        font-size: 17px;
    }

    .influ-vdo-dots {
        display: flex;
        margin-top: 15px;
    }

    .influ-vdo-sticky-popup {
        padding: 12px 15px;
    }

    .influ-vdo-sticky-product-name {
        font-size: 13px;
    }

    .influ-vdo-sticky-price-current {
        font-size: 16px;
    }

    .influ-vdo-sticky-addcart {
        padding: 10px 20px;
        font-size: 13px;
    }
}