/* Habillage « fil de bons plans » vert, blanc, rouge. Couleurs, polices et espacements : variables de :root seulement. */

@font-face {
  font-family: "Rubik";
  src: url("polices/rubik-latin.woff2") format("woff2");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

/* Arabe : sous-ensembles locaux, un seul poids chacun ; chargés seulement par les pages arabes. */
@font-face {
  font-family: "Rubik Arabic";
  src: url("polices/rubik-arabic.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Arabic";
  src: url("polices/noto-sans-arabic.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("polices/nunito-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Couleurs : vert, blanc, rouge (drapeau) et neutres. Aucune autre couleur. */
  --vert: #006233;
  --vert-fonce: #00452a;
  --vert-nuit: #04301f;
  --vert-vif: #0a7d45;
  --vert-pale: #e6f2ea;
  --rouge: #d21034;
  --rouge-fonce: #a80c29;
  --rouge-pale: #fdebef;
  --blanc: #ffffff;
  --fond: #eef2ef;
  --encre: #13201a;
  --gris: #55615a;
  --trait: #dce4df;
  --voile: #f4f7f5;

  /* Relief : trois ombres douces à deux couches, teintées vert nuit. */
  --ombre-1: 0 1px 2px rgba(4, 48, 31, 0.06), 0 2px 8px rgba(4, 48, 31, 0.05);
  --ombre-2: 0 2px 4px rgba(4, 48, 31, 0.06), 0 12px 28px rgba(4, 48, 31, 0.12);
  --ombre-3: 0 6px 12px rgba(4, 48, 31, 0.1), 0 28px 56px rgba(4, 48, 31, 0.2);

  /* Rayons : cartes, photos, pastilles et boutons. */
  --rayon: 14px;
  --rayon-petit: 10px;
  --rond: 999px;

  /* Espacements */
  --e-4: 4px;
  --e-8: 8px;
  --e-12: 12px;
  --e-16: 16px;
  --e-24: 24px;
  --e-32: 32px;
  --e-48: 48px;
  --e-64: 64px;
  --e-96: 96px;

  /* Mise en page et typographie */
  --largeur: 1200px;
  --cible: 44px;
  --hauteur-barre: 48px;
  --hauteur-basse: 60px;
  --police-titre: "Rubik", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --police-texte: "Nunito Sans", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --gouttiere-page: max(var(--e-16), calc((100% - var(--largeur)) / 2));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-padding-top: 9rem;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police-texte);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.55;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--police-titre);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--encre);
  line-height: 1.1;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  margin: var(--e-24) 0;
  overflow-wrap: anywhere;
}

h2 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  margin: var(--e-32) 0 var(--e-16);
}

h3 {
  font-size: 1.25rem;
}

main p,
main li {
  max-width: 65ch;
}

main a {
  color: var(--vert-fonce);
  font-weight: 700;
}

/* Les prix : chiffres tabulaires, Rubik. */
.prix {
  font-family: var(--police-titre);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.masque-visuel {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Icônes au trait : SVG en ligne, aucune émoticône. */
.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Focus clavier : contour rouge de 3px, visible partout. */
a:focus,
button:focus,
input:focus,
summary:focus {
  outline: 3px solid var(--rouge);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--rouge);
  outline-offset: 2px;
}

/* Sur fond vert nuit, un anneau blanc sépare le contour rouge du fond (contraste). */
.barre a:focus-visible,
footer a:focus-visible {
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--blanc);
}

.lien-evitement {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 60;
  background: var(--blanc);
  color: var(--encre);
  border: 1px solid var(--trait);
  border-radius: var(--rayon-petit);
  font-weight: 700;
  padding: var(--e-12) var(--e-16);
  text-decoration: none;
}

.lien-evitement:focus {
  inset-inline-start: var(--e-8);
  top: var(--e-8);
}

/* ---------- Barre utilitaire : vert nuit, 48px ---------- */

/* Elle garde direction: ltr dans les deux langues : le choix de la langue
   reste physiquement en haut à droite, en arabe aussi. */
.barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: ltr;
  gap: var(--e-12);
  min-height: var(--hauteur-barre);
  padding: 0 var(--gouttiere-page);
  background: var(--vert-nuit);
  color: var(--blanc);
}

.bandeau-demo {
  display: flex;
  align-items: center;
  gap: var(--e-8);
  min-width: 0;
  margin: 0;
  font-size: 0.8125rem;
}

.bandeau-demo span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bandeau-point {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--rond);
  background: var(--rouge);
}

