/* =====================================================
   MON MAGASIN HAÏTI
   DESIGN MODERNE ET RESPONSIVE
   ===================================================== */

/* 1. CONFIGURATION GÉNÉRALE */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primaire: #123c69;
    --primaire-fonce: #0b2745;
    --secondaire: #f0a500;
    --fond: #f4f7fb;
    --blanc: #ffffff;
    --texte: #253247;
    --texte-clair: #68778d;
    --bordure: #e1e7ef;
    --succes: #168653;
    --danger: #d9363e;
    --ombre: 0 8px 25px rgba(22, 43, 77, 0.08);
    --rayon: 14px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--fond);
    color: var(--texte);
    min-height: 100vh;
    line-height: 1.6;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

img {
    max-width: 100%;
}

/* =====================================================
   2. EN-TÊTE
   ===================================================== */

.header {
    background: linear-gradient(
        135deg,
        var(--primaire-fonce),
        var(--primaire)
    );
    color: var(--blanc);
    padding: 22px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
    box-shadow: 0 4px 18px rgba(11, 39, 69, 0.18);
}

.logo {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: var(--blanc);
}

.logo::first-letter {
    color: var(--secondaire);
}

/* =====================================================
   3. NAVIGATION
   ===================================================== */

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    color: var(--blanc);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 17px;
    border-radius: 9px;
    font-weight: 600;
    transition: background 0.25s, transform 0.25s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--secondaire);
    color: #17202d;
    border-color: var(--secondaire);
}

/* =====================================================
   4. SECTIONS
   ===================================================== */

.page-section {
    display: none;
    width: 100%;
    max-width: 1450px;
    margin: 0 auto;
    padding: 35px 5%;
}

.page-section.active-section {
    display: block;
    animation: apparition 0.3s ease;
}

@keyframes apparition {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 28px;
}

.section-header h1,
.section-header h2 {
    color: var(--primaire);
    font-size: 29px;
    margin-bottom: 8px;
    line-height: 1.3;
}

.section-header p {
    color: var(--texte-clair);
}

/* =====================================================
   5. LISTE DES PRODUITS
   ===================================================== */

.produits-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

.produit-card {
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-shadow: var(--ombre);
    transition: transform 0.25s, box-shadow 0.25s;
}

.produit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 30px rgba(22, 43, 77, 0.13);
}

/* Images des produits */

.produit-image {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #ffffff;
    padding: 12px;
}

div.produit-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--texte-clair);
    background: #edf2f8;
    font-size: 14px;
    text-align: center;
}

/* Contenu de la carte */

.produit-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.produit-content h3 {
    font-size: 18px;
    line-height: 1.4;
    color: var(--primaire-fonce);
    margin: 10px 0;
    overflow-wrap: anywhere;
}

.categorie {
    display: inline-block;
    align-self: flex-start;
    background: #eaf1fc;
    color: var(--primaire);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.description {
    color: var(--texte-clair);
    font-size: 14px;
    margin-bottom: 14px;
    overflow-wrap: anywhere;
}

.prix {
    color: var(--succes);
    font-size: 21px;
    font-weight: 800;
    margin: 8px 0;
}

.stock {
    font-size: 13px;
    color: var(--texte-clair);
    margin-bottom: 16px;
}

/* Boutons des produits */

.produit-card button,
.btn-ajouter {
    background: var(--primaire);
    color: var(--blanc);
    border: none;
    border-radius: 9px;
    padding: 12px 15px;
    font-weight: 700;
    width: 100%;
    margin-top: auto;
    transition: background 0.2s, transform 0.2s;
}

.produit-card button:hover:not(:disabled),
.btn-ajouter:hover:not(:disabled) {
    background: var(--primaire-fonce);
    transform: translateY(-1px);
}

/* =====================================================
   6. PANIER
   ===================================================== */

#listePanier {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panier-item {
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 4px 15px rgba(22, 43, 77, 0.04);
}

.panier-info {
    flex: 1;
    min-width: 180px;
}

.panier-info h3 {
    color: var(--primaire);
    font-size: 18px;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.panier-info p {
    color: var(--texte-clair);
    font-size: 14px;
    margin: 3px 0;
}

.panier-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.quantite-btn {
    width: 38px;
    height: 38px;
    background: #eaf1fc;
    color: var(--primaire);
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
}

.quantite-btn:hover {
    background: #d7e5fb;
}

.btn-supprimer {
    background: #fff0f0;
    color: var(--danger);
    border: 1px solid #ffd2d2;
    padding: 9px 13px;
    border-radius: 8px;
    font-weight: 700;
}

.btn-supprimer:hover {
    background: #ffe0e0;
}

.total-panier {
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    margin-top: 24px;
    padding: 25px;
    text-align: right;
    box-shadow: var(--ombre);
    font-size: 23px;
    font-weight: 800;
    color: var(--primaire);
}

/* =====================================================
   7. FORMULAIRES
   ===================================================== */

form {
    width: 100%;
}

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

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

.form-group input,
.form-group select,
.form-group textarea,
input,
select,
textarea {
    max-width: 100%;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 14px;
    background: var(--blanc);
    border: 1px solid #ccd6e3;
    border-radius: 9px;
    outline: none;
    color: var(--texte);
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primaire);
    box-shadow: 0 0 0 3px rgba(18, 60, 105, 0.1);
}

