/* ===== Styles du Panier DEPOT 360 - VERSION COMPLÈTE CORRIGÉE ===== */

/* ===== Icône du Panier ===== */
.cart-icon {
    position: relative;
    cursor: pointer;
    padding: 10px;
    margin-right: 15px;
    transition: all 0.3s;
}

.cart-icon i {
    font-size: 1.4rem;
    color: var(--primary);
    transition: all 0.3s;
}

.cart-icon:hover i {
    color: var(--accent);
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    animation: cartBounce 0.3s ease;
}

@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ===== NOTIFICATIONS COLORÉES - CORRIGÉ ===== */
.cart-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-150px);
    padding: 18px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    z-index: 10000;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 350px;
    max-width: 90vw;
    justify-content: center;
    direction: rtl;
    border: 3px solid transparent;
    background: #28a745; /* Vert par défaut */
    color: white;
}

/* ✅ SUCCÈS - VERT (défini explicitement) */
.cart-notification.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
    border-color: #1e7e34 !important;
    box-shadow: 0 15px 50px rgba(40, 167, 69, 0.4) !important;
}

/* ❌ ERREUR - ROUGE */
.cart-notification.error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    border-color: #bd2130 !important;
    box-shadow: 0 15px 50px rgba(220, 53, 69, 0.4) !important;
}

/* ⚠️ CHARGEMENT/AVERTISSEMENT - ORANGE */
.cart-notification.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
    color: #212529 !important;
    border-color: #e0a800 !important;
    box-shadow: 0 15px 50px rgba(255, 193, 7, 0.4) !important;
}

/* Animation d'affichage */
.cart-notification.show {
    transform: translateX(-50%) translateY(0);
    animation: notificationPulse 0.5s ease;
}

@keyframes notificationPulse {
    0% { transform: translateX(-50%) translateY(0) scale(1); }
    50% { transform: translateX(-50%) translateY(0) scale(1.05); }
    100% { transform: translateX(-50%) translateY(0) scale(1); }
}

.cart-notification i {
    font-size: 1.4rem;
}
/* Seulement si les styles inline ne fonctionnent pas */
.cart-notification {
    font-family: 'Cairo', sans-serif;
}

/* Ancienne notification (pour compatibilité) */
.cart-notification:not(.success):not(.error):not(.warning) {
    background: var(--success);
    color: white;
    border-color: rgba(255,255,255,0.3);
}

/* ===== Modal du Panier ===== */
.cart-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
    padding-bottom: 20px;
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.cart-modal-content {
    background: white;
    width: 95%;
    max-width: 650px;
    max-height: none;
    border-radius: 20px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    animation: cartModalSlide 0.3s ease;
    border: 3px solid var(--accent);
    margin-bottom: 20px;
}

@keyframes cartModalSlide {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, #0f2744 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--accent);
    border-radius: 17px 17px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cart-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
}

.cart-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cart-close:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: rotate(90deg);
}

/* ===== Articles du Panier ===== */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-height: none;
    background: white;
    overflow: visible;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-bottom: 2px solid #e9ecef;
    transition: all 0.3s;
    position: relative;
}

.cart-item:hover {
    background: #f8f9fa;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
}

.cart-item-name {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 800;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-price {
    margin: 0 0 12px 0;
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 5px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid #e9ecef;
    width: fit-content;
}

.cart-item-qty button {
    width: 35px;
    height: 35px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-weight: 700;
    font-size: 1.2rem;
}

.cart-item-qty button:hover {
    background: var(--accent);
    transform: scale(1.1);
}

.cart-item-qty span {
    font-weight: 800;
    min-width: 30px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--primary);
}

.cart-item-total {
    font-weight: 800;
    color: var(--primary);
    min-width: 90px;
    text-align: center;
    font-size: 1.2rem;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid var(--accent);
}

.cart-item-remove {
    background: #dc3545;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    flex-shrink: 0;
}

.cart-item-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* ===== Panier Vide ===== */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: white;
}

.empty-cart i {
    font-size: 5rem;
    color: #ddd;
    margin-bottom: 25px;
}

.empty-cart h3 {
    margin: 0 0 15px 0;
    color: var(--primary);
    font-size: 1.5rem;
}

.empty-cart p {
    margin: 0;
    font-size: 1.1rem;
}

/* ===== Info Livraison ===== */
.shipping-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    padding: 18px 25px;
    margin: 20px;
    color: #0d47a1;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.shipping-info i {
    font-size: 1.4rem;
    color: #2196f3;
}

/* ===== Récapitulatif Prix ===== */
.price-breakdown {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin: 0 20px 20px;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #555;
    font-size: 1.1rem;
    padding: 8px 0;
}

.price-row.total {
    border-top: 3px solid var(--accent);
    padding-top: 15px;
    margin-top: 15px;
    font-weight: 800;
    color: var(--primary);
    font-size: 1.4rem;
}

/* ===== Footer du Panier ===== */
.cart-modal-footer {
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 3px solid var(--accent);
    border-radius: 0 0 17px 17px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.3rem;
    padding: 15px 20px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 12px;
    border: 2px solid var(--accent);
}

.cart-total span:first-child {
    font-weight: 700;
    color: var(--primary);
}