/* Pastille à deux segments : la langue courante sur fond blanc. */
.choix-langue {
  display: flex;
  direction: ltr;
  flex: none;
  margin-inline-start: auto;
  padding: 2px;
  background: var(--vert-fonce);
  border-radius: var(--rond);
}

.choix-langue a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--cible);
  min-height: var(--cible);
  padding: 0 var(--e-16);
  border-radius: var(--rond);
  color: var(--blanc);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.choix-langue a[lang="ar"] {
  font-family: "Noto Sans Arabic", "Nunito Sans", system-ui, sans-serif;
  font-weight: 400;
  font-size: 0.9375rem;
}

.choix-langue a:hover {
  opacity: 0.8;
}

.choix-langue a[aria-current] {
  background: var(--blanc);
  color: var(--vert-fonce);
  opacity: 1;
}

/* ---------- En-tête collant et rangée des rayons ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--blanc);
  border-bottom: 1px solid var(--trait);
  box-shadow: var(--ombre-1);
}

.entete-ligne {
  display: flex;
  align-items: center;
  gap: var(--e-16);
  padding: var(--e-12) var(--gouttiere-page);
}

.nom-site {
  flex: none;
  margin: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--e-8);
  min-height: var(--cible);
  direction: ltr;
  color: var(--encre);
  font-family: "Rubik", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

/* Le logo n'est jamais retourné : carré arrondi vert, étoile rouge au coin. */
.logo-marque {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--rayon-petit);
  background: linear-gradient(145deg, var(--vert-vif), var(--vert-fonce));
  color: var(--blanc);
  font-size: 0.9375rem;
}

.logo-marque svg {
  fill: var(--rouge);
  stroke: var(--blanc);
  stroke-width: 2;
  stroke-linejoin: round;
  position: absolute;
  inset-block-start: -6px;
  inset-inline-end: -6px;
  width: 18px;
  height: 18px;
}

.recherche-entete {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 560px;
  margin-inline: auto;
}

.recherche-entete input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: var(--cible);
  padding-block: 0;
  padding-inline: 44px 112px;
  background: var(--voile);
  color: var(--encre);
  border: 1.5px solid var(--trait);
  border-radius: var(--rond);
  font: inherit;
}

.recherche-entete input[type="search"]::placeholder {
  color: var(--gris);
}

.recherche-entete input[type="search"]:focus {
  background: var(--blanc);
}

.recherche-entete .ic {
  position: absolute;
  inset-inline-start: 16px;
  inset-block-start: 50%;
  translate: 0 -50%;
  color: var(--gris);
  pointer-events: none;
}

.recherche-entete button {
  position: absolute;
  inset-inline-end: 4px;
  inset-block: 4px;
  padding: 0 var(--e-16);
  background: var(--vert);
  color: var(--blanc);
  border: 0;
  border-radius: var(--rond);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.recherche-entete button:hover {
  background: var(--vert-fonce);
}

.liens-entete {
  display: flex;
  flex: none;
  gap: var(--e-4);
  margin-inline-start: auto;
}

.liens-entete a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--cible);
  padding: 0 var(--e-12);
  border-radius: var(--rond);
  color: var(--encre);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}

.liens-entete a:hover,
.liens-entete a[aria-current] {
  background: var(--vert-pale);
  color: var(--vert-fonce);
}

nav a {
  color: var(--encre);
}

/* Rangée des rayons : défile à l'horizontale, sans barre visible. */
.rayons {
  display: flex;
  gap: var(--e-8);
  padding: 0 var(--gouttiere-page) var(--e-12);
  overflow-x: auto;
  scrollbar-width: none;
}

.rayons::-webkit-scrollbar {
  display: none;
}

.rayon {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  background: var(--blanc);
  color: var(--encre);
  border: 1.5px solid var(--trait);
  border-radius: var(--rond);
  font-size: 0.90625rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 150ms ease;
}

.rayon .ic {
  color: var(--vert);
}

.rayon:hover {
  background: var(--vert-pale);
  border-color: var(--vert);
  transform: translateY(-1px);
}

/* Page courante : pastille verte pleine (aria-current). */
.rayon[aria-current] {
  background: var(--vert);
  border-color: var(--vert);
  color: var(--blanc);
}

.rayon[aria-current] .ic {
  color: var(--blanc);
}

.rayon-urgent .ic {
  color: var(--rouge);
}

/* ---------- Contenu : éléments existants, habillés avec les jetons ---------- */

main {
  padding: var(--e-16) var(--gouttiere-page) var(--e-48);
}

#recherche-formulaire {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-8);
  max-width: 100%;
  margin-bottom: var(--e-16);
}

#recherche-formulaire > * {
  min-width: 0;
  max-width: 100%;
}

