/* ========================================
   CHARTE GRAPHIQUE
   ======================================== */
/*
Couleurs Principales:
- Bleu Principal: #1e3a8a
- Bleu Secondaire: #1e40af  
- Bleu Clair: #3b82f6
- Rouge (Danger/Suppression): #dc2626
- Rouge Foncé (Hover): #b91c1c
Police: "Segoe UI", Roboto, Arial, sans-serif
*/

/* ========================================
   STYLES GÉNÉRAUX
   ======================================== */

body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #f5f5f5; /* Fond gris léger */
    display: flex; /* Active flexbox pour le layout */
    flex-direction: column; /* Empile header, main, footer verticalement */
    min-height: 100vh; /* Hauteur minimale de la fenêtre */
}

/* Forcer le main à prendre l'espace restant et ajouter padding pour le header fixe */
main {
    flex: 1; /* Prend tout l'espace disponible entre header et footer */
    position: relative; /* Assure que le main reste sous le header */
    z-index: 1; /* S'assure que le main est sous le header (z-index: 1000) */
}

/* ========================================
   CONTENEUR PRINCIPAL DU PANIER
   ======================================== */

.cart-container {
    max-width: 1200px; /* Largeur maximale du contenu */
    margin:100px auto 40px; /* Centrage horizontal avec marges */
    padding: 0 20px 40px 20px; /* Padding latéral + padding bottom pour espace avant footer */
    min-height: auto; /* Enlever la hauteur minimale qui cause le problème */
}

 .cart-content {
    display: flex;         /* Indispensable pour que le gap fonctionne */
    flex-direction: row;    /* Place les éléments côte à côte */
    gap: 30px;              /* C'est ici que vous réglez l'espace entre les colonnes */
    align-items: flex-start; /* Empêche le résumé de s'étirer verticalement */
}

/* ========================================
   EN-TÊTE DU PANIER
   ======================================== */

.cart-header {
    margin-bottom: 30px; /* Espace sous l'en-tête */
}

.cart-title {
    font-size: 32px; /* Taille du titre */
    font-weight: bold;
    color: #1e3a8a; /* Bleu principal */
    margin-bottom: 10px;
    display: flex; /* Flexbox pour aligner icône et texte */
    align-items: center;
    gap: 15px; /* Espace entre icône et texte */
}

.cart-title i {
    font-size: 28px; /* Taille de l'icône */
}

.cart-item-count {
    font-size: 16px;
    color: #666; /* Gris moyen */
    font-weight: 500;
}

.cart-item-count span {
    color: #1e40af; /* Bleu secondaire pour le nombre */
    font-weight: bold;
}

/* ========================================
   INDICATEUR DE CHARGEMENT
   ======================================== */

.loading-indicator {
    text-align: center; /* Centrage du contenu */
    padding: 60px 20px;
    color: #1e40af; /* Bleu secondaire */
}

.loading-indicator i {
    font-size: 48px; /* Grande icône de chargement */
    margin-bottom: 20px;
}

.loading-indicator p {
    font-size: 18px;
    color: #666;
}

/* ========================================
   MESSAGE PANIER VIDE
   ======================================== */

.empty-cart-message {
    display: flex;
    flex-direction: row;
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px; /* Coins arrondis */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Ombre légère */
}

.empty-cart-message i {
    font-size: 80px; /* Très grande icône */
    color: #e0e0e0; /* Gris clair */
    margin-bottom: 20px;
}

.empty-cart-message h2 {
    font-size: 24px;
    color: #1e3a8a; /* Bleu principal */
    margin-bottom: 10px;
}

.empty-cart-message p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.btn-continue-shopping {
    display: inline-flex; /* Flexbox inline pour l'icône et le texte */
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background-color: #1e3a8a; /* Bleu principal */
    color: white;
    text-decoration: none;
    border-radius: 25px; /* Bouton arrondi */
    font-weight: bold;
    transition: all 0.3s ease; /* Animation fluide */
}

.btn-continue-shopping:hover {
    background-color: #3b82f6; /* Bleu clair au survol */
    transform: translateY(-2px); /* Légère élévation */
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); /* Ombre bleue */
}


/* ========================================
   BOUTON VIDER LE PANIER (Nouveau Style)
   ======================================== */

