/* RATTIB · charte web, palette « Tanneries de Fès » : garance, olive, ocre sur cuir écru */
:root {
  --creme: #F3ECDF; --papier: #FBF7EF; --brun: #35261B; --brun-doux: #6A5243; --ligne: #E3D6C2; --stylo: #2F3466;
  --terre: #A4473A; --terre-fonce: #8A3A2F; --terre-pale: #F2DDD6;
  --menthe: #6B7A3A; --menthe-fonce: #4F5B27; --menthe-pale: #E7E9D3;
  --sable: #C2902F; --sable-fonce: #765617; --sable-pale: #F4E7C9;
  /* Une seule teinte dominante par page : chaque page redéfinit ces trois valeurs */
  --t: var(--terre); --t-fonce: var(--terre-fonce); --t-pale: var(--terre-pale);
  --courbe: cubic-bezier(.2, .7, .2, 1);
  --titres: "Barlow Condensed", "Arial Narrow", sans-serif;
  --texte: "Barlow", "Segoe UI", system-ui, sans-serif;
  --arabe: "Noto Naskh Arabic", "Amiri", serif;
  --arabe-titre: "Amiri", "Noto Naskh Arabic", serif;
  --main: "Caveat", "Segoe Print", cursive;
  --ombre: 0 10px 30px -14px rgba(53, 38, 27, .28);
}
.t-terre { --t: var(--terre); --t-fonce: var(--terre-fonce); --t-pale: var(--terre-pale); }
.t-menthe { --t: var(--menthe); --t-fonce: var(--menthe-fonce); --t-pale: var(--menthe-pale); }
.t-sable { --t: var(--sable); --t-fonce: var(--sable-fonce); --t-pale: var(--sable-pale); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--creme); color: var(--brun); font: 400 17px/1.55 var(--texte); }
h1, h2, h3, p, figure { margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--titres); font-weight: 700; line-height: 1.08; }
h1 { font-size: clamp(42px, 11vw, 68px); }
h2 { font-size: clamp(32px, 7vw, 44px); }
h3 { font-size: 26px; font-weight: 600; }
a { color: inherit; }
[lang="ar"] { font-family: var(--arabe); }
:focus-visible { outline: 3px solid var(--stylo); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 20px; }
.bloc { padding-block: clamp(52px, 9vw, 88px); }
.doux { color: var(--brun-doux); }

/* Logo : l'emblème (étoile à huit branches + R) et le mot RATTIB | رتّب, le même partout */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--brun); text-decoration: none; }
.logo .embleme { width: 36px; height: 36px; flex: none; }
.logo .embleme path:first-child { transform-origin: 200px 200px; transition: transform 900ms var(--courbe); }
.logo:hover .embleme path:first-child { transform: rotate(45deg); }
.logo-mot { display: block; height: 19px; width: auto; flex: none; }
/* Sous le mot, le tifinagh entre deux traits, comme sur le logo */
.logo-txt { display: grid; justify-items: stretch; gap: 4px; }
.logo .tz { display: flex; align-items: center; gap: 7px; font: 400 10px/1 "Noto Sans Tifinagh", sans-serif; letter-spacing: .35em; color: var(--brun-doux); }
.logo .tz::before, .logo .tz::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .55; }
[dir="rtl"] .logo .tz { direction: ltr; }
.embleme { display: block; overflow: visible; }
/* L'emblème qui se dessine : l'étoile, puis le R, puis la pierre */
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes pierre { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .js .dessine g path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .js .dessine .pierre { opacity: 0; transform: scale(0) rotate(-90deg); transform-origin: 160px 170px; }
  .js .dessine.vu g path { animation: trace 1.9s var(--courbe) forwards; }
  .js .dessine.vu g path:nth-child(2) { animation-delay: .55s; }
  .js .dessine.vu g path:nth-child(3) { animation-delay: .85s; }
  .js .dessine.vu .pierre { animation: pierre .6s 1.7s var(--courbe) forwards; }
}
.top { border-bottom: 1px solid var(--ligne); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 62px; }
.langue { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; text-decoration: none; }