#recherche-formulaire input[type="search"] {
  flex: 1 1 15rem;
  min-width: 0;
  min-height: 56px;
  padding: 0 var(--e-16);
  background: var(--blanc);
  color: var(--encre);
  border: 1.5px solid var(--trait);
  border-radius: var(--rond);
  box-shadow: var(--ombre-1);
  font: inherit;
  font-size: 1.1rem;
}

#recherche-formulaire button {
  min-height: var(--cible);
  padding: 0 var(--e-24);
  background: var(--vert);
  color: var(--blanc);
  border: 0;
  border-radius: var(--rond);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.recherche-label {
  flex: 1 0 100%;
  font-weight: 700;
}

.recherche-statut {
  font-weight: 700;
  min-height: 1.55em;
}

.fil-ariane ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-8);
  padding: 0;
  margin: 0 0 var(--e-8);
  font-size: 0.9rem;
  color: var(--gris);
}

.fil-ariane li {
  display: inline-flex;
  align-items: center;
  min-height: var(--cible);
}

.fil-ariane li > a,
.fil-ariane li[aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: var(--cible);
  padding: 0 var(--e-12);
  background: var(--blanc);
  color: var(--encre);
  border: 1px solid var(--trait);
  border-radius: var(--rond);
  font-weight: 700;
  text-decoration: none;
}

.fil-ariane li[aria-current] {
  background: var(--vert-pale);
  color: var(--vert-fonce);
}

.liste-categories {
  list-style: none;
  padding: 0;
  margin: var(--e-16) 0;
}

.liste-categories li {
  margin-bottom: var(--e-8);
}

.offres-vide {
  color: var(--gris);
}

.offres {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--e-12);
  padding: 0;
  margin: var(--e-16) 0;
}

/* Carte d'offre : carte blanche arrondie, trait fin, ombre douce. */
.fiche-ticket {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-1);
}

.ticket-corps {
  flex: 1 1 auto;
  padding: var(--e-16) var(--e-16) var(--e-12);
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e-8);
  margin: 0;
}

.pastille {
  padding: 0 var(--e-12);
  background: var(--voile);
  color: var(--encre);
  border: 1px solid var(--trait);
  border-radius: var(--rond);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.8;
}

.marchand {
  color: var(--gris);
  font-size: 0.9rem;
  font-weight: 700;
}

.ticket-talon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e-8) var(--e-16);
  min-height: 4.5rem;
  padding: var(--e-16);
  border-top: 1px solid var(--trait);
}

.prix-ticket {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e-8) var(--e-12);
  margin: 0;
}

.prix-ticket .prix {
  color: var(--rouge);
  font-size: 1.45rem;
  line-height: 1.3;
  white-space: nowrap;
}

.prix-avant {
  color: var(--gris);
  font-weight: 700;
}

.etiquette-reduction {
  display: inline-block;
  padding: var(--e-4) var(--e-12);
  background: var(--rouge);
  color: var(--blanc);
  border-radius: var(--rond);
  font-family: var(--police-titre);
  font-weight: 800;
}

.echeance {
  margin-block: 0;
  margin-inline: auto 0;
  color: var(--gris);
  font-size: 0.9rem;
  font-weight: 700;
}

.echeance-proche {
  color: var(--rouge-fonce);
}

/* Offre expirée : corps et talon grisés (jetons, sans couleur nouvelle) et tampon incliné. */
.offre-expiree-carte .ticket-corps,
.offre-expiree-carte .ticket-talon {
  /* Grisé sur le corps et le talon seulement : le tampon garde son rouge.
     Pas d'opacity : elle ferait baisser le contraste du texte. */
  filter: grayscale(1);
}

/* Photo (ou aplat de catégorie) en tête de carte : 4:3 réservé, sans décalage. */
.ticket-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--voile);
}