.form-group input[readonly] {
    background: #edf1f6;
    color: var(--texte-clair);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.button-row button,
form button[type="submit"] {
    background: var(--primaire);
    color: var(--blanc);
    border: none;
    border-radius: 9px;
    padding: 13px 22px;
    font-weight: 700;
    transition: background 0.2s;
}

.button-row button:hover:not(:disabled),
form button[type="submit"]:hover:not(:disabled) {
    background: var(--primaire-fonce);
}

/* =====================================================
   8. COMMANDE
   ===================================================== */

#section-commande form {
    max-width: 850px;
    margin: 0 auto;
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 30px;
    box-shadow: var(--ombre);
}

#section-commande .section-header {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

/* =====================================================
   9. ADMINISTRATION
   ===================================================== */

.admin-panel {
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 25px;
    margin-top: 25px;
    box-shadow: var(--ombre);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.admin-header h2 {
    color: var(--primaire);
}

.admin-card {
    background: #f8fafd;
    border: 1px solid var(--bordure);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 25px;
}

.admin-card h2,
.admin-card h3 {
    color: var(--primaire);
    margin-bottom: 18px;
}

.admin-produit {
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-radius: 11px;
    padding: 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
}

.admin-produit h3 {
    color: var(--primaire);
    margin-bottom: 7px;
    overflow-wrap: anywhere;
}

.admin-produit p {
    color: var(--texte-clair);
    font-size: 14px;
    margin: 4px 0;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.admin-actions button {
    background: #eaf1fc;
    color: var(--primaire);
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
}

.admin-actions button:hover {
    background: #d7e5fb;
}

#btnDeconnexion {
    background: var(--danger);
    color: var(--blanc);
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    font-weight: 700;
}

#btnDeconnexion:hover {
    background: #b92b32;
}

#connexionAdmin {
    max-width: 500px;
    margin: 25px auto;
    background: var(--blanc);
    padding: 30px;
    border-radius: var(--rayon);
    border: 1px solid var(--bordure);
    box-shadow: var(--ombre);
}

/* =====================================================
   10. COMMANDES ADMINISTRATEUR
   ===================================================== */

#listeCommandes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.commande-card {
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-top: 4px solid var(--primaire);
    border-radius: 12px;
    padding: 22px;
    min-width: 0;
    box-shadow: 0 5px 18px rgba(22, 43, 77, 0.06);
    overflow-wrap: anywhere;
}

.commande-card h3 {
    color: var(--primaire);
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bordure);
}

.commande-card p {
    font-size: 14px;
    margin-bottom: 9px;
    line-height: 1.6;
}

.commande-card strong {
    color: var(--primaire-fonce);
}

.commande-card .form-group {
    margin-top: 18px;
}

.commande-card button {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 8px;
    background: var(--primaire);
    color: var(--blanc);
    font-weight: 700;
    margin-top: 10px;
}

.commande-card button:hover {
    background: var(--primaire-fonce);
}

/* =====================================================
   11. MESSAGES
   ===================================================== */

.message {
    padding: 14px 16px;
    margin: 15px 0;
    border-radius: 9px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.message.succes {
    background: #e8f8ef;
    border: 1px solid #b8e8cb;
    color: #126b3d;
}

.message.erreur {
    background: #fff0f0;
    border: 1px solid #ffd0d0;
    color: #b4232b;
}

.message.info {
    background: #edf5ff;
    border: 1px solid #c8ddfa;
    color: #174f88;
}

.hidden {
    display: none !important;
}

.vide {
    background: var(--blanc);
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 35px 20px;
    text-align: center;
    color: var(--texte-clair);
}

/* =====================================================
   12. RESPONSIVE : PETITS ORDINATEURS
   ===================================================== */

@media (max-width: 1200px) {
    .produits-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #listeCommandes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =====================================================
   13. RESPONSIVE : TABLETTES
   ===================================================== */

@media (max-width: 850px) {
    .header {
        justify-content: center;
        text-align: center;
        padding: 20px;
    }

    .logo {
        font-size: 24px;
    }

    nav {
        justify-content: center;
    }

    .page-section {
        padding: 28px 4%;
    }

    .produits-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 17px;
    }

    #listeCommandes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .produit-image {
        height: 190px;
    }

    .produit-content {
        padding: 15px;
    }

    .produit-content h3 {
        font-size: 16px;
    }

    .prix {
        font-size: 19px;
    }

    #section-commande form {
        padding: 23px;
    }
}

/* =====================================================
   14. RESPONSIVE : TÉLÉPHONES
   ===================================================== */