/* Motifs : de la ponctuation, jamais un fond */
.rosette { width: 46px; height: 46px; flex: none; color: var(--t-fonce); }
.guirlande { height: 14px; background: var(--t); opacity: .75;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='14'%3E%3Cpath d='M0 7h56' stroke='%23000' stroke-width='1' stroke-dasharray='1 3'/%3E%3Cpath d='M7 2l5 5-5 5-5-5z'/%3E%3Cpath d='M35 3.500l3.500 3.500-3.500 3.500-3.500-3.500z' fill='none' stroke='%23000'/%3E%3C/svg%3E") repeat-x center;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='14'%3E%3Cpath d='M0 7h56' stroke='%23000' stroke-width='1' stroke-dasharray='1 3'/%3E%3Cpath d='M7 2l5 5-5 5-5-5z'/%3E%3Cpath d='M35 3.500l3.500 3.500-3.500 3.500-3.500-3.500z' fill='none' stroke='%23000'/%3E%3C/svg%3E") repeat-x center; }
.arc { border-radius: 999px 999px 18px 18px; background: var(--t-pale); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 26px; border: 1.5px solid var(--t-fonce); border-radius: 14px; background: var(--t-fonce); color: var(--papier); font: 600 17px/1.2 var(--texte); text-decoration: none; cursor: pointer; transition: transform 160ms var(--courbe), box-shadow 160ms var(--courbe); }
.btn:hover { transform: translateY(-1px); box-shadow: var(--ombre); }
.btn:active { transform: none; box-shadow: none; }
.btn--doux { background: transparent; color: var(--t-fonce); }
.btn--wa { border-color: var(--menthe-fonce); background: var(--menthe-fonce); border-radius: 999px; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* Cartes produit */
.cartes { display: grid; gap: 18px; }
.carte { display: flex; flex-direction: column; gap: 10px; padding: 0 22px 22px; border: 1px solid var(--ligne); border-radius: 18px; background: var(--papier); box-shadow: var(--ombre); }
.carte-tete { display: grid; place-items: center; height: 104px; margin: 22px 0 6px; }
.carte-tete .rosette { width: 52px; height: 52px; }
/* Le médaillon du logo, dans la teinte de son produit ; l'étoile tourne d'un huitième au survol de la carte */
.cle { display: grid; place-items: center; width: 72px; height: 72px; flex: none; border: 1.5px solid var(--t); border-radius: 50%; background: var(--papier); color: var(--t-fonce); }
.cle .embleme { width: 46px; height: 46px; }
.cle .embleme path:first-child { transform-origin: 200px 200px; transition: transform 900ms var(--courbe); }
.carte:hover .cle .embleme path:first-child, .duo-arc:hover .cle .embleme path:first-child { transform: rotate(45deg); }
.duo-arc .cle { margin-inline: auto; }
.carte h3 [lang="ar"] { margin-inline-start: 8px; font: 700 22px/1 var(--arabe-titre); color: var(--t-fonce); }
.carte .prix { margin-top: auto; padding-top: 8px; font: 600 24px/1.2 var(--titres); color: var(--t-fonce); }
.carte .btn { width: 100%; }

/* Nuanciers et spécimens */
.teintes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 26px; }
.teinte { overflow: hidden; border: 1px solid var(--ligne); border-radius: 14px; background: var(--papier); }
.teinte i { display: block; height: 66px; background: var(--c); }
.teinte div { padding: 10px 12px 12px; font-size: 16px; line-height: 1.35; }
.teinte b { display: block; font-weight: 600; }
.specimens { display: grid; gap: 20px; margin-top: 26px; }
.specimens dt { font-size: 16px; color: var(--brun-doux); }
.specimens dd { margin: 2px 0 0; }
.ligne-btn { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.titre-sec { display: flex; align-items: center; gap: 14px; }
.titre-sec .rosette { width: 34px; height: 34px; }

/* La feuille interactive */
.accueil { display: grid; gap: 34px; padding-block: 34px 56px; }
.promesse p { margin-top: 14px; font-size: 19px; }
.promesse .btn { margin-top: 22px; }
.bloc-papier { position: relative; width: 100%; max-width: 372px; margin-inline: auto; }
/* Les feuilles suivantes du bloc, visibles sous la première */
.bloc-papier::before, .bloc-papier::after { content: ""; position: absolute; inset: 8px -5px -8px 5px; border-radius: 3px 3px 12px 12px; background: var(--papier); box-shadow: var(--ombre); transform: rotate(.7deg); }
.bloc-papier::after { inset: 4px -2px -4px 2px; transform: rotate(-.4deg); }
.feuille { position: relative; z-index: 2; padding: 26px 16px 16px; border-radius: 3px 3px 12px 12px; background: var(--papier); box-shadow: 0 2px 8px -3px rgba(53, 38, 27, .3); transform-origin: 0 0; }
/* Le bord collé du bloc */
.feuille::before { content: ""; position: absolute; inset: 0 0 auto; height: 9px; border-radius: 3px 3px 0 0; background: var(--t-pale); border-bottom: 1px dashed var(--t); }
.feuille.part { animation: part 460ms var(--courbe) forwards; pointer-events: none; }
.feuille.vient { animation: vient 260ms var(--courbe); }
@keyframes part { 30% { transform: rotate(-2.5deg); } to { transform: translate(-14%, 34%) rotate(-11deg); opacity: 0; } }
@keyframes vient { from { opacity: .4; } to { opacity: 1; } }
.f-tete { display: flex; align-items: center; gap: 10px; }
.f-tete .rosette { width: 32px; height: 32px; }
.f-tete strong { font: 700 25px/1 var(--titres); }
.f-tete [lang="ar"] { font: 700 19px/1 var(--arabe-titre); color: var(--t-fonce); }
.f-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.f-col-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 4px; padding: 5px 8px; border-radius: 8px 8px 0 0; background: var(--t-pale); font: 600 16px/1.2 var(--titres); }
.f-col-tete [lang="ar"] { font: 400 16px/1.2 var(--arabe-titre); }
.case { position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; padding-inline: 3px; border-bottom: 1px solid var(--ligne); cursor: pointer; }
.case input[type="checkbox"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.losange { position: relative; flex: none; width: 13px; height: 13px; margin-inline: 3px; border: 1.5px solid var(--t-fonce); transform: rotate(45deg); }
.losange::after { content: ""; position: absolute; inset: 1.5px; background: var(--stylo); transform: scale(0); transition: transform 200ms cubic-bezier(.2, 1.5, .4, 1); }
.case input:checked + .losange::after { transform: scale(1); }
.case input:focus-visible + .losange { outline: 2px solid var(--stylo); outline-offset: 3px; }
.case-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.case-txt [lang="ar"] { font: 700 17px/1.25 var(--arabe-titre); }
.case-txt small { font-size: 16px; color: var(--brun-doux); }
.case--libre { cursor: text; }
.case--libre input[type="text"] { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; border-bottom: 1px dashed var(--t); background: transparent; color: var(--stylo); font: 500 23px/1 var(--main); }
.case--libre input[type="text"]::placeholder { color: var(--brun-doux); font: 400 16px/1 var(--main); opacity: .95; }
.case--libre input[type="text"]:focus { outline: none; border-bottom: 2px solid var(--stylo); }
.f-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.f-pied span { font-size: 16px; color: var(--brun-doux); }
.detacher { min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--t-fonce); border-radius: 12px; background: transparent; color: var(--t-fonce); font: 600 16px/1.1 var(--texte); cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .btn, .losange::after { transition: none; }
  .feuille.part, .feuille.vient { animation: none; }
}
@media (min-width: 720px) {
  .cartes { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .accueil { grid-template-columns: 1fr 400px; align-items: center; padding-block: 64px 84px; }
}

/* Prix pas encore décidé : rien ne s'affiche à sa place */
[data-prix]:empty { display: none; }
.fiche-l:has([data-prix]:empty) { display: none; }

/* Version arabe : des polices dessinées pour l'arabe, partout */
html[lang="ar"] { --titres: "Amiri", "Noto Naskh Arabic", serif; --texte: "Noto Naskh Arabic", "Amiri", serif; --main: "Amiri", serif; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.35; }
html[lang="ar"] body { line-height: 1.75; }

/* Pied de page commun */
.pied { background: var(--brun); color: var(--creme); padding-block: 38px; text-align: center; }
/* Le sceau : le logo entier, couleur sable sur le brun du pied */
.sceau { display: grid; justify-items: center; gap: 14px; color: var(--sable); }
.sceau .embleme { width: 96px; height: 96px; }
.sceau .logo-mot { height: 30px; color: var(--creme); }
.sceau .tz { display: flex; align-items: center; gap: 16px; width: min(100%, 300px); font: 400 15px/1 "Noto Sans Tifinagh", sans-serif; letter-spacing: .35em; }
.sceau .tz::before, .sceau .tz::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .55; }
.pied-slogan { margin-top: 14px; opacity: .85; }
.pied-liens { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-top: 12px; }
.pied-liens a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
.wa-flottant { position: fixed; inset-inline-end: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 40; box-shadow: var(--ombre); }
.sans-barre .wa-flottant { bottom: calc(16px + env(safe-area-inset-bottom)); }

