.wtv-table {
    /* min-width: 900px; */ /* RIMOSSO per rendere la tabella più compatta */
    border-collapse: separate;
    width: 100%;
    background: #fff;
}

.wtv-table th, .wtv-table td {
    white-space: nowrap;
    padding: 4px 8px;
    font-size: 13px;
}

.wtv-table input[type="number"] {
    width: 40px;
    text-align: center;
    padding: 2px;
    height: 25px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.wtv-summary {
    margin-top: 10px;
    font-weight: bold;
}

.wtv-add-to-cart {
    margin-top: 20px;
    display: flex !important;
    justify-content: space-between !important;
}

@media (max-width: 600px) {
    .wtv-add-to-cart{
        flex-wrap: wrap !important;
    }
}

.variations,
.woocommerce-variation-add-to-cart {
    display: none !important;
}

/* Stile per il prezzo */
.wtv-price-tag {
    font-size: 12px;
    color: #d00;
    margin-top: 3px;
    white-space: nowrap;
    font-weight: bold;
}

.wtv-table span.out-of-stock {
    font-style: italic;
    color: #999;
    font-size: 10px;
}

/* Stile per la disponibilità */
.wtv-stock-tag {
    font-size: 10px;
    color: #666;
    white-space: nowrap;
}

/* Stile per input non validi (quando si supera il max) */
.wtv-qty-input{
    padding-left: 2px !important;
}

.wtv-qty-input:invalid {
    border-color: #f00 !important;
    background-color: #fff0f0 !important;
}

/* Stile per le immagini delle varianti */
.wtv-variant-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #eee;
    margin: 0; /* rimuove l'auto centering */
    display: inline-block; /* cambia da block a inline-block */
    flex-shrink: 0; /* evita che l'immagine si rimpicciolisca */
}

/* Stile per la colonna del colore */
.wtv-color-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    padding-left: 5px;
    white-space: nowrap;
    background-color: inherit; /* Eredita il background dalla cella padre */
}

.wtv-color-cell span {
    display: inline-block;
    font-size: 13px;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
}

/* Stile Pulsante Aggiungi al carrello */
.single_add_to_cart_button.button.alt{
    margin-left: 0px !important;
}

/* Scroll orizzontale per la tabella delle variazioni */
.wtv-table-wrapper {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Sticky prima colonna durante lo scroll orizzontale */
.wtv-table th:first-child,
.wtv-table td:first-child {
    width: 150px;
    position: sticky;
    left: 0;
    background-color: #fff;
    z-index: 10;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

/* Miglioriamo l'effetto shadow quando si fa hover sulla tabella */
.wtv-table-wrapper:hover .wtv-table th:first-child,
.wtv-table-wrapper:hover .wtv-table td:first-child {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

/* Assicuriamoci che l'header sticky abbia un background appropriato */
.wtv-table thead th:first-child {
    background-color: #f8f9fa;
    font-weight: bold;
    border-right: 1px solid #dee2e6;
}

/* Aggiungiamo un bordo alla prima colonna per separarla visivamente */
.wtv-table tbody td:first-child {
    border-right: 1px solid #dee2e6;
}

/* Responsive: su schermi piccoli, riduci font e padding */
@media (max-width: 700px) {
    .wtv-table th,
    .wtv-table td {
        padding: 2px 4px;
        font-size: 11px;
    }
    .wtv-table {
        min-width: 600px;
    }
}

/* Nascondi colonne non essenziali su mobile se serve */
@media (max-width: 500px) {
    .wtv-hide-mobile {
        display: none !important;
    }
}

/* Stili per il loader */
.wtv-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wtv-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: wtv-spin 1s linear infinite;
}

@keyframes wtv-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Stili per i messaggi */
.wtv-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: wtv-slide-in 0.3s ease-out;
    max-width: 300px;
}

.wtv-message.success {
    background-color: #4CAF50;
    color: white;
}

.wtv-message.error {
    background-color: #f44336;
    color: white;
}

@keyframes wtv-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utilizziamo il lightbox di Elementor */

