/* =====================================================================
   MaBoutique : feuille de style
   Les couleurs et les tailles sont définies une seule fois ici (:root).
   Pour changer l'allure du site, modifie ces valeurs.
   ===================================================================== */

:root {
    /* Couleurs */
    --fond: #F4F6FB;          /* fond de page : gris perle légèrement bleuté */
    --surface: #FFFFFF;       /* cartes et panneaux */
    --encre: #101938;         /* texte principal et boutons : bleu nuit */
    --encre-douce: #3B4468;   /* texte secondaire */
    --discret: #646C8C;       /* textes d'appoint */
    --ligne: #E2E6F1;         /* fines bordures */
    --ligne-forte: #CDD3E4;

    --marque: #F60238;        /* le rouge du logo */
    --marque-fonce: #C9002D;
    --marque-halo: rgba(246, 2, 56, 0.14);

    --vert: #13803F;
    --vert-fond: #E3F5EA;
    --whatsapp: #14833F;
    --whatsapp-fonce: #0F6B33;
    --ambre: #8A5B00;
    --ambre-fond: #FFEFCF;
    --rouge: #B4162F;
    --rouge-fond: #FDE6EA;

    /* Formes */
    --rayon-carte: 22px;
    --rayon-panneau: 20px;
    --rayon-champ: 12px;
    --ombre: 0 1px 2px rgba(16, 25, 56, 0.05), 0 12px 28px -14px rgba(16, 25, 56, 0.22);

    /* Police : une seule famille, plusieurs graisses */
    --police: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--police);
    font-size: 16px;
    line-height: 1.55;
    color: var(--encre);
    background: var(--fond);
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

h1 {
    font-size: clamp(2.1rem, 1.2rem + 3.6vw, 3.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

:focus-visible {
    outline: 3px solid var(--marque);
    outline-offset: 3px;
    border-radius: 6px;
}

.conteneur {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- En-tête ---------- */
.entete {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--ligne);
}

.entete-contenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
    white-space: nowrap;
}

.logo span {
    color: var(--marque);
}

/* Onglets de la partie commerçant */
.onglets {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--fond);
    border-radius: 999px;
    overflow-x: auto;
}

.onglet {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--encre-douce);
    text-decoration: none;
    white-space: nowrap;
}

.onglet:hover {
    color: var(--encre);
}

.onglet.actif {
    background: var(--surface);
    color: var(--encre);
    box-shadow: 0 1px 3px rgba(16, 25, 56, 0.12);
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: 1.5px solid var(--encre);
    border-radius: 999px;
    background: var(--encre);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    min-height: 44px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn:hover {
    background: var(--marque);
    border-color: var(--marque);
}

.btn svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.btn-clair {
    background: var(--surface);
    color: var(--encre);
    border-color: var(--ligne-forte);
}

.btn-clair:hover {
    background: var(--surface);
    color: var(--marque);
    border-color: var(--marque);
}

.btn-whatsapp {
    background: var(--whatsapp);
    border-color: var(--whatsapp);
}

.btn-whatsapp:hover {
    background: var(--whatsapp-fonce);
    border-color: var(--whatsapp-fonce);
}

.btn-danger {
    background: var(--surface);
    color: var(--rouge);
    border-color: #F0B5BF;
}

.btn-danger:hover {
    background: var(--rouge);
    border-color: var(--rouge);
    color: #fff;
}

.btn-petit {
    padding: 8px 16px;
    min-height: 40px;
    font-size: 0.85rem;
}

.btn-bloc {
    width: 100%;
}

.btn-desactive {
    background: var(--fond);
    border-color: var(--ligne);
    color: var(--discret);
    cursor: not-allowed;
}

.btn-desactive:hover {
    background: var(--fond);
    border-color: var(--ligne);
}

/* ---------- Page d'accueil : introduction ---------- */
.hero {
    padding-top: 64px;
    padding-bottom: 40px;
}

.hero h1 {
    max-width: 22ch;
}

.hero-texte {
    margin-top: 18px;
    max-width: 52ch;
    font-size: 1.1rem;
    color: var(--encre-douce);
}

.etapes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
    margin-bottom: 40px;
    list-style: none;
}

.etapes li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 10px 10px;
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
}

.etape-num {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--encre);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ---------- Catalogue ---------- */
.barre-outils {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.recherche {
    position: relative;
    width: 100%;
    max-width: 340px;
}

.recherche svg {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--discret);
    pointer-events: none;
}

.recherche input {
    width: 100%;
    padding: 12px 18px 12px 44px;
    border: 1.5px solid var(--ligne-forte);
    border-radius: 999px;
    background: var(--surface);
    font-family: inherit;
    font-size: 1rem;
    color: var(--encre);
}