/* Pages de texte : contact, réservation, confidentialité */
.page-texte { max-width: 760px; padding-block: 32px 72px; }
.page-texte h1 { margin-bottom: 18px; }
.page-texte h2 { margin-top: 34px; font-size: 28px; }
.page-texte p, .page-texte li { margin-top: 10px; font-size: 17.5px; }
.page-texte ul { padding-inline-start: 22px; }
.carte-contact { display: grid; gap: 12px; margin-top: 18px; padding: 22px; border: 1px solid var(--ligne); border-radius: 18px; background: var(--papier); box-shadow: var(--ombre); }

.top nav { display: flex; align-items: center; gap: 18px; }
.top .retour { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }

/* Mentions légales : une information pas encore donnée ne laisse pas de ligne vide */
.identite li:has(span:empty) { display: none; }
.identite:not(:has(span:not(:empty))) { display: none; }

/* Le menu, le même sur toutes les pages */
.top { position: sticky; top: 0; z-index: 30; background: var(--creme); border-bottom: 1px solid var(--ligne); }
.top .barre-haut { display: flex; align-items: center; gap: 10px; min-height: 60px; }
.barre-haut .logo { margin-inline-end: auto; }
.top .nav-site { display: none; }
.top .nav-site a { position: relative; display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; text-decoration: none; }
.top .nav-site a:hover { color: var(--t-fonce); }
.top .nav-site a[aria-current="page"]::after { content: ""; position: absolute; inset-inline: 0; bottom: 6px; height: 2px; border-radius: 2px; background: var(--t-fonce); }
.haut-actions { display: flex; align-items: center; gap: 10px; }
.haut-actions .langue { display: none; }
.btn-mini { min-height: 44px; padding: 8px 18px; border-radius: 12px; font-size: 16px; }
.menu-bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--ligne); border-radius: 12px; background: var(--papier); color: var(--brun); font: 600 16px/1 var(--texte); cursor: pointer; }
.menu-icone { position: relative; width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
.menu-bouton[aria-expanded="true"] .menu-icone { box-shadow: none; transform: rotate(45deg); }
.menu-bouton[aria-expanded="true"] .menu-icone::after { content: ""; position: absolute; inset: 0; background: currentColor; transform: rotate(90deg); }
.menu-texte { display: none; }
.top .menu-panneau { display: block; border-top: 1px solid var(--ligne); background: var(--creme); box-shadow: 0 18px 30px -20px rgba(53, 38, 27, .45); }
.top .menu-panneau .wrap { display: grid; justify-content: stretch; align-items: stretch; min-height: 0; padding-block: 6px 18px; }
.menu-panneau a:not(.btn) { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--ligne); font: 600 22px/1.2 var(--titres); text-decoration: none; }
.menu-panneau a[aria-current="page"] { color: var(--t-fonce); }
.menu-panneau a[aria-current="page"]::before { content: ""; width: 9px; height: 9px; background: currentColor; transform: rotate(45deg); }
.menu-panneau .btn { margin-top: 16px; }
@media (min-width: 480px) {
  .menu-texte { display: inline; }
  .haut-actions .langue { display: inline-flex; }
}
@media (min-width: 960px) {
  .top .nav-site { display: flex; gap: 26px; margin-inline-end: 8px; }
  .menu-bouton { display: none; }
  .top .menu-panneau { display: none !important; }
}

