/* =====================================================================
   Design system — Fournitures Scolaires ASIN
   Mobile-first, sobre, couleurs institutionnelles ASIN
   ===================================================================== */

:root {
    /* Couleurs ASIN */
    --asin-navy: #0A2540;
    --asin-navy-light: #123a63;
    --asin-emerald: #0F9D58;
    --asin-emerald-light: #12b968;
    --asin-gold: #D4AF37;

    --bg-page: #F7F8FA;
    --bg-card: #FFFFFF;
    --text-principal: #14213D;
    --text-secondaire: #6B7280;
    --border-subtile: #E5E8EC;

    --statut-attente: #F59E0B;
    --statut-succes: #0F9D58;
    --statut-danger: #DC2626;

    --radius-carte: 14px;
    --radius-bouton: 10px;
    --ombre-carte: 0 2px 10px rgba(10, 37, 64, 0.06);

    --hauteur-nav-bas: 64px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    color: var(--text-principal);
    padding-bottom: calc(var(--hauteur-nav-bas) + 12px);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* --- En-tête --- */
.entete-app {
    background: var(--asin-navy);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}
.entete-app .logo { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.2px; }
.entete-app .logo span { color: var(--asin-gold); }

/* --- Barre de recherche + filtres --- */
.barre-recherche {
    position: sticky;
    top: 56px;
    z-index: 15;
    background: var(--bg-page);
    padding: 12px 16px 8px;
}
.barre-recherche input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-bouton);
    border: 1px solid var(--border-subtile);
    background: var(--bg-card);
    font-family: inherit;
    font-size: 0.95rem;
}
.chips-categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px 4px;
    scrollbar-width: none;
}
.chips-categories::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtile);
    font-size: 0.85rem;
    color: var(--text-secondaire);
    white-space: nowrap;
}
.chip.actif {
    background: var(--asin-navy);
    color: #fff;
    border-color: var(--asin-navy);
}

/* --- Cartes produit --- */
.grille-produits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 16px;
}
.carte-produit {
    background: var(--bg-card);
    border-radius: var(--radius-carte);
    box-shadow: var(--ombre-carte);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.carte-produit .image-produit {
    aspect-ratio: 1 / 1;
    background: var(--bg-page);
    object-fit: cover;
    width: 100%;
}
.carte-produit .contenu { padding: 10px 12px 12px; }
.carte-produit .nom { font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
.carte-produit .prix { color: var(--asin-emerald); font-weight: 700; margin-top: 4px; }
.carte-produit .bouton-ajouter {
    margin-top: 8px;
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: var(--radius-bouton);
    background: var(--asin-navy);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

/* --- Boutons génériques --- */
.btn {
    display: inline-block;
    padding: 13px 20px;
    border-radius: var(--radius-bouton);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    text-align: center;
    cursor: pointer;
}
.btn-primaire { background: var(--asin-emerald); color: #fff; }
.btn-secondaire { background: var(--asin-navy); color: #fff; }
.btn-contour { background: transparent; border: 1.5px solid var(--asin-navy); color: var(--asin-navy); }
.btn-large { display: block; width: 100%; }

/* --- Badges de statut --- */
.badge-statut {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-en_attente { background: #FEF3C7; color: #92400E; }
.badge-validee, .badge-achat_en_cours { background: #DBEAFE; color: #1E40AF; }
.badge-achat_termine, .badge-en_livraison { background: #E0E7FF; color: #3730A3; }
.badge-livree { background: #D1FAE5; color: #065F46; }
.badge-annulee { background: #FEE2E2; color: #991B1B; }

/* --- Timeline de suivi --- */
.timeline-suivi { padding: 20px 16px; }
.etape-timeline {
    display: flex;
    gap: 14px;
    padding-bottom: 24px;
    position: relative;
}
.etape-timeline:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 26px;
    bottom: -4px;
    width: 2px;
    background: var(--border-subtile);
}
.etape-timeline.completee:not(:last-child)::before { background: var(--asin-emerald); }
.puce-timeline {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--border-subtile);
    flex-shrink: 0;
}
.etape-timeline.completee .puce-timeline { background: var(--asin-emerald); }
.etape-timeline.active .puce-timeline { background: var(--asin-gold); }

/* --- Navigation basse (mobile) --- */
.nav-basse {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--hauteur-nav-bas);
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtile);
    display: flex;
    z-index: 30;
}
.nav-basse a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.7rem;
    color: var(--text-secondaire);
}
.nav-basse a.actif { color: var(--asin-emerald); font-weight: 600; }

/* --- Cartes admin / tableaux --- */
.carte { background: var(--bg-card); border-radius: var(--radius-carte); box-shadow: var(--ombre-carte); padding: 16px; }
.table-simple { width: 100%; border-collapse: collapse; }
.table-simple th, .table-simple td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-subtile); font-size: 0.88rem; }
.table-simple th { color: var(--text-secondaire); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }

@media (min-width: 768px) {
    .grille-produits { grid-template-columns: repeat(4, 1fr); }
    body { padding-bottom: 20px; }
    .nav-basse { display: none; }
}