.cart-actions-top {
    display: flex;
    justify-content: flex-start; /* Aligner le bouton à droite */
    margin-bottom: 20px;
}

.btn-clear-cart {
    background-color: #dc2626; /* Rouge */
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-clear-cart:hover {
    background-color: #b91c1c; /* Rouge plus foncé au survol */
    transform: translateY(-2px);
}

.btn-clear-cart:active {
    transform: translateY(0);
}

/* ========================================
   COLONNE GAUCHE: ARTICLES DU PANIER
   ======================================== */

.cart-items {
    flex: 2; /* Prend 2/3 de l'espace */
    display: flex;
    flex-direction: column; /* Empile les articles verticalement */
    gap: 20px; /* Espace entre les cartes */
}

/* ========================================
   CARTE D'ARTICLE INDIVIDUELLE
   ======================================== */

.cart-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px; /* Coins arrondis */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Ombre subtile */
    transition: all 0.3s ease; /* Animation au survol */
    position: relative; /* Pour positionner le badge de quantité */
}

.cart-item:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15); /* Ombre bleue au survol */
    border-color: #3b82f6; /* Bordure bleue */
    transform: translateY(-2px); /* Légère élévation */
}

/* Animation de suppression (glissement vers la droite et disparition) */
.cart-item.removing {
    animation: slideOutRight 0.5s ease forwards; /* Animation de sortie */
}

@keyframes slideOutRight {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%); /* Glisse vers la droite */
    }
}

/* ========================================
   IMAGE DU PRODUIT
   ======================================== */

.item-image {
    width: 120px; /* Largeur fixe */
    height: 120px; /* Hauteur fixe */
    object-fit: cover; /* Ajuste l'image sans déformation */
    border-radius: 8px;
    margin-right: 20px;
    border: 1px solid #f0f0f0; /* Bordure légère */
}

/* ========================================
   DÉTAILS DU PRODUIT
   ======================================== */

.item-details {
    flex: 1; /* Prend l'espace restant */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-name {
    font-size: 18px;
    font-weight: bold;
    color: #1e3a8a; /* Bleu principal */
    margin: 0;
}

.item-brand {
    font-size: 14px;
    color: #888; /* Gris moyen */
    font-style: italic;
}

.item-color {
    font-size: 14px;
    color: #666;
    display: flex; /* Pour aligner l'icône et le texte */
    align-items: center;
    gap: 5px;
}

.item-color i {
    color: #1e40af; /* Bleu secondaire pour l'icône */
}

/* Badge de notation (étoiles) */
.item-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.stars {
    color: #fbbf24; /* Couleur dorée pour les étoiles */
}

.rating-value {
    color: #666;
    font-weight: 600;
}

/* ========================================
   ACTIONS SUR LE PRODUIT
   ======================================== */

.item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Alignement à droite */
    gap: 12px;
}

.item-price {
    font-size: 24px; /* Prix en grand */
    font-weight: bold;
    color: #1e40af; /* Bleu secondaire */
    margin: 0;
}

/* ========================================
   CONTRÔLES DE QUANTITÉ
   ======================================== */

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f8f9fa; /* Fond gris très clair */
    padding: 8px 12px;
    border-radius: 20px; /* Coins arrondis */
    border: 1px solid #e0e0e0;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: none;
    background-color: #1e3a8a; /* Bleu principal */
    color: white;
    border-radius: 50%; /* Bouton circulaire */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background-color: #3b82f6; /* Bleu clair au survol */
    transform: scale(1.1); /* Légère augmentation de taille */
}

.quantity-btn:active {
    transform: scale(0.95); /* Effet de clic */
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    color: #1e3a8a; /* Bleu principal */
    font-size: 16px;
}

/* ========================================
   BOUTON SUPPRIMER (Article individuel)
   ======================================== */

.remove-btn {
    padding: 10px 20px;
    background-color: #dc2626; /* Rouge pour la suppression */
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background-color: #b91c1c; /* Rouge plus foncé au survol */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3); /* Ombre rouge */
}

.remove-btn:active {
    transform: translateY(0);
}

/* ========================================
   COLONNE DROITE: RÉSUMÉ DE COMMANDE
   ======================================== */

