/**
 * Labella Variation Swatches - Estilos Premium (VERSÃO FINAL COM LEGENDAS APRIMORADAS)
 * Inclui: Thumbs maiores, sem cortes, seleção premium e legendas dinâmicas com formato "COR: Preto" e "TAMANHO: P 38/40"
 */

/* ==========================================
   PARTE 1: CSS (Estilos Visuais)
========================================== */

/* Esconde os seletores nativos */
.variations select,
.variations td.value select,
.variations .value select {
    display: none !important;
}

.woocommerce table.variations tr th {
padding: 0px !important;
}

.single-product form.cart .variations tr:first-child td, .single-product form.cart .variations tr:first-child th {
padding: 0px !important;
}

/* Container dos swatches - Configurado para não cortar elementos */
.labella-swatch-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 20px;
    overflow: visible !important; 
    padding: 10px 2px !important;
}

/* Item genérico de swatch */
.labella-swatch-item {
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    position: relative;
    border: 1px solid #e5e5e5;
    box-sizing: border-box;
}

/* Efeito de flutuar ao passar o mouse */
.labella-swatch-item:hover:not(.disabled) {
    border-color: #000000;
    transform: translateY(-3px);
    z-index: 5;
}

/* Estado selecionado - Borda dupla premium */
.labella-swatch-item.selected {
    border: 2px solid #000000 !important;
    z-index: 10;
    transform: translateY(-2px);
}

/* Estado desabilitado */
.labella-swatch-item.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.labella-swatch-item.disabled::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background-color: #000;
    transform: rotate(-45deg);
}

/* ========== SWATCH DE COR (THUMBS MAIORES) ========== */
.swatch-color {
    width: 70px;
    height: 94px;
    border-radius: 4px;
    overflow: hidden;
}

.swatch-color img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========== SWATCH DE TAMANHO ========== */
.swatch-size {
    min-width: 80px;
    height: 44px;
    padding: 0 15px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #333333;
    background-color: #ffffff;
    border-radius: 2px;
}

.swatch-size.selected {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* ========== ESTILO DA LEGENDA (COR/TAMANHO SELECIONADO) ========== */
/* Formato: "COR: Preto" ou "TAMANHO: P 38/40" */
.labella-selected-label {
    font-weight: 400;
    color: #888;
    margin-left: 10px;
    font-size: 0.95em;
    text-transform: none;
    display: inline-block;
}

/* Garante que o rótulo principal aceite a legenda ao lado */
.variations th.label label {
    display: flex;
    align-items: center;
    white-space: nowrap;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.9em;
}

/* ========== RESPONSIVIDADE (MOBILE) ========== */

@media (max-width: 768px) {
    .labella-swatch-container {
        gap: 8px;
    }

    .swatch-color {
        width: 62px;
        height: 82px;
    }

    .swatch-size {
        min-width: 70px;
        height: 40px;
        font-size: 12px;
    }

    .labella-selected-label {
        font-size: 12px;
        margin-left: 8px;
    }
}

@media (max-width: 480px) {
    .swatch-color {
        width: 50px;
        height: 74px;
    }
    
    .swatch-size {
        min-width: 60px;
        padding: 0 5px;
    }

    .variations th.label label {
        font-size: 0.85em;
    }

    .labella-selected-label {
         font-size: 12px;
        margin-left: 5px;
    }
}