@media (max-width: 550px) {
    .header {
        padding: 18px 12px;
        gap: 15px;
    }

    .logo {
        font-size: 21px;
    }

    nav {
        width: 100%;
        gap: 7px;
    }

    .nav-btn {
        flex: 1 1 40%;
        padding: 10px 8px;
        font-size: 13px;
    }

    .page-section {
        padding: 23px 13px;
    }

    .section-header h1,
    .section-header h2 {
        font-size: 24px;
    }

    .produits-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .produit-image {
        height: 230px;
    }

    .produit-content {
        padding: 18px;
    }

    .produit-content h3 {
        font-size: 18px;
    }

    .panier-item {
        padding: 17px;
        align-items: stretch;
    }

    .panier-actions {
        justify-content: flex-start;
    }

    .total-panier {
        padding: 19px;
        font-size: 20px;
    }

    .form-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    #section-commande form {
        padding: 19px 15px;
    }

    .admin-panel {
        padding: 16px;
    }

    .admin-card {
        padding: 17px;
    }

    .admin-produit {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-actions {
        width: 100%;
    }

    .admin-actions button {
        flex: 1;
    }

    #listeCommandes {
        grid-template-columns: minmax(0, 1fr);
    }

    .commande-card {
        padding: 18px;
    }

    #connexionAdmin {
        padding: 22px 16px;
    }
}

/* =====================================================
   15. ACCESSIBILITÉ
   ===================================================== */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(240, 165, 0, 0.65);
    outline-offset: 2px;
}
/* =========================================
   PAGE ACCUEIL — MON MAGASIN HAÏTI
========================================= */

#section-accueil {
    padding: 30px 20px;
}

.accueil-hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
    gap: 35px;
    padding: 55px 45px;
    border-radius: 24px;
    background: linear-gradient(135deg, #e8f3ff, #e8fff1);
    border: 1px solid #c9e2f5;
    box-shadow: 0 12px 35px rgba(18, 60, 105, 0.08);
}

.accueil-badge {
    display: inline-block;
    margin-bottom: 20px;
    padding: 9px 15px;
    border-radius: 30px;
    background: #d4f5e1;
    color: #17643b;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

.accueil-contenu h1 {
    margin-bottom: 20px;
    color: #123c69;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.2;
}

.accueil-contenu h1 span {
    display: block;
    margin-top: 8px;
    color: #168653;
}

.accueil-description {
    max-width: 600px;
    margin-bottom: 28px;
    color: #435466;
    font-size: 17px;
    line-height: 1.8;
}

.accueil-boutons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-accueil {
    padding: 14px 22px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-accueil:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn-produits {
    background: #123c69;
    color: white;
}

.btn-panier {
    background: #d4f5e1;
    color: #17643b;
    border: 1px solid #a9dfbf;
}

.accueil-illustration {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    border: 1px solid #c8e7d4;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.75);
}

.accueil-icone {
    margin-bottom: 15px;
    font-size: 100px;
}

.accueil-illustration h2 {
    margin-bottom: 10px;
    color: #123c69;
    font-size: 23px;
}

.accueil-illustration p {
    color: #526476;
    line-height: 1.6;
}

.accueil-avantages {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.avantage-card {
    padding: 25px;
    border: 1px solid #c8def5;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 5px 18px rgba(18, 60, 105, 0.05);
}

.avantage-icone {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 35px;
}

.avantage-card h3 {
    margin-bottom: 10px;
    color: #123c69;
    font-size: 18px;
}

.avantage-card p {
    color: #526476;
    font-size: 14px;
    line-height: 1.7;
}

/* NAVIGATION */

.nav-btn.active {
    background: #168653;
    color: #ffffff;
}

/* AFFICHAGE SUR TELEPHONE */

@media (max-width: 768px) {
    #section-accueil {
        padding: 18px 10px;
    }

    .accueil-hero {
        grid-template-columns: 1fr;
        padding: 30px 20px;
        gap: 25px;
    }

    .accueil-contenu h1 {
        font-size: 32px;
    }

    .accueil-description {
        font-size: 15px;
    }

    .accueil-illustration {
        min-height: 220px;
    }

    .accueil-icone {
        font-size: 75px;
    }

    .accueil-avantages {
        grid-template-columns: 1fr;
    }

    .btn-accueil {
        width: 100%;
    }
}
/* date de commande */

#dateCommande {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #b8d2ef;
    border-radius: 8px;
    background: #ffffff;
    color: #123c69;
    font-size: 15px;
}

#dateCommande[readonly] {
    background: #e3effc;
    color: #174f88;
    font-weight: bold;
    cursor: default;
}

/* ==========================================
   MENU BURGER MOBILE
========================================== */

.menu-burger {
    display: none;
    border: none;
    background: #168653;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

/* Téléphones et tablettes */

@media (max-width: 768px) {

    .header {
        position: relative;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding: 16px;
    }

    .logo {
        font-size: 21px;
    }

    .menu-burger {
        display: block;
        flex-shrink: 0;
    }

    .navigation {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 8px;
    }

    .navigation.menu-ouvert {
        display: flex;
    }

    .navigation .nav-btn {
        width: 100%;
        flex: none;
        text-align: left;
        padding: 12px 14px;
        font-size: 15px;
    }
}

/* Ordinateur : conserver la navigation habituelle */

@media (min-width: 769px) {

    .menu-burger {
        display: none;
    }

    .navigation {
        display: flex;
    }
}