.cart-total-price {
    font-weight: 900;
    color: var(--accent);
    font-size: 1.8rem;
}

.cart-actions {
    display: flex;
    gap: 15px;
}

.cart-actions button {
    flex: 1;
    padding: 18px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-continue {
    background: #e9ecef;
    color: var(--primary);
    border: 2px solid #ced4da;
}

.btn-continue:hover {
    background: #dee2e6;
    border-color: #adb5bd;
}

.btn-checkout {
    background: linear-gradient(135deg, var(--success) 0%, #1da851 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.btn-checkout:hover {
    background: linear-gradient(135deg, #1da851 0%, #128c7e 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
}

/* ===== Modal de Commande ===== */
.checkout-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2001;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
    padding-bottom: 20px;
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.checkout-modal-content {
    background: white;
    width: 95%;
    max-width: 600px;
    max-height: none;
    border-radius: 20px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    animation: checkoutModalSlide 0.3s ease;
    border: 3px solid var(--success);
    margin-bottom: 20px;
}

@keyframes checkoutModalSlide {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checkout-modal-header {
    background: linear-gradient(135deg, var(--success) 0%, #1da851 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid rgba(255,255,255,0.3);
    border-radius: 17px 17px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.checkout-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
}

.checkout-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.checkout-close:hover {
    background: white;
    color: var(--success);
    transform: rotate(90deg);
}

.checkout-modal-body {
    padding: 25px;
    background: #f8f9fa;
}

/* ===== Résumé de la Commande ===== */
.order-summary {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.order-summary h3 {
    margin: 0 0 20px 0;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 800;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #ddd;
    max-height: none;
    overflow: visible;
}

.order-item {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: #555;
    padding: 8px 0;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
}

/* ===== Formulaire de Commande ===== */
.checkout-form h3 {
    margin: 0 0 20px 0;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 800;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(246, 147, 30, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== Options de Commande ===== */
.checkout-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.checkout-options h3 {
    margin: 0 0 15px 0;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
}

.checkout-btn {
    width: 100%;
    padding: 20px;
    margin-bottom: 12px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.checkout-btn.whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.checkout-btn.whatsapp:hover {
    background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
}

.checkout-btn.email {
    background: linear-gradient(135deg, var(--primary) 0%, #0f2744 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.3);
}

.checkout-btn.email:hover {
    background: linear-gradient(135deg, #0f2744 0%, #0a1a2e 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(26, 54, 93, 0.4);
}

.checkout-btn i {
    font-size: 1.8rem;
}

/* ===== Contrôles de Quantité sur les Cartes ===== */
.qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 12px 0;
}

.qty-controls .qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent);
    background: white;
    color: var(--accent);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 700;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-controls .qty-btn:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

.qty-controls .qty-value {
    font-size: 1.2rem;
    font-weight: 800;
    min-width: 50px;
    text-align: center;
    color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    /* Notifications sur mobile */
    .cart-notification {
        min-width: 90vw;
        padding: 15px 20px;
        font-size: 1rem;
        top: 80px;
    }
    
    .cart-modal-overlay,
    .checkout-modal-overlay {
        padding-top: 0;
        padding-bottom: 0;
        align-items: flex-start;
    }
    
    .cart-modal-content,
    .checkout-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        margin: 0;
        border: none;
        border-top: 4px solid var(--accent);
        min-height: 100vh;
    }
    
    .checkout-modal-content {
        border-top-color: var(--success);
    }
    
    .cart-modal-header,
    .checkout-modal-header {
        border-radius: 0;
        position: sticky;
        top: 0;
    }
    
    .cart-modal-footer {
        border-radius: 0;
        position: sticky;
        bottom: 0;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    }
    
    .cart-item {
        flex-wrap: wrap;
        padding: 15px;
        gap: 12px;
    }
    
    .cart-item img {
        width: 70px;
        height: 70px;
    }
    
    .cart-item-info {
        width: calc(100% - 100px);
        padding: 0;
    }
    
    .cart-item-total {
        width: auto;
        text-align: center;
        margin: 0;
        order: 3;
        margin-right: auto;
        font-size: 1.1rem;
        padding: 8px 12px;
    }
    
    .cart-item-remove {
        order: 4;
        width: 40px;
        height: 40px;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .cart-actions button {
        width: 100%;
        padding: 16px;
    }
    
    .price-breakdown {
        margin: 0 15px 15px;
        padding: 20px;
    }
    
    .shipping-info {
        margin: 15px;
        padding: 15px;
        font-size: 1rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .cart-modal-footer {
        padding: 20px;
    }
    
    .cart-total {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        font-size: 1.1rem;
    }
    
    .cart-total-price {
        font-size: 1.6rem;
    }
    
    .checkout-btn {
        padding: 18px;
        font-size: 1.1rem;
    }
    
    .checkout-modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .cart-modal-header h2,
    .checkout-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .cart-close,
    .checkout-close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .cart-item-name {
        font-size: 1rem;
    }
    
    .cart-item-total {
        font-size: 1rem;
        min-width: 80px;
    }
    
    .qty-controls .qty-btn {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
    
    .price-row {
        font-size: 1rem;
    }
    
    .price-row.total {
        font-size: 1.2rem;
    }
}