/**
 * WC Réductions Quantité - Frontend Styles
 * Version avec prix dynamique en temps réel
 */

/* Conteneur principal */
.wcqd-discount-table-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
    border: 2px solid #f5a623;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.2);
}

/* ========================================
   AFFICHAGE PRIX EN DIRECT
   ======================================== */

.wcqd-live-price-display {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.wcqd-live-price-display.wcqd-updated {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
}

.wcqd-live-price-box,
.wcqd-live-total-box {
    flex: 1;
    min-width: 140px;
    text-align: center;
    padding: 10px;
}

.wcqd-live-price-box {
    border-right: 1px solid #eee;
}

.wcqd-live-label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.wcqd-live-original-price {
    display: inline-block;
    margin-right: 8px;
    color: #999;
    font-size: 14px;
}

.wcqd-live-original-price del {
    text-decoration: line-through;
}

.wcqd-live-current-price {
    display: inline-block;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    transition: all 0.3s ease;
}

.wcqd-live-current-price.wcqd-discounted {
    color: #d48806;
    animation: wcqd-price-pop 0.3s ease;
}

.wcqd-live-total {
    display: inline-block;
    font-size: 24px;
    font-weight: 700;
    color: #2e7d32;
}

.wcqd-live-savings {
    display: none;
    margin-left: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #28a745;
}

.wcqd-live-savings.wcqd-has-savings {
    display: inline-block;
    animation: wcqd-savings-pop 0.4s ease;
}

@keyframes wcqd-price-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes wcqd-savings-pop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Message personnalisé */
.wcqd-custom-message {
    font-weight: 600;
    color: #d48806;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #f5a623;
    font-size: 15px;
}

/* Tableau des réductions */
.wcqd-discount-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.wcqd-discount-table thead {
    background: linear-gradient(135deg, #f5a623 0%, #e6951d 100%);
}

.wcqd-discount-table th {
    padding: 12px 15px;
    text-align: center;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wcqd-discount-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.wcqd-discount-table tbody tr:last-child {
    border-bottom: none;
}

.wcqd-discount-table tbody tr:hover {
    background: #fffbf0;
}

.wcqd-discount-table tbody tr.wcqd-active {
    background: #fff3cd;
    box-shadow: inset 0 0 0 2px #f5a623;
}

.wcqd-discount-table td {
    padding: 12px 15px;
    text-align: center;
    vertical-align: middle;
}

/* Colonne quantité */
.wcqd-discount-table .wcqd-qty {
    font-weight: 600;
    color: #333;
}

/* Colonne réduction */
.wcqd-discount-table .wcqd-discount {
    color: #28a745;
    font-weight: 700;
    font-size: 14px;
}

/* Colonne prix */
.wcqd-discount-table .wcqd-price {
    color: #d48806;
    font-weight: 600;
}

/* Info prix courant */
.wcqd-current-price-info {
    margin-top: 12px;
    padding: 10px 15px;
    background: #e8f5e9;
    border-radius: 5px;
    text-align: center;
    display: none;
}

.wcqd-current-price-info.wcqd-visible {
    display: block;
}

.wcqd-selected-tier {
    font-weight: 600;
    color: #2e7d32;
}

/* Badge économie dans le panier */
.wcqd-savings {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 8px;
    background: #e8f5e9;
    border-radius: 3px;
    font-weight: 600;
}

/* Animation pulse pour le palier actif */
@keyframes wcqd-pulse {
    0% {
        box-shadow: inset 0 0 0 2px #f5a623;
    }
    50% {
        box-shadow: inset 0 0 0 3px #f5a623, 0 0 10px rgba(245, 166, 35, 0.3);
    }
    100% {
        box-shadow: inset 0 0 0 2px #f5a623;
    }
}

.wcqd-discount-table tbody tr.wcqd-active {
    animation: wcqd-pulse 1.5s ease-in-out;
}

/* Prix barré pour afficher l'économie */
.wcqd-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9em;
    margin-right: 5px;
}

.wcqd-new-price {
    color: #d48806;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 480px) {
    .wcqd-discount-table-wrapper {
        padding: 12px;
        margin: 15px 0;
    }
    
    .wcqd-live-price-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .wcqd-live-price-box {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-bottom: 15px;
    }
    
    .wcqd-live-current-price,
    .wcqd-live-total {
        font-size: 20px;
    }
    
    .wcqd-discount-table th,
    .wcqd-discount-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .wcqd-discount-table th {
        font-size: 11px;
    }
}

/* Style alternatif pour thèmes sombres */
.dark-theme .wcqd-discount-table-wrapper,
[data-theme="dark"] .wcqd-discount-table-wrapper {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-color: #f5a623;
}

.dark-theme .wcqd-discount-table,
[data-theme="dark"] .wcqd-discount-table {
    background: #2d2d2d;
}

.dark-theme .wcqd-discount-table tbody tr:hover,
[data-theme="dark"] .wcqd-discount-table tbody tr:hover {
    background: #3d3d3d;
}

.dark-theme .wcqd-discount-table .wcqd-qty,
[data-theme="dark"] .wcqd-discount-table .wcqd-qty {
    color: #fff;
}
