/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */
 
 
/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */
 
 
/* ===================================================================
   SOLUCIÓN DEFINITIVA CON ANCHOS FORZADOS Y ANTI-CACHÉ
=================================================================== */

/* --- 1. CONTENEDOR PRINCIPAL --- */
#variation-matrix-container {
    background-color: #fdfdfd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 10px; 
    width: 100%;
    box-sizing: border-box;
}

/* --- 2. ESTILOS DE LA TABLA --- */
.variation-matrix {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    table-layout: fixed; 
}

/* Forzamos un cálculo de caja predecible para todas las celdas */
.variation-matrix th,
.variation-matrix td {
    border: 1px solid #f0f0f0;
    padding: 4px;
    vertical-align: middle;
    box-sizing: border-box; /* <- AÑADIDO: Asegura que el padding no altere el ancho */
}

.variation-matrix th {
    font-weight: 600;
    color: #444;
    font-size: 0.9em; 
}

/* === LA SOLUCIÓN CLAVE ESTÁ AQUÍ === */

/* Forzamos el ancho de la PRIMERA columna (Colores) a ser del 45% */
.variation-matrix th:first-child,
.variation-matrix td:first-child {
    width: 30% !important;
    text-align: left;
    font-weight: 500;
    padding-left: 10px;
    padding-right: 10px; /* Margen de seguridad para que el texto no toque el borde */
    white-space: nowrap; 
}

/* Forzamos el ancho de la ÚLTIMA columna (la 'X') a ser del 10% */
.variation-matrix th:last-child,
.variation-matrix td:last-child {
    width: 10% !important;
}

/* --- 3. CELDAS DE SELECCIÓN (BOTONES) --- */
.variation-cell {
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    width: 100%; 
    aspect-ratio: 1 / 1; 
    max-width: 42px; 
    height: auto;
    margin: 0 auto; 
    display: flex;
    align-items: center;
    justify-content: center;
}
.variation-cell.available {
    background-color: #f0f0f0;
    cursor: pointer;
}
.variation-cell.available:hover {
    background-color: #0C1D2B;
    color: white;
}
.variation-cell.selected {
    background-color: #747E86;
    color: white;
}
.variation-cell.selected:hover {
    background-color: #5a6268;
}
.variation-cell.out-of-stock {
    background-color: #ffd1d1;
    cursor: not-allowed;
    position: relative;
}
.variation-cell.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%; left: 15%; right: 15%;
    height: 1px;
    background-color: #999;
    transform: translateY(-50%);
}
.quantity {
    font-size: 1.1em;
    font-weight: bold;
}
.clear-row {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    padding: 0 5px;
}
.clear-row:hover {
    color: #b91c1c;
}

/* --- 4. ESTILOS DEL FOOTER --- */
.matrix-footer {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    margin-top: 15px;
}
.add-to-cart-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 300px;
    margin: 0 auto;
}
.total-quantity-container {
    font-size: 1em;
    color: #4b5563;
    margin-bottom: 12px;
}
#total-quantity-display {
    font-weight: bold;
}
#add-all-to-cart {
    width: 100%;
    padding: 12px 20px;
    font-size: 1.1em;
}

/* --- 5. ESTILOS PARA NOTIFICACIONES --- */
#matrix-notifications {
    width: 100%;
    margin-bottom: 12px;
    min-height: 20px;
    text-align: center;
}
.matrix-notification {
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 0.95em;
    border: 1px solid transparent;
}
.matrix-notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}
.matrix-notification.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}