.recherche input:focus {
    outline: none;
    border-color: var(--marque);
    box-shadow: 0 0 0 4px var(--marque-halo);
}

.grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.carte {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: var(--rayon-carte);
    box-shadow: var(--ombre);
}

.carte-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #E9ECF6, #F6F7FC);
}

.carte-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.carte:hover .carte-image img {
    transform: scale(1.05);
}

.sans-photo {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--ligne-forte);
}

.sans-photo svg {
    width: 56px;
    height: 56px;
}

.badge-stock {
    position: absolute;
    top: 14px;
    left: 14px;
    background-color: rgba(255, 255, 255, 0.94);
}

.carte-corps {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
    padding: 20px 22px 22px;
}

.carte-titre {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.description {
    font-size: 0.9rem;
    color: var(--discret);
}

.carte-corps .description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(2 * 1.55em);
}

.prix {
    margin: 8px 0 14px;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.carte-corps .btn {
    margin-top: auto;
}

.vide {
    padding: 48px 24px;
    text-align: center;
    color: var(--discret);
    background: var(--surface);
    border: 1px dashed var(--ligne-forte);
    border-radius: var(--rayon-panneau);
}

/* ---------- Pastilles de statut ---------- */
.pastille {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.pastille::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.pastille.dispo {
    color: var(--vert);
    background: var(--vert-fond);
}

.pastille.rupture {
    color: var(--rouge);
    background: var(--rouge-fond);
}

.pastille.attente {
    color: var(--ambre);
    background: var(--ambre-fond);
}

.badge-stock.dispo {
    background: rgba(255, 255, 255, 0.94);
}

.badge-stock.rupture {
    background: rgba(255, 255, 255, 0.94);
}

/* ---------- Pages internes ---------- */
.page {
    padding-top: 40px;
    padding-bottom: 72px;
}

.lien-retour {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--discret);
    text-decoration: none;
}

.lien-retour:hover {
    color: var(--marque);
}

.page h1 {
    font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.5rem);
    margin-bottom: 28px;
}

.titre-page {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.titre-page h1 {
    margin-bottom: 0;
}

.deux-colonnes {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 28px;
    align-items: start;
}

.panneau {
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: var(--rayon-panneau);
    box-shadow: var(--ombre);
}

.panneau h2 {
    margin-bottom: 20px;
}

.panneau-centre {
    max-width: 480px;
    margin: 0 auto;
}

.recap .carte-corps {
    gap: 4px;
}

.recap .prix {
    margin-bottom: 8px;
}

.erreur {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--rouge-fond);
    color: var(--rouge);
    border-radius: var(--rayon-champ);
    font-size: 0.92rem;
    font-weight: 600;
}

/* ---------- Formulaires ---------- */
.formulaire {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.champ {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.champ label {
    font-size: 0.9rem;
    font-weight: 600;
}

.champ input,
.champ textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--ligne-forte);
    border-radius: var(--rayon-champ);
    background: var(--surface);
    font-family: inherit;
    font-size: 1rem;
    color: var(--encre);
}

.champ textarea {
    resize: vertical;
}

.champ input:focus,
.champ textarea:focus {
    outline: none;
    border-color: var(--marque);
    box-shadow: 0 0 0 4px var(--marque-halo);
}

.champ-aide {
    font-size: 0.82rem;
    color: var(--discret);
}

.deux-champs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.boutons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.formulaire-produit {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 4fr);
    gap: 28px;
    align-items: start;
}

/* Zone de dépôt de la photo */
.zone-photo {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cadre-photo {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--fond);
    border: 2px dashed var(--ligne-forte);
    border-radius: 16px;
    color: var(--discret);
    text-align: center;
    font-size: 0.9rem;
}

.cadre-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cadre-photo .invite {
    padding: 16px;
}

.zone-photo input[type="file"] {
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--encre-douce);
}

.zone-photo input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 9px 16px;
    border: 1.5px solid var(--ligne-forte);
    border-radius: 999px;
    background: var(--surface);
    color: var(--encre);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* ---------- Confirmation de commande ---------- */
.confirmation {
    text-align: center;
}

.icone-ok {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--vert-fond);
    color: var(--vert);
}

.icone-ok svg {
    width: 32px;
    height: 32px;
}

.confirmation h1 {
    margin-bottom: 8px;
}

.confirmation .recapitulatif {
    margin: 24px 0;
    padding: 18px;
    background: var(--fond);
    border-radius: var(--rayon-champ);
    text-align: left;
}

.recapitulatif .prix {
    margin: 6px 0 0;
}

.confirmation .btn {
    width: 100%;
}

.confirmation .lien-retour {
    margin: 18px 0 0;
}

