/* ==============================
   PAGE MES COMMANDES
================================ */

.liste-commandes {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
}

.commandes-filtres {
    display: flex;
    align-items: center;
    gap: 8px;

    margin: 20px 0;

    overflow-x: auto;
    padding-bottom: 5px;
}


.filtre-commande {
    flex-shrink: 0;

    padding: 8px 14px;

    border: 1px solid #ff0000;
    border-radius: 999px;

    background: white;
    color: #374151;

    cursor: pointer;

    font-size: 0.9rem;
    font-weight: 600;

    transition: 0.2s ease;
}


.filtre-commande:hover {
    background: #ffbcbc;
}


.filtre-commande.active {
    background: #ff0000;
    color: white;

    border-color: #ff0000;
}

.filtre-commandes-vide {
    margin: 25px 0;
    padding: 30px 20px;

    text-align: center;

    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 12px;

    color: #6b7280;
}

.filtre-commandes-vide[hidden] {
    display: none;
}

.filtre-commandes-vide i {
    display: block;

    margin-bottom: 10px;

    font-size: 32px;
}

.filtre-commandes-vide p {
    margin: 0;
}

/* barre de recherche */
.commandes-recherche {
    margin: 20px 0 15px;
}


.recherche-commande-box {
    display: flex;
    align-items: center;

    max-width: 500px;

    padding: 0 14px;

    background: white;

    border: 1px solid #d1d5db;
    border-radius: 10px;
}


.recherche-commande-box:focus-within {
    border-color: #111827;

    box-shadow:
        0 0 0 3px rgba(17, 24, 39, 0.08);
}


.recherche-commande-box > i {
    color: #6b7280;
}


#recherche-commande {
    flex: 1;

    padding: 12px 10px;

    border: none;
    outline: none;

    background: transparent;

    font-size: 0.95rem;
}


#effacer-recherche {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: transparent;
    color: #6b7280;

    cursor: pointer;
}


#effacer-recherche:hover {
    background: #f3f4f6;
    color: #111827;
}


#effacer-recherche[hidden] {
    display: none;
}

/* Carte commande */

.commande-historique {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 25px;

    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.08);

    border: 1px solid #eeeeee;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.commande-historique:hover {
    transform: translateY(-3px);

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12);
}


/* ==============================
   ENTÊTE
================================ */

.commande-historique-entete {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    padding-bottom: 15px;

    border-bottom:
        1px solid #eeeeee;
}


.commande-historique-entete strong {
    font-size: 1.05rem;
}


/* ==============================
   STATUT
================================ */

.commande-statut {
    display: inline-block;

    padding: 7px 13px;

    border-radius: 20px;

    font-size: 0.85rem;
    font-weight: 600;

    background: #fff3cd;
    color: #856404;

    white-space: nowrap;
}

.commande-statut {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;

    font-size: 0.85rem;
    font-weight: 700;
}


/* En attente */
.statut-attente {
    background: #fef3c7;
    color: #92400e;
}


/* Confirmée */
.statut-confirmee {
    background: #dbeafe;
    color: #1e40af;
}


/* En préparation */
.statut-preparation {
    background: #ede9fe;
    color: #6d28d9;
}


/* Expédiée */
.statut-expediee {
    background: #cffafe;
    color: #155e75;
}


/* Livrée */
.statut-livree {
    background: #dcfce7;
    color: #166534;
}


/* Annulée */
.statut-annulee {
    background: #fee2e2;
    color: #b91c1c;
}

/* ==============================
   PRODUITS
================================ */

.commande-historique-produits {
    padding: 15px 0;
}


.commande-produit {
    padding: 12px 0;

    border-bottom:
        1px solid #f0f0f0;
}


.commande-produit:last-child {
    border-bottom: none;
}


.commande-produit strong {
    display: block;

    margin-bottom: 5px;
}


/* ==============================
   PERSONNALISATION
================================ */

.commande-personnalisation {
    margin-top: 7px;

    padding: 8px 10px;

    background: #f7f7f7;

    border-radius: 6px;

    font-size: 0.9rem;
}


/* ==============================
   TOTAL
================================ */

.commande-historique-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    border-top: 1px solid #eeeeee;
    /* font-size: 1.1rem; */
    flex-wrap: wrap;
}