.ticket-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ticket-aplat {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Aplats de catégorie : les noms de classe viennent de categories.json. */
.tuile-vert {
  background: var(--vert-pale);
}

.tuile-orange {
  background: var(--vert-pale);
}

.tuile-jaune {
  background: var(--rouge-pale);
}

.tuile-menthe {
  background: var(--voile);
}

.ticket-aplat svg {
  width: 30%;
  fill: none;
  stroke: var(--vert-fonce);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Page d'une offre : photo en grand au-dessus du contenu. */
.photo-offre-bloc {
  margin-block: 0 var(--e-24);
}

.photo-offre {
  max-width: 960px;
  border-radius: var(--rayon-petit);
  box-shadow: var(--ombre-1);
}

/* Fiche d'une offre expirée : la photo passe en niveaux de gris. */
.offre-expiree-carte .ticket-media {
  filter: grayscale(1);
}

.tampon {
  position: absolute;
  inset-inline-end: var(--e-16);
  bottom: var(--e-16);
  z-index: 2;
  margin: 0;
  padding: var(--e-4) var(--e-12);
  background: var(--blanc);
  border: 2px solid var(--rouge);
  border-radius: var(--rayon-petit);
  color: var(--rouge);
  font-family: var(--police-titre);
  font-weight: 800;
  text-transform: uppercase;
  transform: rotate(-10deg);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .bouton,
  .rayon {
    transition: none;
  }
}

.bouton {
  display: inline-flex;
  align-items: center;
  gap: var(--e-12);
  justify-content: center;
  min-height: var(--cible);
  padding: 0 var(--e-24);
  background: var(--vert);
  color: var(--blanc);
  border-radius: var(--rond);
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease;
}

main a.bouton {
  color: var(--blanc);
}

.bouton:hover {
  background: var(--vert-fonce);
  transform: translateY(-1px);
}

.bouton:active {
  transform: translateY(0);
}

.bouton .fleche {
  flex: 0 0 auto;
}

/* Flèches et chevrons retournés en arabe ; les photos ne le sont jamais. */
[dir="rtl"] .fleche {
  transform: scaleX(-1);
}

/* ---------- Fiche d'offre ---------- */

.fiche-ticket {
  margin: var(--e-16) 0 var(--e-32);
}

.fiche-ticket h1 {
  margin: var(--e-8) 0;
}

.fiche-ticket .ticket-meta .pastille {
  text-decoration: none;
}

.fiche-ticket .offre-date {
  margin: 0;
  color: var(--gris);
  font-size: 0.9rem;
}

.fiche-ticket .prix-ticket .prix {
  font-size: clamp(2rem, 6vw, 3rem);
}

.offre-resume {
  font-size: 1.2rem;
  font-weight: 600;
}

.barre-action {
  margin: var(--e-16) 0 var(--e-24);
}

.barre-action .bouton {
  display: flex;
  width: 100%;
  min-height: 52px;
  font-size: 1.125rem;
}

.fiche-ticket .ticket-talon {
  background: var(--voile);
}

.fiche-ticket .marchand .ic {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.15em;
}

.mention-externe {
  font-size: 0.8rem;
  font-weight: 600;
}

.offres-liees {
  margin-top: var(--e-48);
}

@media (max-width: 639px) {
  .bouton {
    display: flex;
    width: 100%;
    box-sizing: border-box;
  }

  /* Barre collante : téléphone seulement, et seulement si l'offre a un lien.
     Elle se pose au-dessus de la barre basse. */
  .barre-action {
    position: fixed;
    inset-inline: 0;
    bottom: calc(var(--hauteur-basse) + env(safe-area-inset-bottom));
    z-index: 30;
    margin: 0;
    padding: var(--e-12) var(--gouttiere-page);
    background: var(--blanc);
    border-top: 1px solid var(--trait);
  }

  body:has(.barre-action) footer {
    padding-bottom: calc(var(--e-48) + 5rem);
  }
}

.offre-expiree {
  color: var(--rouge);
  font-weight: 700;
}

footer {
  /* Pied vert nuit, précédé du filet vert / blanc / rouge de 5px (footer::before). */
  position: relative;
  margin-top: var(--e-48);
  padding: var(--e-32) var(--gouttiere-page);
  background: var(--vert-nuit);
  color: var(--blanc);
  font-size: 0.95rem;
}

footer::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: -5px;
  height: 5px;
  background: linear-gradient(90deg, var(--vert) 0 46%, var(--blanc) 46% 54%, var(--rouge) 54% 100%);
}

.pied-grille {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-16) var(--e-32);
}

footer .logo {
  color: var(--blanc);
}

footer .logo-texte {
  display: inline;
}

.pied-liens {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-4) var(--e-16);
}

footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--cible);
  color: var(--blanc);
  font-weight: 700;
  text-decoration: none;
}

.pied-liens a:hover {
  text-decoration: underline;
}

footer span {
  color: var(--blanc);
}

/* ---------- Barre basse : téléphone, sous 768px ---------- */

.basse {
  display: none;
}

@media (max-width: 767px) {
  body:has(.basse) {
    padding-block-end: calc(var(--hauteur-basse) + env(safe-area-inset-bottom));
  }

  .basse {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--blanc);
    border-top: 1px solid var(--trait);
    box-shadow: var(--ombre-2);
  }

  .basse a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    min-height: var(--hauteur-basse);
    color: var(--gris);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
  }

  .basse .ic {
    width: 22px;
    height: 22px;
  }

  .basse a[aria-current] {
    color: var(--vert);
  }

  .basse a[aria-current] .ic {
    stroke-width: 2.4;
  }

  .logo-texte,
  .liens-entete,
  .recherche-entete button {
    display: none;
  }

  footer .logo-texte {
    display: inline;
  }

  .recherche-entete input[type="search"] {
    padding-inline-end: var(--e-16);
  }

  .entete-ligne {
    gap: var(--e-12);
  }
}

