/* Tatbiki Peinture — charte Tatbiki : jaune / gris / noir sur fond blanc. Rouge = erreur, vert = WhatsApp. */
:root { --jaune: #FFCC00; --noir: #0F0F0F; --gris-fonce: #3A3A3A; --gris: #8A8A8A; --gris-clair: #EDEDED; --bord: #D0D0D0;
  --fond: #FFFFFF; --danger: #C62828; --whatsapp: #25D366; --rayon: 14px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif; background: var(--fond); color: var(--noir); padding-bottom: 90px; }
button, input, textarea, select { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* En-tête (charte § 3) : ☰ + logo à gauche, titre au centre, langues à droite — même ordre en arabe */
.barre { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 6px;
  padding: 8px 8px; background: #F5F5F2; border-bottom: 1px solid var(--bord); direction: ltr; }
.gauche-entete { display: flex; align-items: center; gap: 6px; min-width: 0; }
.logo-tatbiki { height: 32px; width: auto; }
@media (max-width: 380px) { .logo-tatbiki { height: 26px; } .barre h1 { font-size: .9rem; } .langue { min-width: 28px; padding: 0 4px; } }
.barre h1 { margin: 0; font-size: 1.05rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-icone { min-width: 44px; min-height: 44px; font-size: 1.4rem; border: 1.5px solid var(--noir); border-radius: 12px; background: #FFF; cursor: pointer; }
.langues { justify-self: end; display: flex; gap: 2px; min-width: 0; }
.langue { min-width: 34px; min-height: 36px; border: 1.5px solid var(--bord); background: #FFF; border-radius: 8px; font-weight: 700; cursor: pointer; padding: 0 6px; }
.langue.actif { background: var(--jaune); border-color: var(--noir); }

main { max-width: 980px; margin: 0 auto; padding: 14px; outline: none; }

/* Flèche retour (charte § 4) : jaune, contour noir */
.btn-retour-jaune { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 2px solid var(--noir); cursor: pointer;
  background: var(--jaune); color: var(--noir); font-size: 1.5rem; font-weight: 900; line-height: 1; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; }
[dir="rtl"] .btn-retour-jaune { transform: scaleX(-1); }
.tete-page { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tete-page h2 { margin: 0; font-size: 1.25rem; }

/* Accueil */
.bandeau { background: var(--noir); color: #FFF; border-radius: var(--rayon); padding: 18px 16px; margin-bottom: 14px; }
.bandeau p { margin: 0; font-size: 1.15rem; font-weight: 700; }
.bandeau .origine { display: inline-block; margin-top: 8px; background: var(--jaune); color: var(--noir); padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.categories { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.categorie { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--bord); background: #FFF; font-weight: 700; cursor: pointer; }
.categorie.actif { background: var(--jaune); border-color: var(--noir); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.carte-produit { display: flex; flex-direction: column; border: 1.5px solid var(--bord); border-radius: var(--rayon); overflow: hidden; text-decoration: none; background: #FFF; }
.carte-produit .vignette, .fiche .vignette { aspect-ratio: 1; background: var(--gris-clair); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.carte-produit img, .fiche img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #FFF; display: block; }
.carte-produit .infos { padding: 10px; }
.carte-produit .nom { font-weight: 700; margin: 0 0 4px; font-size: .95rem; }
.prix { font-weight: 800; font-size: 1.1rem; }
.petit { color: var(--gris-fonce); font-size: .85rem; }

/* Fiche produit */
.fiche { display: grid; gap: 14px; }
@media (min-width: 720px) { .fiche { grid-template-columns: 1fr 1fr; } }
.fiche .photos { display: grid; gap: 8px; }
.fiche h3 { margin: 0; font-size: 1.3rem; }
.fiche .desc { white-space: pre-line; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: var(--rayon);
  border: 2px solid var(--noir); background: var(--jaune); color: var(--noir); font-weight: 800; cursor: pointer; text-decoration: none; width: 100%; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn-gris { background: #FFF; }
.btn-whatsapp { background: var(--whatsapp); border-color: var(--whatsapp); color: #FFF; }

/* Panier */
.ligne-panier { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--gris-clair); }
.qte { display: inline-flex; align-items: center; gap: 6px; }
.qte button { width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--noir); background: #FFF; font-weight: 800; cursor: pointer; }
.lien-retirer { background: none; border: none; color: var(--gris-fonce); text-decoration: underline; cursor: pointer; padding: 0; }
.total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.15rem; margin: 14px 0; }

/* Formulaire */
form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 700; }
input[type=text], input[type=tel], textarea { width: 100%; min-height: 50px; padding: 10px 12px; border: 2px solid var(--bord); border-radius: 12px; background: #FFF; }
input:focus, textarea:focus { outline: none; border-color: var(--noir); }
fieldset { border: 2px solid var(--bord); border-radius: var(--rayon); padding: 10px 12px; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 800; padding: 0 6px; }
.choix { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1.5px solid var(--bord); border-radius: 12px; cursor: pointer; font-weight: 400; }
.choix:has(input:checked) { border-color: var(--noir); background: #FFF8D6; }
.choix input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--noir); }
.choix strong { display: block; }
.case { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.case input { width: 22px; height: 22px; flex: none; accent-color: var(--noir); }
.erreur { color: var(--danger); font-weight: 700; margin: 0; }
.info { background: var(--gris-clair); border-radius: 12px; padding: 10px 12px; margin: 0; }
.succes { background: #FFF8D6; border: 2px solid var(--jaune); border-radius: 12px; padding: 10px 12px; font-weight: 700; margin: 0; }
.encadre { border: 2px solid var(--noir); border-radius: var(--rayon); padding: 14px; display: grid; gap: 10px; margin-bottom: 14px; }
.montant { font-size: 1.6rem; font-weight: 900; }
.instructions { white-space: pre-line; }

/* Panier flottant */
.panier-flottant { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 9; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; border-radius: 999px; background: var(--noir); color: #FFF;
  font-weight: 800; text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.pastille { background: var(--jaune); color: var(--noir); border-radius: 999px; padding: 1px 9px; }

/* Menu (charte § 5, 16, 29 — sans liste d'applis : site boutique isolé) */
.voile { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
.panneau { position: fixed; top: 0; bottom: 0; left: 0; width: min(330px, 88vw); background: #FFF; z-index: 21; padding: 12px; overflow-y: auto; display: grid; align-content: start; gap: 12px; }
[dir="rtl"] .panneau { left: auto; right: 0; }
.panneau-tete { display: flex; align-items: center; gap: 12px; }
.panneau-tete h2 { margin: 0; }
.groupe { border: 2px solid; border-radius: var(--rayon); padding: 6px; display: grid; gap: 4px; }
.groupe-bleu { background: #C9DCFF; border-color: #A9C5F8; }
.groupe-menthe { background: #B8E8E0; border-color: #94D6CB; }
.groupe a { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 8px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.groupe a::before { content: attr(data-tuile); width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center;
  background: #FFF; border: 1px solid var(--bord); border-radius: 10px; font-size: 1.3rem; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--gris-clair); font-weight: 700; font-size: .85rem; }
.badge.ok { background: var(--jaune); }
.liste-cgv { padding-inline-start: 20px; display: grid; gap: 8px; }
.encadre > .badge, .encadre > span > .badge { justify-self: start; }