.commande-historique-montants {
    margin-top: 18px;
    padding-top: 15px;

    border-top: 1px solid #e5e7eb;
}


.commande-montant-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 9px;
}


.commande-montant-ligne span {
    color: #6b7280;
}


.commande-code-promo {
    padding: 4px 8px;

    border-radius: 6px;

    background: #dcfce7;
    color: #166534;

    font-size: 0.85rem;
}


.commande-reduction {
    color: #15803d;
}


.commande-reduction span {
    color: #15803d;
}


.commande-total-paye {
    margin-top: 12px;
    padding-top: 12px;

    border-top: 1px solid #e5e7eb;

    font-size: 1.05rem;
}


.commande-total-paye span {
    color: #111827;
    font-weight: 700;
}


.commande-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}


/* ==============================
   CHARGEMENT / PANIER VIDE
================================ */

#commandes-chargement,
#commandes-vide {
    max-width: 900px;

    margin: 40px auto;

    padding: 30px 20px;

    text-align: center;
}


#commandes-vide h2 {
    margin-bottom: 10px;
}


#commandes-vide p {
    margin-bottom: 25px;
}


/* ==============================
    BOUTTON DETAIL
=============================== */
.btn-voir-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 9px 14px;

    border: 1px solid #111827;
    border-radius: 8px;

    background: white;
    color: #111827;

    text-decoration: none;
    font-weight: 600;

    transition: 0.2s ease;
}


.btn-voir-detail:hover {
    background: #f3f4f6;
    color: #111827;

    transform: translateY(-1px);
}


/* ==============================
    BOUTTON FACTURE
=============================== */
.btn-voir-facture {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 9px 14px;

    border-radius: 8px;

    background: #ff0000;
    color: white;

    text-decoration: none;
    font-weight: 600;

    transition: 0.2s ease;
}

.btn-voir-facture:hover {
    transform: translateY(-1px);
    opacity: 0.9;
    color: white;
}

/* ==============================
   RESPONSIVE
================================ */

@media (max-width: 600px) {

    .liste-commandes {
        padding: 0 12px;
    }


    .commande-historique {
        padding: 16px;
    }


    .commande-historique-entete {
        flex-direction: column;
        align-items: flex-start;
    }


    .commande-historique-total {
        justify-content: flex-start;
    }
}

/* =====================================
    CSS DES STATUS DE SUIVIS
====================================== */
.commande-suivi-container {
    margin: 20px 0;
    padding: 18px;

    background: #f8fafc;
    border-radius: 12px;
}


.suivi-commande {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    position: relative;

    gap: 10px;
}


/* Ligne située derrière les étapes */
.suivi-commande:not(.suivi-annulee)::before {
    content: "";

    position: absolute;

    top: 11px;
    left: 8%;
    right: 8%;

    height: 2px;

    background: #d1d5db;

    z-index: 0;
}


.suivi-etape {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    align-items: center;

    width: 25%;

    text-align: center;

    color: #9ca3af;

    font-size: 13px;
}


.suivi-etape i {
    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 8px;

    background: #f8fafc;

    font-size: 22px;
}


/* Étape déjà terminée */
.suivi-etape.terminee {
    color: #15803d;
}

.suivi-etape.terminee i {
    color: #15803d;
}


/* Étape actuelle */
.suivi-etape.active {
    color: #166534;
    font-weight: 700;
}

.suivi-etape.active i {
    color: #16a34a;
}


/* Commande annulée */
.suivi-annulee {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 12px;

    background: #fee2e2;
    color: #b91c1c;

    border-radius: 8px;

    font-weight: 700;
}

.suivi-annulee i {
    font-size: 20px;
}

@media (max-width: 600px) {

    .suivi-commande:not(.suivi-annulee) {
        flex-direction: column;
        align-items: flex-start;

        gap: 14px;
    }


    .suivi-commande:not(.suivi-annulee)::before {
        top: 10px;
        bottom: 10px;

        left: 10px;
        right: auto;

        width: 2px;
        height: auto;
    }


    .suivi-etape {
        width: 100%;

        flex-direction: row;
        align-items: center;

        gap: 10px;

        text-align: left;
    }


    .suivi-etape i {
        margin-bottom: 0;

        background: #f8fafc;
    }
}