/* ---------- Accueil : héros et catégories ---------- */

.heros {
  position: relative;
  overflow: hidden;
  margin: var(--e-16) 0 0;
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-1);
}

.heros-grille {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: var(--e-32);
  padding: var(--e-48) var(--e-32) var(--e-24);
}

.heros-texte {
  min-width: 0;
}

.heros h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4.4vw, 3.25rem);
  line-height: 1.08;
  text-wrap: balance;
}

/* « bons plans » en vert, souligné d'un trait rouge. */
.heros mark {
  background: none;
  color: var(--vert);
  box-shadow: inset 0 -0.14em 0 var(--rouge);
}

.heros-appui {
  max-width: 46ch;
  margin: var(--e-16) 0 0;
  color: var(--gris);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.chiffres {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-12);
  margin: var(--e-24) 0 0;
  padding: 0;
  list-style: none;
}

.chiffre {
  display: flex;
  align-items: baseline;
  gap: var(--e-8);
  padding: 10px var(--e-16);
  background: var(--voile);
  border: 1px solid var(--trait);
  border-radius: var(--rayon-petit);
}

.chiffre b {
  color: var(--vert-fonce);
  font-family: var(--police-titre);
  font-size: 1.4rem;
  font-weight: 800;
}

.chiffre.rouge b {
  color: var(--rouge);
}

.chiffre span {
  color: var(--gris);
  font-size: 0.9rem;
}

/* Emblème décoratif : jamais retourné en arabe (direction: ltr), masqué sous 768 px. */
.scene {
  position: relative;
  height: 300px;
  direction: ltr;
}

.disque {
  position: absolute;
  inset-block-start: 22px;
  inset-inline-start: 50%;
  display: grid;
  place-items: center;
  width: 236px;
  height: 236px;
  margin-inline-start: -118px;
  background: linear-gradient(90deg, var(--vert) 50%, var(--blanc) 50%);
  border: 7px solid var(--blanc);
  border-radius: var(--rond);
  box-shadow: var(--ombre-3);
}

.disque svg {
  width: 116px;
  height: 116px;
}

.disque .croissant,
.disque .etoile {
  fill: var(--rouge);
}

.flottant {
  position: absolute;
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-2);
  animation: flotte 7s ease-in-out infinite;
}

.flottant.etiquette {
  inset-block-start: 6px;
  inset-inline-start: 6px;
  padding: 10px var(--e-16);
  background: var(--rouge);
  color: var(--blanc);
  font-family: "Rubik", system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  rotate: -9deg;
  border-radius: var(--rayon-petit);
}

.flottant.pastille-heure {
  inset-block-end: 70px;
  inset-inline-start: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--vert-fonce);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--rond);
  rotate: -4deg;
  animation-delay: -1.5s;
}

.flottant.pastille-heure .ic {
  width: 16px;
  height: 16px;
  color: var(--rouge);
}

.flottant.mini {
  inset-block-end: 4px;
  inset-inline-end: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 212px;
  padding: 10px;
  rotate: 5deg;
  animation-delay: -3.5s;
}

.flottant.mini img {
  flex: none;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--rayon-petit);
}

.flottant.mini div {
  min-width: 0;
}

.flottant.mini b {
  display: block;
  color: var(--rouge);
  font-family: var(--police-titre);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
}

.flottant.mini s {
  color: var(--gris);
  font-size: 0.8rem;
}

.flottant.mini small {
  display: block;
  color: var(--gris);
  font-size: 0.78rem;
  line-height: 1.3;
  unicode-bidi: plaintext;
}

@keyframes flotte {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -8px;
  }
}

/* Onglets du héros. */
.heros .onglets {
  position: relative;
  margin: 0;
  padding: 0 var(--e-32);
}

/* Corps : le fil, puis la colonne latérale. */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--e-24);
  padding-block: var(--e-24) 0;
}

.fil-titre {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--e-8) var(--e-16);
}

.fil-titre h2 {
  margin: 0;
  font-size: 1.25rem;
}

.cote {
  display: grid;
  align-content: start;
  gap: var(--e-16);
}

.bloc {
  padding: var(--e-16);
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-1);
}