/* Disponibilité d'un produit : un signe court et lisible */
.dispo { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 999px; font: 600 14px/1.3 var(--texte); }
.dispo:empty { display: none; }
.dispo.oui { background: var(--menthe-pale); color: var(--brun); }
.dispo.oui::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--menthe-fonce); }
/* Pas encore lancé : orange doux, avec un point qui pulse comme « ça arrive » */
.dispo.non { background: #FCE6D6; color: #8A3A12; }
.dispo.non::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #E07A3C; box-shadow: 0 0 0 0 rgba(224, 122, 60, .5); }
@keyframes bientot { 70% { box-shadow: 0 0 0 7px rgba(224, 122, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 122, 60, 0); } }
@media (prefers-reduced-motion: no-preference) { .dispo.non::before { animation: bientot 2.2s ease-out infinite; } }
.carte-choix:has(input:disabled) { cursor: not-allowed; }
.carte-choix:has(input:disabled) > span { background: var(--creme); border-style: dashed; }
.carte-choix:has(input:disabled) b, .carte-choix:has(input:disabled) em { color: var(--brun-doux); }
.carte-choix .dispo { grid-column: 1; justify-self: start; margin-top: 6px; }

/* Prix de lancement : l'ancien prix barré, et un ruban avec l'économie */
.avant { margin-inline-start: 4px; font-size: .72em; font-weight: 500; color: var(--brun-doux); text-decoration-thickness: 1.5px; }
/* Un ruban doré clair, avec un reflet qui passe de temps en temps */
.lancement { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 9px; align-self: flex-start; padding: 6px 15px 6px 13px; border: 1px solid #E6C77E; border-radius: 999px; background: linear-gradient(100deg, #FFF6DD, #F9E4B0); color: #6B4E12; font: 700 14px/1.3 var(--texte); }
.lancement::before { content: ""; flex: none; width: 8px; height: 8px; background: #C9922E; transform: rotate(45deg); }
.lancement::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .75) 50%, transparent 65%); transform: translateX(-100%); pointer-events: none; }
@keyframes reflet { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: no-preference) { .lancement::after { animation: reflet 4.5s ease-in-out infinite; } }
[dir="rtl"] .lancement::after { scale: -1 1; }
.carte-choix .lancement { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
/* Prix tout compris : livraison incluse */
.inclus { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--brun); }
.inclus::before { content: ""; flex: none; width: 10px; height: 5px; margin-top: -3px; border: solid var(--menthe-fonce); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
