/* ==========================================================================
   Ma Boutique — feuille de style unique (mobile d'abord, sans framework)
   ========================================================================== */

:root {
  --encre: #1f2a30;          /* texte principal / boutons */
  --encre-douce: #55626a;    /* texte secondaire (contraste AA sur fond clair) */
  --fond: #faf8f5;
  --surface: #ffffff;
  --ligne: #e6e1da;
  --accent: #b5476b;         /* promos, prix barrés */
  --succes: #1e7a46;
  --alerte: #b3261e;
  --avertissement: #8a5a00;
  --whatsapp: #1c8f4c;       /* vert WhatsApp assombri pour texte blanc lisible */
  --whatsapp-survol: #15753d;
  --rayon: 14px;
  --rayon-petit: 8px;
  --ombre: 0 2px 10px rgba(31, 42, 48, .08);
  --ombre-forte: 0 10px 30px rgba(31, 42, 48, .18);
  --largeur: 1180px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--police);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--encre);
  background: var(--fond);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

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

.container { width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 0 16px; }
.section { padding-top: 2rem; padding-bottom: 2rem; }
.etroit { max-width: 760px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sr-only-focusable:focus {
  position: fixed; top: 8px; left: 8px; z-index: 1000;
  width: auto; height: auto; margin: 0; clip: auto; overflow: visible;
  padding: .6rem 1rem; background: var(--encre); color: #fff; border-radius: var(--rayon-petit);
}

/* ---------- Bandeau + en-tête ---------- */
.bandeau {
  background: var(--encre); color: #fff; text-align: center;
  font-size: .85rem; padding: .45rem 16px;
}
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 245, .94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--ligne);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; text-decoration: none; margin: 0; }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  text-decoration: none; padding: .5rem .7rem; border-radius: 999px; font-weight: 500;
}
.nav a:hover { background: rgba(31, 42, 48, .06); }
.nav a[aria-current="page"] { background: var(--encre); color: #fff; }
.lien-panier { position: relative; font-size: 1.2rem; line-height: 1; }
.pastille {
  position: absolute; top: -2px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .8rem 1.4rem; min-height: 46px;
  border: 2px solid transparent; border-radius: 999px;
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-principal { background: var(--encre); color: #fff; }
.btn-principal:hover:not(:disabled) { background: #0f171b; }
.btn-secondaire { background: transparent; color: var(--encre); border-color: var(--encre); }
.btn-secondaire:hover:not(:disabled) { background: rgba(31, 42, 48, .06); }
.btn-clair { background: #fff; color: var(--encre); }
.btn-clair:hover { box-shadow: var(--ombre-forte); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover:not(:disabled) { background: var(--whatsapp-survol); }
.btn-large { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(181, 71, 107, .55), transparent 55%),
    linear-gradient(135deg, #1f2a30 0%, #34444d 100%);
  color: #fff; padding: 3.5rem 0 3rem;
}
.hero h1 { font-size: clamp(2rem, 7vw, 3.4rem); margin-bottom: .3em; }
.hero-slogan { font-size: 1.1rem; opacity: .9; max-width: 34ch; margin-bottom: 1.4rem; }

/* ---------- Catalogue : outils et filtres ---------- */
.barre-outils { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.barre-outils input, .barre-outils select {
  min-height: 46px; padding: .6rem .9rem;
  border: 1px solid var(--ligne); border-radius: 999px; background: var(--surface);
}
.barre-outils input { flex: 1 1 220px; min-width: 0; }
.barre-outils select { flex: 0 1 auto; }

.puces {
  display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .6rem;
  scrollbar-width: thin;
}
.puce {
  flex: 0 0 auto; padding: .45rem 1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ligne); background: var(--surface); font-weight: 500;
}
.puce:hover { border-color: var(--encre); }
.puce.active { background: var(--encre); color: #fff; border-color: var(--encre); }
.compteur { color: var(--encre-douce); font-size: .9rem; }

/* ---------- Grille et cartes produit ---------- */
.grille {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 720px) { .grille { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1024px) { .grille { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grille > .vide { grid-column: 1 / -1; }

.carte {
  background: var(--surface); border-radius: var(--rayon); overflow: hidden;
  box-shadow: var(--ombre); transition: transform .2s, box-shadow .2s;
}
.carte:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); }
.carte-lien { display: block; text-decoration: none; height: 100%; }
.carte-image { position: relative; aspect-ratio: 4 / 5; background: #f1ede7; }
.carte-image img { width: 100%; height: 100%; object-fit: cover; }
.carte.epuise .carte-image img { filter: grayscale(1); opacity: .6; }
.carte-corps { padding: .7rem .8rem 1rem; }
.carte-cat {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--encre-douce); margin-bottom: .2rem;
}
.carte-titre { font-size: .98rem; font-weight: 600; margin-bottom: .35rem; }

.badge {
  position: absolute; top: 10px; left: 10px;
  padding: .2rem .6rem; border-radius: 999px;
  background: var(--encre); color: #fff; font-size: .75rem; font-weight: 700;
}
.badge-promo { background: var(--accent); }
.badge-gris { background: #6b7378; }

.prix { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; margin: 0; }
.prix-actuel { font-weight: 700; }
.prix-barre { color: var(--encre-douce); font-size: .88em; }
.prix-grand { font-size: 1.5rem; margin-bottom: .4rem; }

.vide { text-align: center; color: var(--encre-douce); padding: 2.5rem 1rem; }
.vide .btn { margin-top: .6rem; }

/* ---------- Avantages ---------- */
.avantages {
  display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 900px) { .avantages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.avantages > div {
  background: var(--surface); border-radius: var(--rayon); padding: 1.1rem; box-shadow: var(--ombre);
}
.avantages span { font-size: 1.6rem; display: block; margin-bottom: .4rem; }
.avantages h3 { margin-bottom: .25rem; }
.avantages p { margin: 0; color: var(--encre-douce); font-size: .92rem; }

/* ---------- Fiche produit ---------- */
.fil-ariane { font-size: .88rem; color: var(--encre-douce); margin-bottom: 1rem; }
.fil-ariane a { color: var(--encre-douce); }
.fiche { display: grid; gap: 1.5rem; }
@media (min-width: 820px) { .fiche { grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; } }
.fiche-image {
  background: #f1ede7; border-radius: var(--rayon); overflow: hidden; aspect-ratio: 4 / 5;
}
.fiche-image img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 820px) { .fiche-image { position: sticky; top: 80px; } }

.stock { font-weight: 600; color: var(--succes); }
.stock-bas { color: var(--avertissement); }
.stock-epuise { color: var(--alerte); }

.choix { border: 0; padding: 0; margin: 0 0 1rem; }
.choix legend { font-weight: 600; margin-bottom: .45rem; }
.choix-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.option { position: relative; cursor: pointer; }
.option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.option span {
  display: inline-block; min-width: 48px; text-align: center;
  padding: .5rem .85rem; border: 1px solid var(--ligne); border-radius: var(--rayon-petit);
  background: var(--surface); font-weight: 500;
}
.option:hover span { border-color: var(--encre); }
.option input:checked + span { background: var(--encre); color: #fff; border-color: var(--encre); }
.option input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.ligne-quantite { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.ligne-quantite label { font-weight: 600; }
.ligne-quantite input {
  width: 80px; min-height: 44px; padding: .4rem .6rem;
  border: 1px solid var(--ligne); border-radius: var(--rayon-petit); background: var(--surface);
}
.actions-fiche { display: grid; gap: .6rem; }
@media (min-width: 480px) { .actions-fiche { grid-template-columns: 1fr 1fr; } }

.reassurance {
  list-style: none; padding: 1rem; margin: 1.4rem 0 0;
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre);
  display: grid; gap: .4rem; font-size: .92rem;
}

/* ---------- Formulaires ---------- */
.erreur { color: var(--alerte); font-weight: 600; min-height: 1.2em; margin: .4rem 0; }
.erreur:empty { min-height: 0; margin: 0; }
.astuce { color: var(--encre-douce); font-size: .9rem; }

.carte-formulaire {
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 1.2rem;
}
.carte-formulaire form { display: grid; gap: .35rem; }
.carte-formulaire label { font-weight: 600; margin-top: .5rem; }
.carte-formulaire input, .carte-formulaire select, .carte-formulaire textarea {
  width: 100%; min-height: 46px; padding: .65rem .8rem;
  border: 1px solid var(--ligne); border-radius: var(--rayon-petit); background: var(--fond);
  font-size: 16px; /* évite le zoom automatique sur iOS */
}
.carte-formulaire textarea { resize: vertical; }
.carte-formulaire .btn { margin-top: .4rem; }

.confirmation {
  margin-top: 1rem; padding: 1rem; border-radius: var(--rayon-petit);
  background: #e8f5ec; border: 1px solid #b9dfc6;
}

/* ---------- Panier ---------- */
.panier-layout { display: grid; gap: 1.5rem; }
@media (min-width: 900px) {
  .panier-layout { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); align-items: start; }
  .panier-layout .carte-formulaire { position: sticky; top: 80px; }
}
.ligne-panier {
  display: grid; grid-template-columns: 72px 1fr; gap: .8rem;
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: .8rem; margin-bottom: .8rem;
}
.ligne-panier img { width: 72px; height: 90px; object-fit: cover; border-radius: var(--rayon-petit); background: #f1ede7; }
.ligne-infos p { margin: 0; }
.ligne-nom { font-weight: 600; text-decoration: none; }
.ligne-nom:hover { text-decoration: underline; }
.ligne-details { color: var(--encre-douce); font-size: .88rem; }
.ligne-prix { font-weight: 700; margin-top: .2rem !important; }
.ligne-actions {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
@media (min-width: 560px) {
  .ligne-panier { grid-template-columns: 80px 1fr auto; align-items: center; }
  .ligne-panier img { width: 80px; height: 100px; }
  .ligne-actions { grid-column: auto; flex-direction: column; align-items: flex-end; }
}
.quantite {
  display: inline-flex; align-items: center;
  border: 1px solid var(--ligne); border-radius: 999px; overflow: hidden;
}
.quantite button {
  width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; font-size: 1.15rem;
}
.quantite button:hover { background: rgba(31, 42, 48, .06); }
.quantite span { min-width: 2ch; text-align: center; font-weight: 600; }
.lien-retirer {
  background: none; border: 0; padding: .3rem; cursor: pointer;
  color: var(--alerte); text-decoration: underline; font-size: .9rem;
}

.totaux {
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 1rem; margin: 0 0 .8rem;
}
.totaux div { display: flex; justify-content: space-between; padding: .3rem 0; }
.totaux dt, .totaux dd { margin: 0; }
.totaux .total { border-top: 1px solid var(--ligne); margin-top: .3rem; padding-top: .6rem; font-size: 1.15rem; font-weight: 700; }

/* ---------- Contact / FAQ ---------- */
.actions-contact { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 2rem; }
details {
  background: var(--surface); border-radius: var(--rayon-petit); box-shadow: var(--ombre);
  margin-bottom: .6rem; padding: 0 1rem;
}
summary {
  cursor: pointer; font-weight: 600; padding: .9rem 0; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.3rem; line-height: 1; transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--encre-douce); padding-bottom: .9rem; margin: 0; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--encre); color: #e8ecee; margin-top: 3rem; padding: 2rem 0 1rem; }
.site-footer a { color: #fff; }
.footer-inner { display: grid; gap: 1.2rem; }
@media (min-width: 640px) { .footer-inner { grid-template-columns: 2fr 1fr; } }
.footer-inner p { margin: 0 0 .35rem; }
.copyright {
  border-top: 1px solid rgba(255, 255, 255, .15);
  margin-top: 1.5rem; padding-top: 1rem; font-size: .85rem; color: #b8c2c7;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; z-index: 300;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--encre); color: #fff; padding: .75rem 1.2rem; border-radius: 999px;
  box-shadow: var(--ombre-forte); max-width: calc(100% - 32px); text-align: center;
  transition: opacity .25s, transform .25s;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Assistant (widget de discussion) ---------- */
.assistant { position: fixed; right: 16px; bottom: 16px; z-index: 200; }
.assistant-bouton {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.1rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--encre); color: #fff; font-weight: 600; box-shadow: var(--ombre-forte);
}
.assistant-bouton span[aria-hidden] { font-size: 1.2rem; line-height: 1; }
@media (max-width: 480px) { .assistant-bouton-texte { display: none; } .assistant-bouton { padding: .9rem; } }
.assistant.ouvert .assistant-bouton { display: none; }

.assistant-panneau {
  position: fixed; right: 16px; bottom: 16px;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 32px));
  height: min(560px, calc(100dvh - 32px));
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre-forte); overflow: hidden;
}
.assistant-entete {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: var(--encre); color: #fff; padding: .8rem 1rem;
}
.assistant-entete small { display: block; opacity: .8; font-size: .78rem; }
.assistant-fermer {
  background: none; border: 0; color: #fff; font-size: 1.6rem; line-height: 1;
  width: 40px; height: 40px; cursor: pointer; border-radius: 50%;
}
.assistant-fermer:hover { background: rgba(255, 255, 255, .12); }
.assistant-messages {
  flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem;
  background: var(--fond);
}
.bulle {
  max-width: 85%; padding: .6rem .85rem; border-radius: 16px;
  font-size: .94rem; overflow-wrap: anywhere;
}
.bulle-assistant { align-self: flex-start; background: var(--surface); box-shadow: var(--ombre); border-bottom-left-radius: 4px; }
.bulle-client { align-self: flex-end; background: var(--encre); color: #fff; border-bottom-right-radius: 4px; }
.en-attente { color: var(--encre-douce); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.mini-cartes { display: grid; gap: .4rem; margin-top: .5rem; }
.mini-carte {
  display: flex; align-items: center; gap: .6rem; text-decoration: none;
  padding: .4rem; border: 1px solid var(--ligne); border-radius: var(--rayon-petit); background: var(--fond);
}
.mini-carte:hover { border-color: var(--encre); }
.mini-carte img { width: 40px; height: 50px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }
.mini-carte span { font-size: .85rem; line-height: 1.35; }

.assistant-suggestions {
  display: flex; gap: .4rem; overflow-x: auto; padding: .5rem 1rem;
  background: var(--fond); border-top: 1px solid var(--ligne);
}
.assistant-suggestions button {
  flex: 0 0 auto; padding: .4rem .8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ligne); background: var(--surface); font-size: .84rem;
}
.assistant-suggestions button:hover { border-color: var(--encre); }
.assistant-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--ligne); }
.assistant-form input {
  flex: 1; min-width: 0; min-height: 44px; padding: .5rem .9rem;
  border: 1px solid var(--ligne); border-radius: 999px; font-size: 16px;
}
.assistant-form .btn { padding: 0; width: 44px; min-height: 44px; }

/* ---------- Préférences utilisateur ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Administration (admin.html) ---------- */
.btn-petit { min-height: 38px; padding: .45rem .9rem; font-size: .9rem; }
code { background: rgba(31, 42, 48, .07); padding: .05rem .35rem; border-radius: 4px; font-size: .9em; }
.admin-connexion { max-width: 440px; margin: 2rem auto; display: grid; gap: .6rem; }
.admin-connexion form { display: grid; gap: .35rem; }
.admin-titre { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; }
.admin-titre h1 { margin: 0; }

.admin-stats { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1.2rem; }
@media (min-width: 760px) { .admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.admin-stats > div { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); padding: .9rem 1rem; }
.admin-stats strong { display: block; font-size: 1.35rem; }
.admin-stats span { color: var(--encre-douce); font-size: .85rem; }

.admin-liste { display: grid; gap: 12px; margin-bottom: 1rem; }
.admin-commande {
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre);
  border-left: 5px solid var(--ligne); padding: 1rem;
}
.admin-commande p { margin: 0 0 .3rem; }
.admin-commande a { overflow-wrap: anywhere; }
.admin-commande-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; margin-bottom: .7rem; }
.admin-commande-entete .astuce { display: block; margin-top: .1rem; }
.admin-num { font-size: 1.05rem; }
.admin-commande-corps { display: grid; gap: .8rem; }
@media (min-width: 760px) { .admin-commande-corps { grid-template-columns: 1fr 1fr; } }
.admin-lignes { list-style: none; margin: 0 0 .4rem; padding: 0; display: grid; gap: .3rem; }
.admin-lignes li { display: flex; justify-content: space-between; gap: .8rem; }
.admin-montant { white-space: nowrap; font-weight: 600; }
.admin-total { border-top: 1px solid var(--ligne); padding-top: .4rem; }
.admin-commande-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem;
  border-top: 1px solid var(--ligne); margin-top: .8rem; padding-top: .8rem;
}
.admin-commande-actions label { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.admin-commande-actions select {
  min-height: 40px; padding: .35rem .6rem; border: 1px solid var(--ligne);
  border-radius: var(--rayon-petit); background: var(--fond);
}

.badge-statut { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.statut-nouvelle  { background: #fdecc8; color: #6b4500; }
.statut-confirmee { background: #dbe8fb; color: #1d4a8a; }
.statut-expediee  { background: #e9e0f7; color: #4b2a85; }
.statut-livree    { background: #dcf1e3; color: #155c33; }
.statut-annulee   { background: #ececec; color: #4a4f52; }
.statut-bord-nouvelle  { border-left-color: #e0a100; }
.statut-bord-confirmee { border-left-color: #3b78d0; }
.statut-bord-expediee  { border-left-color: #7d52c4; }
.statut-bord-livree    { border-left-color: #1e7a46; }
.statut-bord-annulee   { border-left-color: #9aa0a3; }