.bloc h2 {
  display: flex;
  align-items: center;
  gap: var(--e-8);
  margin: 0 0 var(--e-12);
  font-size: 1.05rem;
}

.bloc h2 .ic {
  color: var(--rouge);
}

.bloc.vert h2 .ic {
  color: var(--vert);
}

.mini-liste,
.rayons-liste {
  display: grid;
  gap: var(--e-12);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-offre {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: var(--e-12);
  align-items: center;
  max-width: none;
  margin: -6px;
  padding: 6px;
  border-radius: var(--rayon-petit);
  transition: background-color 150ms ease;
}

.mini-offre:hover {
  background: var(--voile);
}

.mini-vignette {
  position: relative;
}

.mini-vignette img,
.mini-aplat {
  display: block;
  width: 84px;
  height: 63px;
  object-fit: cover;
  border-radius: var(--rayon-petit);
}

.mini-aplat {
  display: grid;
  place-items: center;
}

.mini-aplat svg {
  width: 30px;
  fill: none;
  stroke: var(--vert-fonce);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-vignette .remise {
  position: absolute;
  inset-block-end: -8px;
  inset-inline-end: -6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  background: var(--rouge);
  color: var(--blanc);
  border-radius: var(--rond);
  direction: ltr;
  font-family: var(--police-titre);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.mini-vignette .remise .ic {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.mini-offre a {
  display: -webkit-box;
  overflow: hidden;
  color: var(--encre);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mini-offre a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.mini-offre .prix-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0;
}

.mini-offre .prix {
  font-size: 1.05rem;
}

.mini-offre .prix-avant {
  font-size: 0.8rem;
  font-weight: 400;
}

.mini-offre .marchand {
  display: none;
}

.mini-offre .echeance {
  margin: 2px 0 0;
  font-size: 0.8rem;
}

.rayons-liste a {
  display: flex;
  align-items: center;
  gap: var(--e-12);
  min-height: var(--cible);
  margin-inline: -8px;
  padding: 0 var(--e-8);
  color: var(--encre);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--rayon-petit);
  transition: background-color 150ms ease;
}

.rayons-liste a:hover {
  background: var(--vert-pale);
}

.rayons-liste .ic-fond {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--vert);
  background: var(--vert-pale);
  border-radius: var(--rayon-petit);
}

.rayons-liste .nombre {
  margin-inline-start: auto;
  padding: 2px 10px;
  color: var(--gris);
  background: var(--voile);
  border-radius: var(--rond);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Sous 768 px : une colonne, emblème masqué. */
@media (max-width: 767px) {
  .heros-grille {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--e-24) var(--e-16);
  }

  .scene {
    display: none;
  }

  .heros .onglets {
    padding: 0 var(--e-16);
  }
}

/* De 768 à 1023 px : les blocs passent sous le fil, sur deux colonnes. */
@media (min-width: 768px) and (max-width: 1023px) {
  .scene {
    scale: 0.82;
  }

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

/* À partir de 1024 px : deux colonnes, la colonne de 332 px reste collée sous l'en-tête. */
@media (min-width: 1024px) {
  .page {
    grid-template-columns: minmax(0, 1fr) 332px;
    align-items: start;
  }

  .cote {
    position: sticky;
    top: 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flottant {
    animation: none;
  }

  .mini-offre,
  .rayons-liste a {
    transition: none;
  }
}

.tuiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--e-16);
  list-style: none;
  padding: 0;
  margin: var(--e-16) 0 var(--e-32);
}

.tuiles li {
  max-width: none;
}

.tuile {
  display: grid;
  gap: var(--e-4);
  min-height: 100%;
  padding: var(--e-24);
  background: var(--blanc);
  color: var(--encre);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-1);
  text-decoration: none;
  transition: transform 150ms ease;
}

.tuile:hover {
  transform: translateY(-2px);
  box-shadow: var(--ombre-2);
}

main a.tuile {
  color: var(--encre);
}

.tuile svg {
  width: 48px;
  height: 48px;
  padding: var(--e-8);
  background: var(--vert-pale);
  border-radius: var(--rayon-petit);
  fill: none;
  stroke: var(--vert);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tuile-nom {
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: 1.25rem;
}

.tuile-nombre {
  color: var(--vert-fonce);
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tuile-legende {
  color: var(--gris);
  font-weight: 700;
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  .tuile {
    transition: none;
  }
}

@media (min-width: 640px) {
  .tuiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .tuiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Recherche : état vide. */
.ticket-vide {
  grid-column: 1 / -1;
  padding: var(--e-32) var(--e-24);
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--vert-fonce);
}

/* Pages de texte : colonne de lecture. */
/* Colonne de lecture 720 px (h1 compris). */
main:has(.page-texte) {
  padding-inline: max(var(--e-16), calc((100% - 720px) / 2));
}

.page-texte {
  max-width: 720px;
  margin-block: var(--e-16) 0;
  padding: var(--e-24);
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-1);
}

.page-texte > :is(:first-child, :last-child) {
  margin-block: 0;
}

.page-texte h2 {
  padding-bottom: var(--e-4);
  border-bottom: 6px solid var(--vert);
}


/* 404 */
.ticket-404 {
  padding-block: var(--e-32);
  text-align: center;
}

.gros-404 {
  max-width: none;
  margin: 0;
  color: var(--vert);
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: clamp(6rem, 30vw, 14rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.ticket-404 p {
  margin-inline: auto;
}

/* ---------- Carte d'offre (accueil, catégorie, recherche, offres liées) ---------- */
/* Fil : cartes blanches empilées ; photo à gauche (216 px), contenu à droite. */
.fil-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--e-8) var(--e-16);
  margin-block: var(--e-16) 0;
}

.fil-entete h1 {
  margin: 0;
}

.fil-compte {
  margin: 0;
  color: var(--gris);
  font-size: 0.9rem;
  font-weight: 700;
}

/* Onglets de tri : masqués (hidden) tant que static/tri.js ne les révèle pas. */
.onglets {
  display: flex;
  gap: var(--e-8);
  margin-block: var(--e-12) 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.onglets[hidden] {
  display: none;
}

.onglets::-webkit-scrollbar {
  display: none;
}

.onglet {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--cible);
  padding: 0 var(--e-12);
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--gris);
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.onglet:hover,
.onglet[aria-selected="true"] {
  color: var(--vert-fonce);
}

.onglet[aria-selected="true"] {
  border-bottom-color: var(--vert);
}

.onglet .ic {
  width: 18px;
  height: 18px;
}

.onglet .compte {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--rond);
  background: var(--vert);
  color: var(--blanc);
  font-size: 0.75rem;
}

.carte-offre {
  position: relative;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  overflow: hidden;
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-1);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.carte-offre:hover {
  transform: translateY(-2px);
  box-shadow: var(--ombre-2);
}

/* Focus clavier : contour rouge de 3px sur toute la carte. */
.carte-offre:has(a:focus-visible) {
  outline: 3px solid var(--rouge);
  outline-offset: 3px;
}

.carte-offre a:focus,
.carte-offre a:focus-visible {
  outline: none;
}

.carte-offre .offre-vignette {
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--e-12);
  background: var(--voile);
}