/* ---------- Tableaux (partie commerçant) ---------- */
.tableau {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: var(--rayon-panneau);
    box-shadow: var(--ombre);
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 18px;
    text-align: left;
    vertical-align: middle;
    font-size: 0.92rem;
}

th {
    background: #FAFBFE;
    border-bottom: 1px solid var(--ligne);
    color: var(--discret);
    font-size: 0.82rem;
    font-weight: 600;
}

td {
    border-bottom: 1px solid var(--ligne);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #FAFBFE;
}

td small {
    display: block;
    color: var(--discret);
}

.miniature {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--fond);
}

.sans-miniature {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--fond);
    color: var(--ligne-forte);
}

.sans-miniature svg {
    width: 24px;
    height: 24px;
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.actions .btn {
    padding: 8px 16px;
    min-height: 40px;
    font-size: 0.85rem;
}

/* ---------- Pied de page ---------- */
.pied {
    border-top: 1px solid var(--ligne);
    background: var(--surface);
}

.pied-contenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 24px;
    padding-bottom: 24px;
    font-size: 0.88rem;
    color: var(--discret);
}

.pied a {
    font-weight: 600;
    text-decoration: none;
}

.pied a:hover {
    color: var(--marque);
}

/* ---------- Petits écrans ---------- */
@media (max-width: 860px) {
    .deux-colonnes,
    .formulaire-produit {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .conteneur {
        padding: 0 16px;
    }

    .hero {
        padding-top: 40px;
    }

    .etapes li {
        width: 100%;
    }

    .entete-contenu {
        flex-wrap: wrap;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .onglets {
        order: 3;
        width: 100%;
    }

    .panneau {
        padding: 22px;
    }

    .deux-champs {
        grid-template-columns: 1fr;
    }

    .recherche {
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

.section-catalogue {
    padding-bottom: 72px;
}

/* =====================================================================
   Adaptation aux téléphones, tablettes et ordinateurs
   - ordinateur : 3 à 4 colonnes de produits
   - tablette   : 2 à 3 colonnes (la grille s'adapte seule)
   - téléphone  : 1 colonne, tableaux transformés en fiches
   ===================================================================== */

/* Encoches et barres des téléphones : on ne colle pas le contenu au bord */
.conteneur {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
}

/* Tablette */
@media (max-width: 1024px) {
    .hero {
        padding-top: 48px;
    }

    .grille {
        gap: 20px;
    }
}

/* Tablette portrait et petits écrans */
@media (max-width: 860px) {
    .recap .carte-image {
        aspect-ratio: 16 / 10;
    }

    .entete-contenu {
        flex-wrap: wrap;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .onglets {
        order: 3;
        width: 100%;
    }
}

/* Téléphone : les tableaux deviennent une fiche par ligne */
@media (max-width: 720px) {
    .tableau {
        overflow: visible;
        background: none;
        border: none;
        box-shadow: none;
    }

    table,
    tbody {
        display: block;
        min-width: 0;
    }

    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    tbody tr,
    tbody tr:hover {
        display: block;
        margin-bottom: 16px;
        padding: 6px 18px;
        background: var(--surface);
        border: 1px solid var(--ligne);
        border-radius: var(--rayon-panneau);
        box-shadow: var(--ombre);
    }

    td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 12px 0;
        text-align: right;
    }

    td::before {
        content: attr(data-label);
        flex: none;
        color: var(--discret);
        font-size: 0.82rem;
        font-weight: 600;
        text-align: left;
    }

    td[data-label=""] {
        justify-content: flex-start;
    }

    td[data-label=""]::before {
        display: none;
    }

    tbody tr:last-child td {
        border-bottom: 1px solid var(--ligne);
    }

    td:last-child,
    tbody tr:last-child td:last-child {
        border-bottom: none;
    }

    /* Boutons d'action : pleine largeur, faciles à toucher */
    .cellule-actions {
        display: block;
        text-align: left;
    }

    .cellule-actions .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cellule-actions .actions form,
    .cellule-actions .actions .btn {
        width: 100%;
    }

    .cellule-actions .actions .btn {
        min-height: 44px;
    }
}

/* Petit téléphone */
@media (max-width: 480px) {
    .conteneur {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .carte-corps {
        padding: 18px;
    }

    .boutons .btn {
        flex: 1 1 100%;
    }

    .titre-page .btn {
        width: 100%;
    }

    .pied-contenu {
        justify-content: center;
        text-align: center;
    }
}
/* ---------- Ajouts multi-vendeurs ---------- */
.succes {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--vert-fond);
    color: var(--vert);
    border-radius: var(--rayon-champ);
    font-size: 0.92rem;
    font-weight: 600;
}
.champ-aide a {
    color: var(--marque);
    font-weight: 600;
}

