/* ==========================================================================
   WooTok - TikTok Style Video Feed Stylesheet
   ========================================================================== */

/* Contenitore a tutto schermo con Snap Scroll */
.wootok-feed-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Altezza di viewport dinamica su smartphone */
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    background-color: #000000;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: none; /* Nasconde scrollbar su Firefox */
    -ms-overflow-style: none; /* Nasconde scrollbar su IE/Edge */
}

.wootok-feed-container::-webkit-scrollbar {
    display: none; /* Nasconde scrollbar su Chrome/Safari */
}

/* Singolo elemento video */
.wootok-video-item {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

/* Elemento Video HTML5 */
.wootok-video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000000;
}

/* Controllo Audio Muto/Attivo */
.wootok-audio-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease, background-color 0.2s ease;
    font-size: 18px;
    color: #ffffff;
}

.wootok-audio-toggle:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.7);
}

/* Overlay Informazioni Prodotto */
.wootok-product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px 40px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    color: #ffffff;
    z-index: 5;
    gap: 15px;
}

/* Colonna Testo Prodotto */
.wootok-product-info {
    max-width: 65%;
    text-align: left;
}

.wootok-product-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px 0 !important;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.wootok-product-price {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #00f2fe; /* Prezzo evidenziato */
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.wootok-product-price del {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-right: 6px;
}

.wootok-product-price ins {
    text-decoration: none;
    font-weight: bold;
}

/* Colonna Pulsante e Foto Prodotto */
.wootok-actions-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

/* Rotazione del Thumbnail del Prodotto (Simile al disco vinile di TikTok) */
.wootok-product-thumbnail-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    animation: wootokRotate 10s linear infinite;
    background-color: #ffffff;
}

.wootok-product-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Pulsante Add to Cart con animazione */
.wootok-add-to-cart-btn {
    border: none;
    border-radius: 25px;
    padding: 10px 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 0, 80, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease, filter 0.15s ease;
    white-space: nowrap;
}

.wootok-add-to-cart-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.wootok-add-to-cart-btn:active {
    transform: scale(0.95);
}

/* Stato aggiunta riuscita (Success) */
.wootok-add-to-cart-btn.added {
    background-color: #00f2fe !important;
    color: #000000 !important;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
}

/* Stato di caricamento (loading) */
.wootok-add-to-cart-btn.loading {
    opacity: 0.8;
    pointer-events: none;
}

.wootok-add-to-cart-btn.loading .wootok-btn-icon {
    animation: wootokSpin 1s linear infinite;
}

/* Messaggio se non ci sono video */
.wootok-no-videos {
    background: #111;
    color: #888;
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    font-family: sans-serif;
    font-size: 15px;
    border: 1px dashed #333;
}

/* Animazioni chiave */
@keyframes wootokRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes wootokSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Ottimizzazione Mobile First: Adatta per desktop larghi se incorporato */
@media (min-width: 500px) {
    .wootok-feed-container {
        max-width: 420px;
        height: 800px;
        max-height: 90vh;
        border-radius: 20px;
        border: 8px solid #222222;
        box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    }
    
    .wootok-video-item {
        height: 784px;
    }
}