.carte-offre .offre-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--rayon-petit);
}

.carte-offre .offre-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 250ms ease;
}

.carte-offre:hover .offre-media img {
  transform: scale(1.035);
}

.carte-offre .offre-aplat {
  display: flex;
  align-items: center;
  justify-content: center;
}

.carte-offre .offre-aplat svg {
  width: 30%;
  fill: none;
  stroke: var(--vert-fonce);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carte-offre .offre-corps {
  display: grid;
  align-content: start;
  gap: var(--e-8);
  min-width: 0;
  padding: var(--e-16);
}

.carte-offre .offre-haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-8);
  min-height: 30px;
}

.carte-offre .remise,
.carte-offre .neuf {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--rond);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  direction: ltr;
}

.carte-offre .remise {
  background: var(--rouge);
  color: var(--blanc);
  font-family: var(--police-titre);
}

.carte-offre .remise .ic {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
}

.carte-offre .neuf {
  background: var(--vert-pale);
  color: var(--vert-fonce);
  font-weight: 700;
}

.carte-offre .date {
  margin-inline-start: auto;
  padding: 4px 10px;
  border-radius: var(--rayon-petit);
  background: var(--voile);
  color: var(--gris);
  font-size: 0.8rem;
  white-space: nowrap;
}

.carte-offre h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.carte-offre h2 a {
  color: var(--encre);
  text-decoration: none;
}

/* Lien étiré : toute la carte se touche ; le rayon et le bouton passent au-dessus. */
.carte-offre h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.carte-offre .prix-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0;
}

.carte-offre .prix {
  color: var(--rouge);
  font-family: var(--police-titre);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.carte-offre .prix-avant {
  font-size: 0.95rem;
  font-weight: 400;
  white-space: nowrap;
}

.carte-offre .sans-prix {
  color: var(--vert-fonce);
  font-weight: 700;
}

.carte-offre .marchand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 400;
}

.carte-offre .marchand .ic {
  width: 16px;
  height: 16px;
}

.carte-offre .marchand b {
  color: var(--encre);
}

.carte-offre .resume {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--gris);
  font-size: 0.92rem;
}