.order-summary {
    flex: 1; /* Prend 1/3 de l'espace */
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky; /* Reste visible en scrollant */
    top: 120px; /* Position par rapport au haut de la fenêtre */
    height: fit-content; /* S'adapte au contenu */
}

.summary-title {
    font-size: 22px;
    font-weight: bold;
    color: #1e3a8a; /* Bleu principal */
    margin-bottom: 20px;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========================================
   BOX DE RÉSUMÉ
   ======================================== */

.summary-box {
    border: 2px solid #1e3a8a; /* Bordure bleue */
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    background-color: #f8f9fa; /* Fond gris très clair */
}

.summary-row {
    display: flex;
    justify-content: space-between; /* Espacement entre label et valeur */
    align-items: center;
    margin-bottom: 15px;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-label {
    font-size: 16px;
    color: #1e3a8a; /* Bleu principal */
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-label i {
    color: #1e40af; /* Bleu secondaire pour les icônes */
}

.summary-value {
    font-size: 16px;
    color: #1e40af; /* Bleu secondaire */
    font-weight: bold;
}

.discount-value {
    color: #10b981; /* Vert pour la réduction */
}

/* ========================================
   LIGNE DU TOTAL
   ======================================== */

.summary-total {
    border-top: 2px solid #3b82f6; /* Bordure supérieure bleue */
    padding-top: 15px;
    margin-top: 10px;
    background-color: #eff6ff; /* Fond bleu très pâle */
    padding: 15px;
    border-radius: 6px;
    margin: 10px -5px 0 -5px; /* Déborde légèrement pour l'effet visuel */
}

.summary-total .summary-label {
    font-weight: bold;
    font-size: 18px;
    color: #1e3a8a; /* Bleu principal */
}

.summary-total .summary-value {
    font-weight: bold;
    font-size: 20px; /* Plus grand pour le total */
    color: #1e40af; /* Bleu secondaire */
}

/* ========================================
   BOUTON DE PAIEMENT
   ======================================== */

.checkout-btn {
    width: 100%;
    padding: 16px;
    background-color: #1e3a8a; /* Bleu principal */
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.checkout-btn:hover {
    background-color: #3b82f6; /* Bleu clair au survol */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4); /* Ombre bleue */
}

.checkout-btn:active {
    transform: translateY(0);
}

/* ========================================
   LIEN CONTINUER LES ACHATS
   ======================================== */

.continue-shopping-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: #1e40af; /* Bleu secondaire */
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.continue-shopping-link:hover {
    background-color: #f0f7ff; /* Fond bleu très pâle */
    color: #1e3a8a; /* Bleu principal */
}

/* ========================================
   BADGES DE SÉCURITÉ
   ======================================== */

.security-badges {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #666;
}

.badge i {
    color: #10b981; /* Vert pour les icônes de sécurité */
    font-size: 16px;
}

/* ========================================
   RESPONSIVE DESIGN (MOBILE/TABLET)
   ======================================== */

@media (max-width: 768px) {
    
    /* Réduire le margin-top sur mobile car le header est plus compact */
    main {
        margin-top: 100px;
    }
    

.cart-content {
    display: flex;         /* Indispensable pour mettre côte à côte */
    flex-direction: row;    /* Aligne cart-main-column et order-summary */
    gap: 30px;              /* L'espace magique entre les deux blocs */
    align-items: flex-start;/* Empêche le résumé de s'étirer bizarrement */
    width: 100%;
}

.cart-main-column {
    flex: 2; /* Prend 2/3 de la largeur */
}

.order-summary {
    flex: 1; /* Prend 1/3 de la largeur */
    position: sticky; /* Pour que le résumé suive au scroll */
    top: 120px;
}
    
    /* Articles empilés verticalement sur petit écran */
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-image {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%; /* Image pleine largeur */
        height: auto;
    }
    
    .item-actions {
        width: 100%;
        align-items: flex-start;
    }
    
    .remove-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Titre plus petit sur mobile */
    .cart-title {
        font-size: 24px;
    }

    /* Le bouton Vider le panier s'aligne à gauche ou s'étend sur mobile */
    .cart-actions-top {
        justify-content: flex-start;
    }
    .btn-clear-cart {
        width: 100%;
        justify-content: center;
    }
}