/* ===================================================================
   MATRIZ DE VARIACIONES - ESTILO PROFESIONAL Y SOBRIO
   =================================================================== */

#variation-matrix-container {
    margin: 20px 0;
    font-family: inherit;
}

/* Pestañas */
.matrix-tabs-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.matrix-tab-btn {
    flex: 1;
    padding: 10px 14px;
    background: #ECEDEE;
    border: 1px solid #D7D8DB;
    color: #3A3F47;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.matrix-tab-btn:hover {
    border-color: #5E7193;
}
.matrix-tab-btn.active {
    background: #2E5099;
    color: #FFFFFF;
    border-color: #2E5099;
}

/* Tabla */
.variation-matrix {
    width: 100%;
    border-collapse: collapse;
    background: #FFFFFF;
    border: 1px solid #D7D8DB;
}
.variation-matrix th, 
.variation-matrix td {
    border: 1px solid #D7D8DB;
    padding: 8px 10px;
    text-align: center;
    vertical-align: middle;
}
.talles-title-top {
    background: #0B2336;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}
.variation-matrix thead tr:last-child th {
    background: #ECEDEE;
    color: #0B2336;
    font-size: 12px;
    font-weight: 700;
}

/* Botón de color (Curva) */
.btn-color-curve {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 8px;
    font-weight: 600;
    font-size: 13px;
    color: #3A3F47;
    cursor: pointer;
    border-radius: 3px;
    text-align: left;
}
.variation-matrix.mode-curva .btn-color-curve:hover {
    background: #ECEDEE;
    border-color: #D7D8DB;
}

/* Celdas interactivas */
.cell-td {
    padding: 4px !important;
}
.variation-cell {
    width: 36px;
    height: 36px;
    margin: 0 auto;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    background: #FFFFFF;
    border: 1px solid #D7D8DB;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}
.variation-cell.available:hover {
    border-color: #2E5099;
}
.variation-cell.selected {
    background: #2E5099;
    color: #FFFFFF;
    border-color: #0B2336;
}
.variation-cell.out-of-stock {
    background: #FAFAFA;
    border-color: #E5E5E5;
    cursor: not-allowed;
    position: relative;
}
.variation-cell.out-of-stock::after {
    content: "✕";
    color: #C2C2C7;
    font-size: 12px;
}

/* Animación bloqueo */
.variation-cell.shake {
    animation: sysmoShake 0.35s ease;
}
@keyframes sysmoShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    70% { transform: translateX(4px); }
}

.matrix-info-text {
    font-size: 11px;
    color: #5E7193;
    margin: 6px 0 12px 0;
}

/* ===================================================================
   FOOTER: ESTRUCTURA ORIGINAL RESTAURADA
   =================================================================== */
.matrix-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Total Unidades + Papelera en una sola línea horizontal */
.total-units {
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    color: #0B2336;
    margin: 0;
}
#total-quantity-display {
    margin: 0 8px 0 6px;
    font-size: 16px;
    font-weight: 700;
}
.btn-reset-matrix {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #5E7193;
    display: inline-flex;
    align-items: center;
    padding: 2px;
}
.btn-reset-matrix:hover {
    color: #3A3F47;
}

/* Mensaje del 8% (línea sobria) */
#curve-feedback-box {
    width: 100%;
    margin-top: 6px;
}
.feedback-msg {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    line-height: 1.4;
}
.feedback-warning {
    background: #FFF8E6;
    border: 1px solid #F5E0A3;
    color: #7A5800;
}
.feedback-info {
    background: #ECEDEE;
    border: 1px solid #D7D8DB;
    color: #3A3F47;
}

/* Botón Añadir al Carrito */
#add-all-to-cart {
    background: #0B2336 !important;
    color: #FFFFFF !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    padding: 12px 22px !important;
    border-radius: 4px !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 1 !important;
}
#add-all-to-cart:hover {
    background: #2E5099 !important;
}
#add-all-to-cart.btn-success {
    background: #2E5099 !important;
}