/* Pied : transparent aux clics (la carte entière mène à l'offre) sauf rayon et bouton. */
.carte-offre .offre-pied {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e-8) var(--e-12);
  margin-top: var(--e-4);
  pointer-events: none;
}

.carte-offre .offre-pied a {
  pointer-events: auto;
}

.carte-offre .puce {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--trait);
  border-radius: var(--rond);
  background: var(--voile);
  color: var(--encre);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.carte-offre .puce:hover {
  border-color: var(--vert);
  background: var(--vert-pale);
}

.carte-offre .echeance {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
}

.carte-offre .echeance-proche {
  color: var(--rouge-fonce);
  font-weight: 700;
}

.carte-offre .bouton {
  margin-inline-start: auto;
  white-space: nowrap;
}

.carte-offre .bouton .ic {
  width: 18px;
  height: 18px;
}

[dir="rtl"] .carte-offre .bouton .sortie {
  transform: scaleX(-1);
}

.carte-offre .bouton.second {
  background: var(--blanc);
  color: var(--vert-fonce);
  box-shadow: inset 0 0 0 1.5px var(--vert);
}

.carte-offre .bouton.second:hover {
  background: var(--vert-pale);
}

/* Offre terminée : carte grisée, photo en niveaux de gris, tampon rouge incliné sur la photo. */
.carte-offre.offre-expiree-carte {
  background: var(--voile);
}

.carte-offre.offre-expiree-carte .offre-media {
  filter: grayscale(1);
}

.carte-offre.offre-expiree-carte .prix,
.carte-offre.offre-expiree-carte h2 a {
  color: var(--gris);
}

.carte-offre.offre-expiree-carte .remise {
  background: var(--gris);
}

.carte-offre .tampon {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: max-content;
  height: max-content;
  margin: auto;
  padding: 6px 14px;
  border: 2.5px solid var(--rouge);
  border-radius: var(--rayon-petit);
  background: var(--blanc);
  color: var(--rouge);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  transform: rotate(-10deg);
}

[dir="rtl"] .carte-offre .tampon {
  letter-spacing: 0;
  transform: rotate(10deg);
}

/* Sous 768 px : photo carrée de 116 px, résumé sur une ligne, pastille du rayon masquée. */
@media (max-width: 767px) {
  .carte-offre {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .carte-offre .offre-vignette {
    align-content: start;
    padding: var(--e-8);
  }

  .carte-offre .offre-media {
    aspect-ratio: 1 / 1;
  }

  .carte-offre .offre-corps {
    gap: 6px;
    padding: var(--e-12);
  }

  .carte-offre h2 {
    font-size: 1rem;
  }

  .carte-offre .prix {
    font-size: 20px;
  }

  .carte-offre .resume {
    -webkit-line-clamp: 1;
    font-size: 0.85rem;
  }

  .carte-offre .puce {
    display: none;
  }

  .carte-offre .tampon {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carte-offre,
  .carte-offre .offre-media img {
    transition: none;
  }

  .carte-offre:hover {
    transform: none;
  }

  .carte-offre:hover .offre-media img {
    transform: none;
  }
}

/* Apparition échelonnée : les classes sont posées par apparition.js (sans JS, tout est visible). */
.pre {
  opacity: 0;
  transform: translateY(16px);
}

.ent {
  transition: opacity 350ms ease, transform 350ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .pre {
    opacity: 1;
    transform: none;
  }

  .ent {
    transition: none;
  }
}

/* ---------- Arabe (html lang="ar" dir="rtl") ---------- */

html[dir="rtl"] {
  --police-titre: "Rubik Arabic", "Rubik", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
  --police-texte: "Noto Sans Arabic", "Nunito Sans", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
}

/* Interligne d'au moins 1,7 ; ni italique ni espacement de lettres (cassent les liaisons). */
html[lang="ar"] body,
html[lang="ar"] body *,
html[lang="ar"] body *::before,
html[lang="ar"] body *::after {
  line-height: 1.75;
  letter-spacing: normal;
  font-style: normal;
}

html[lang="ar"] h1 {
  font-size: clamp(1.8rem, 5.5vw, 3rem);
}

html[lang="ar"] h2 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
}

html[lang="ar"] .gros-404 {
  line-height: 1;
}

/* Chiffres jamais réordonnés. */
[dir="rtl"] .chiffre b,
[dir="rtl"] .prix {
  direction: ltr;
}

/* Miroir : le tampon s'incline dans l'autre sens ; logo, photos et pastille de
   remise ne sont jamais retournés. */
[dir="rtl"] .tampon {
  transform: rotate(10deg);
}
