/**
 * CSS FINAL ÚNICO para Botones de Fórmula WooCommerce
 * Archivo: assets/css/formula-buttons.css
 * REEMPLAZA todos los CSS anteriores
 */

/* ============================================
   OCULTAR BOTONES CIRCULARES DURANTE CARGA
   ============================================ */
.tawcvs-swatches[data-attribute_name="attribute_pa_formula"] .swatch.swatch-shape-circle {
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.tawcvs-swatches[data-attribute_name="attribute_pa_formula"] .swatch.custom-formula-button {
    opacity: 1 !important;
}

/* ============================================
   POSICIONAMIENTO: LABEL ARRIBA, BOTONES ABAJO
   ============================================ */
.variations tr {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    border: none !important;
    margin-bottom: 20px !important;
}

.variations .label {
    width: 100% !important;
    margin-bottom: 10px !important;
    display: block !important;
}

.variations .label label[for="pa_formula"] {
    font-weight: 600 !important;
    /*text-transform: uppercase !important;*/
    letter-spacing: 0.5px !important;
    color: #333 !important;
    font-size: 16px !important;
    margin-bottom: 0 !important;
    display: block !important;
}

.variations .value {
    width: 100% !important;
    padding: 0 !important;
    margin-top: 0 !important;
}

/* ============================================
   ESTILOS DE BOTONES (para JavaScript y CSS)
   ============================================ */
.tawcvs-swatches[data-attribute_name="attribute_pa_formula"] {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    margin: 5px 0 20px 0 !important;
    width: 100% !important;
}

/* Estilos base para swatches originales Y botones customizados */
.tawcvs-swatches[data-attribute_name="attribute_pa_formula"] .swatch,
.custom-formula-button {
    border-radius: 6px !important;
    width: auto !important;
    height: auto !important;
    line-height: 1.2 !important;
    background-color: #c44c2a !important;
    color: white !important;
    padding: 10px 10px !important;
    min-width: 100px !important;
    text-align: center !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 9px !important;
    border: 2px solid transparent !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin: 0 4px 8px 0 !important;
    display: inline-block !important;
    text-decoration: none !important;
    font-family: inherit !important;
}

/* Texto dentro de botones */
.tawcvs-swatches[data-attribute_name="attribute_pa_formula"] .swatch .text,
.custom-formula-button span {
    color: white !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-weight: 600 !important;
    font-size: 9px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Colores específicos por tipo */
.tawcvs-swatches .swatch.swatch-full-copp,
.custom-formula-button[data-value="full-copp"] {
    background-color: #c44c2a !important;
}

.tawcvs-swatches .swatch.swatch-semi-metalica,
.custom-formula-button[data-value="semi-metalica"] {
    background-color: #d45a2a !important;
}

.tawcvs-swatches .swatch.swatch-thermo-ceramica,
.custom-formula-button[data-value="thermo-ceramica"] {
    background-color: #b8412a !important;
}

/* Estados hover */
.tawcvs-swatches .swatch:hover,
.custom-formula-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
    filter: brightness(1.1) !important;
}

/* Estados seleccionados */
.tawcvs-swatches .swatch.selected,
.tawcvs-swatches .swatch.swatch-selected,
.custom-formula-button.selected {
    background-color: #a03620 !important;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.3) !important;
    transform: translateY(1px) !important;
}

.tawcvs-swatches .swatch.selected:hover,
.tawcvs-swatches .swatch.swatch-selected:hover,
.custom-formula-button.selected:hover {
    transform: translateY(1px) !important;
    filter: brightness(1.05) !important;
}

/* Estados deshabilitados */
.tawcvs-swatches .swatch.swatch-disabled,
.custom-formula-button.disabled {
    background-color: #cccccc !important;
    color: #888888 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.tawcvs-swatches .swatch.swatch-disabled .text,
.custom-formula-button.disabled span {
    color: #888888 !important;
}

.tawcvs-swatches .swatch.swatch-disabled:hover,
.custom-formula-button.disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}

/* ============================================
   LIMPIAR ESTRUCTURA ORIGINAL
   ============================================ */
.variation-selector.variation-select-label.hidden {
    display: none !important;
}

.variations {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    margin-bottom: 20px !important;
}

.variations td,
.variations th {
    border: none !important;
    padding: 5px 0 !important;
    vertical-align: top !important;
}

.reset_variations {
    margin-top: 10px !important;
    margin-left: 0 !important;
    font-size: 12px !important;
    color: #666 !important;
    text-decoration: underline !important;
    display: block !important;
}

.reset_variations:hover {
    color: #c44c2a !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* TABLET Y MÓVIL - Botones más pequeños para que quepan uno al lado del otro */
@media (max-width: 768px) {
    .tawcvs-swatches[data-attribute_name="attribute_pa_formula"] {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .tawcvs-swatches[data-attribute_name="attribute_pa_formula"] .swatch,
    .custom-formula-button {
        padding: 8px 12px !important;
        min-width: 80px !important;
        max-width: 100px !important;
        font-size: 11px !important;
        margin: 0 2px 0 0 !important;
        flex-shrink: 0 !important;
        letter-spacing: 0.3px !important;
    }
    
    .tawcvs-swatches[data-attribute_name="attribute_pa_formula"] .swatch .text,
    .custom-formula-button span {
        font-size: 11px !important;
        letter-spacing: 0.3px !important;
        line-height: 1.1 !important;
    }
    
    .variations .label label[for="pa_formula"] {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
}

/* MÓVIL PEQUEÑO - Botones aún más compactos */
@media (max-width: 480px) {
    .tawcvs-swatches[data-attribute_name="attribute_pa_formula"] {
        gap: 4px !important;
    }
    
    .tawcvs-swatches[data-attribute_name="attribute_pa_formula"] .swatch,
    .custom-formula-button {
        padding: 6px 10px !important;
        min-width: 70px !important;
        max-width: 90px !important;
        font-size: 10px !important;
        margin: 0 1px 0 0 !important;
    }
    
    .tawcvs-swatches[data-attribute_name="attribute_pa_formula"] .swatch .text,
    .custom-formula-button span {
        font-size: 10px !important;
        letter-spacing: 0.2px !important;
    }
}

/* SI PREFIERES QUE EN MÓVILES SE APILEN VERTICALMENTE, descomenta esto: */
/*
@media (max-width: 768px) {
    .tawcvs-swatches[data-attribute_name="attribute_pa_formula"] {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }
    
    .tawcvs-swatches[data-attribute_name="attribute_pa_formula"] .swatch,
    .custom-formula-button {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 14px !important;
        margin-bottom: 0 !important;
    }
}
*/

@media (max-width: 480px) {
    .tawcvs-swatches[data-attribute_name="attribute_pa_formula"] .swatch,
    .custom-formula-button {
        padding: 16px 20px !important;
        font-size: 15px !important;
    }
}


.formula-button.disabled {
  pointer-events: none;   /* No deja hacer clic */
  opacity: 0.5;           /* Se ve deshabilitado */
  cursor: not-allowed;
}

