/* Styles repris de la maquette AluQuébec. */
.mm-pop .leaflet-popup-content-wrapper { background:#FFF; border:1px solid #213f99; border-radius:14px; box-shadow:0 12px 30px rgba(33,63,153,.2); }
  .mm-pop .leaflet-popup-content { margin:15px 17px 16px; }
  .mm-pop .leaflet-popup-tip { background:#FFF; border:1px solid #213f99; }
  .mm-pop .leaflet-popup-content-wrapper { cursor:pointer; transition:box-shadow .28s ease, background-image .28s ease; }
  .mm-pop .leaflet-popup-content-wrapper:hover { box-shadow:0 14px 34px rgba(33,63,153,.24); background-image:radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(237,27,50,.55), rgba(237,27,50,0) 70%), linear-gradient(45deg, #000000 0%, #213f99 70%); }
  .mm-pop .leaflet-popup-tip { transition:background .28s ease; }
  .mm-pop:hover .leaflet-popup-tip { background:#1a3280; }
  .mm-pop .mm-name { color:#213f99; transition:color .24s ease; }
  .mm-pop .mm-tag { background:#f5f7fc; color:#213f99; transition:background .24s ease, color .24s ease; }
  .mm-pop .mm-arrow { color:#213f99; background:transparent; }
  .mm-pop .leaflet-popup-content-wrapper:hover .mm-name { color:#FFFFFF; }
  .mm-pop .leaflet-popup-content-wrapper:hover .mm-tag { background:rgba(81,199,255,.12); color:#FFFFFF; }
  .mm-pop .leaflet-popup-content-wrapper:hover .mm-arrow { color:#213f99; background:#51c7ff; }
  .mm-pop .mm-arrow { opacity:0; transform:translateX(-10px); transition:opacity .24s ease, transform .3s cubic-bezier(.22,.61,.36,1), background .24s ease, color .24s ease; }
  .mm-pop .leaflet-popup-content-wrapper:hover .mm-arrow { opacity:1; transform:translateX(0); }
  @media (max-width: 768px) { .mm-pop .mm-arrow { opacity:1; transform:translateX(0); } }
  @media (max-width: 768px), (hover: none) {
    .mm-pop .leaflet-popup-content-wrapper:hover { box-shadow:0 12px 30px rgba(33,63,153,.2); background-image:none; background-color:#FFF; }
    .mm-pop:hover .leaflet-popup-tip { background:#FFF; }
    .mm-pop .leaflet-popup-content-wrapper:hover .mm-name { color:#213f99; }
    .mm-pop .leaflet-popup-content-wrapper:hover .mm-tag { background:#f5f7fc; color:#213f99; }
    .mm-pop .leaflet-popup-content-wrapper:hover .mm-arrow { background:transparent; color:#213f99; }
  }
  /* Halo d’attention : un point de lumière qui fait le tour du bouton, en encre, puis s’efface. */
  .cat-glow { position:absolute; inset:-2px; border-radius:99px; pointer-events:none; padding:1.5px; overflow:hidden; filter:drop-shadow(0 0 3px rgba(81,199,255,.55));
    -webkit-mask:linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
    -webkit-mask-composite:xor; mask:linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
    mask-composite:exclude;
    animation:glowFade 3s cubic-bezier(.4,0,.2,1) both; }
  .cat-glow::before { content:''; position:absolute; top:50%; left:50%; width:280%; aspect-ratio:1;
    background:conic-gradient(from 0deg, rgba(81,199,255,0) 0deg, #51c7ff 45deg, #213f99 110deg, rgba(237,27,50,.45) 150deg, rgba(237,27,50,0) 175deg, rgba(81,199,255,0) 360deg);
    animation:glowSpin 1.45s linear infinite; }
  @keyframes glowSpin { from { transform:translate(-50%,-50%) rotate(0deg) } to { transform:translate(-50%,-50%) rotate(360deg) } }
  @keyframes glowFade { 0% { opacity:0 } 10% { opacity:1 } 80% { opacity:1 } 100% { opacity:0 } }
  .leaflet-container { font-family:'Barlow',sans-serif; background:#f5f6f8; }
  .leaflet-tile-loaded { opacity:1 !important; }
  .leaflet-control-attribution { font-size:14px; color:#6b7076; }
  .leaflet-bottom.leaflet-left { bottom:22px; right:14px; top:auto; left:auto; }
  .leaflet-bottom.leaflet-left .leaflet-control-zoom { margin:0 0 0 auto; border:1px solid #213f99; border-radius:99px; overflow:hidden; box-shadow:0 2px 8px rgba(33,63,153,.12); }
  .leaflet-control-zoom a.leaflet-control-zoom-in, .leaflet-control-zoom a.leaflet-control-zoom-out { width:34px; height:34px; line-height:32px; background:#FFF; color:#213f99; border:none; font-size:17px; font-weight:400; }
  .leaflet-control-zoom a.leaflet-control-zoom-in { border-bottom:1px solid #E1E4E6; }
  .leaflet-control-zoom a:hover { background:#213f99; color:#FFF; }
  html, body { margin:0; padding:0; background:#FFFFFF; }
  body { font-family:'Barlow', system-ui, sans-serif; color:#213f99; -webkit-font-smoothing:antialiased; }
  * { box-sizing:border-box; font-variant-numeric:tabular-nums; }
  a { color:#213f99; text-decoration:underline; text-underline-offset:3px; }
  a:hover { color:#6b7076; }
  input { font-family:inherit; }
  input[type="search"] { -webkit-appearance:none; appearance:none; }
  input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance:none; display:none; }
  @keyframes reveal { from { opacity:0; transform:translateY(4px) } to { opacity:1; transform:none } }
  @keyframes fadeUp { from { opacity:0; transform:translateY(14px) } to { opacity:1; transform:none } }
  @keyframes slideInL { from { opacity:0; transform:translateX(56px) } to { opacity:1; transform:none } }
  @keyframes wipeDiag { from { clip-path:polygon(-30% 0,0 0,-60% 100%,-90% 100%) } to { clip-path:polygon(-30% 0,140% 0,200% 100%,-90% 100%) } }
  image-slot[data-noring]::part(ring) { display:none }
  image-slot::part(empty) { opacity:0 !important }
  @keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
  @keyframes swapIn { from { opacity:0; transform:translateY(14px) } to { opacity:1; transform:none } }
  @keyframes pastIn { from { transform:scale(.15) rotate(-18deg) } to { transform:none } }
  @keyframes sheetSide { from { transform:translateX(100%) } to { transform:none } }
  @keyframes sheetLeft { from { transform:translateX(-100%) } to { transform:none } }
  @keyframes sheetIn { from { opacity:0; transform:scale(.985) translateY(18px) } to { opacity:1; transform:none } }
  @keyframes barIn { from { opacity:0; transform:translateY(-100%) } to { opacity:1; transform:none } }
  @keyframes stagger { from { opacity:0; transform:translateY(10px) } to { opacity:1; transform:none } }
  @keyframes scrimIn { from { background:rgba(33,63,153,0); backdrop-filter:blur(0) } to { background:rgba(33,63,153,.62); backdrop-filter:blur(3px) } }
  @keyframes zoomIn { from { opacity:0; transform:scale(.9) translateY(16px) } 60% { opacity:1 } to { opacity:1; transform:none } }
  @keyframes cardInA { from { opacity:0; transform:translateY(16px) scale(.955) } to { opacity:1; transform:none } }
  @keyframes cardInB { from { opacity:0; transform:translateY(16px) scale(.955) } to { opacity:1; transform:none } }
  @keyframes countPopA { from { opacity:.15; transform:translateY(-5px) } to { opacity:1; transform:none } }
  @keyframes countPopB { from { opacity:.15; transform:translateY(-5px) } to { opacity:1; transform:none } }
  @keyframes mmFade { from { opacity:0 } to { opacity:1 } }
  @keyframes srchPill { from { opacity:0; transform:scale(.7) } to { opacity:1; transform:none } }
  @keyframes srchField { from { opacity:0; transform:translateY(-6px) } to { opacity:1; transform:none } }
  @keyframes chipPop { from { opacity:0; transform:scale(.82) } 70% { transform:scale(1.04) } to { opacity:1; transform:none } }
  @keyframes homeWordIn { from { opacity:0; transform:translateX(-28px) } to { opacity:1; transform:none } }
  @keyframes homeWordNudge { 0% { transform:none } 35% { transform:translateX(14px); color:#51c7ff } 65% { transform:translateX(14px); color:#51c7ff } 100% { transform:none } }
  @keyframes scanSweep { from { transform:translateX(-110%) } to { transform:translateX(360%) } }
  html { scroll-behavior:smooth }
  ::selection { background:#213f99; color:#FFFFFF }
  ::-webkit-scrollbar { width:11px; height:11px }
  ::-webkit-scrollbar-thumb { background:#E1E4E6; border-radius:99px; border:3px solid #FFFFFF }
  ::-webkit-scrollbar-thumb:hover { background:#E1E4E6 }
  ::-webkit-scrollbar-track { background:transparent }
  input::placeholder { color:#6b7076 }
  @media (max-width: 768px) { html, body { scrollbar-width:none } html::-webkit-scrollbar, body::-webkit-scrollbar { display:none } }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important } }

/* Le web component <market-map> est display:inline par défaut : sans cette règle
   il n'a aucune boîte, this.style.height='100%' est ignoré et Leaflet ne se
   dimensionne pas (pastilles hors cadre, contrôles étirés). */
market-map { display: block; width: 100%; height: 100%; }

/* ─────────────────────────────────────────────────────────────────────────
   Survols et animations d'entrée.

   Les styles inline de React ne savent pas exprimer :hover ni :focus-visible.
   La maquette s'appuyait sur un attribut style-hover propre à son runtime ;
   ces classes le remplacent, en réutilisant les @keyframes déjà extraits
   du gabarit plus haut dans ce fichier.
   ───────────────────────────────────────────────────────────────────────── */

/* Un visiteur qui demande moins d'animation n'en reçoit aucune. */
@media (prefers-reduced-motion: reduce) {
  .aq-anim, .aq-anim * { animation: none !important; transition: none !important; }
}

/* Focus clavier visible partout, sans l'imposer au clic souris. */
.aq-focus:focus-visible {
  outline: 2px solid var(--alu-cyan);
  outline-offset: 2px;
  border-radius: inherit;
}

/* Lien éditorial : le soulignement se révèle au survol. */
.aq-lien { transition: color .15s, text-decoration-color .15s; text-decoration-color: transparent; }
.aq-lien:hover { color: #1a9ad6; text-decoration-color: #1a9ad6; }

/* Pilule de filtre : le gabarit ne change que la couleur de bordure, en .18s. */
.aq-pilule { transition: border-color .18s; }
.aq-pilule:hover { border-color: #213f99; }

/* Bouton « Recadrer » posé sur la carte : il s'inverse complètement au survol,
   donc ni fond ni couleur en inline. */
.aq-recadrer {
  background: #FFFFFF; border: 1px solid #213f99; color: #213f99;
  transition: background .2s ease, color .2s ease, opacity .18s ease;
}
.aq-recadrer:hover { background: #213f99; color: #FFFFFF; }

/* Chips supprimables et boutons d'action : bordure + fond, comme le gabarit. */
.aq-chip-action { transition: border-color .18s, background .18s; }
.aq-chip-action:hover { border-color: #213f99; background: #EDF1FA; }

/* Bouton rond de fermeture. */
.aq-rond { transition: background .18s ease; }
.aq-rond:hover { background: #f5f6f8; }

/* Rangée de marché sur l'accueil : le nom glisse depuis la gauche. */
.aq-marche { animation: homeWordIn .5s cubic-bezier(.22,.61,.36,1) both; }
.aq-marche .aq-marche-nom { transition: background-position .6s cubic-bezier(.22,.61,.36,1), color .25s ease; background-size: 200% 100%; background-position: 0 0; }
.aq-marche:hover .aq-marche-nom { background-position: 100% 0; }
.aq-marche:hover .aq-marche-fleche { transform: translateX(4px); }
.aq-marche .aq-marche-fleche { transition: transform .3s cubic-bezier(.22,.61,.36,1); }

/* Carte d'organisation. Valeurs relevées en survolant réellement la maquette :
   la carte grossit de 4,5 %, se soulève de 4px, prend une bordure bleue et une
   ombre à deux couches. */
.aq-carte {
  /* Apparence de base ici et non en style inline : une bordure inline bat la
     règle :hover de la feuille, et le survol ne pouvait pas s'appliquer. */
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px; border-radius: 18px; cursor: pointer;
  border: 1px solid #E1E4E6; background: #FFFFFF;
  animation: cardInB .44s cubic-bezier(.22,.61,.36,1) backwards;
  transition: transform .34s cubic-bezier(.22,.61,.36,1), box-shadow .34s, border-color .24s;
}
.aq-carte.est-active { border-color: #213f99; }

/* Couche de dégradé révélée au survol : un halo rouge qui suit le curseur,
   par-dessus une base noir → bleu en diagonale. Relevé sur la maquette, où
   c'est un enfant en inset:0 dont l'opacité passe de 0 à 1 en .4s. */
.aq-carte { position: relative; overflow: hidden; }
.aq-carte-fond {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity .4s;
  background-image:
    radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(237,27,50,.5), rgba(237,27,50,0) 70%),
    linear-gradient(45deg, #000000 0%, #213f99 70%);
}
.aq-carte:hover .aq-carte-fond,
.aq-carte:focus-visible .aq-carte-fond { opacity: 1; }

/* Le contenu repasse au-dessus de la couche, et son texte vire au blanc. */
.aq-carte > *:not(.aq-carte-fond) { position: relative; z-index: 1; }
/* Couleurs de base ici aussi : en style inline elles battraient les règles de
   survol ci-dessous, et le texte resterait bleu sur le fond sombre. */
.aq-carte .aq-carte-nom { color: #213f99; transition: color .24s ease; }
.aq-carte .aq-chip {
  background-color: #F5F7FC; color: #213f99;
  transition: color .24s ease, background-color .24s ease;
}
.aq-carte:hover .aq-carte-nom,
.aq-carte:focus-visible .aq-carte-nom { color: #FFFFFF; }
.aq-carte:hover .aq-chip,
.aq-carte:focus-visible .aq-chip { background-color: rgba(81,199,255,.12); color: #FFFFFF; }

/* Surtitre des marchés, affiché en vue « tous les marchés ». */
.aq-carte .aq-carte-surtitre { color: #6b7076; transition: color .24s ease; }
.aq-carte:hover .aq-carte-surtitre,
.aq-carte:focus-visible .aq-carte-surtitre { color: #FFFFFF; }

/* Flèche du coin bas droit : invisible et décalée au repos, elle glisse en
   place dans un disque cyan au survol. */
.aq-carte .aq-carte-fleche {
  background: transparent; color: #213f99; opacity: 0; transform: translateX(-10px);
  transition: opacity .22s ease, transform .3s cubic-bezier(.22,.61,.36,1),
              background .24s ease, color .24s ease;
}
.aq-carte:hover .aq-carte-fleche,
.aq-carte:focus-visible .aq-carte-fleche {
  background: #51c7ff; color: #213f99; opacity: 1; transform: translateX(0);
}

/* La feuille d'érable suit le contraste : rose sur la carte claire, blanche
   une fois le fond sombre révélé au survol. */
.aq-feuille { display: inline-flex; color: #F25A72; transition: color .24s ease; }
.aq-carte:hover .aq-feuille,
.aq-carte:focus-visible .aq-feuille { color: #FFFFFF; }
.aq-carte:hover {
  border-color: #213f99;
  box-shadow: 0 2px 4px rgba(33,63,153,.06), 0 6px 14px rgba(33,63,153,.1);
  transform: scale(1.045) translateY(-4px);
}

/* Chips de produits-services. */
.aq-chip { animation: chipPop .32s cubic-bezier(.22,.61,.36,1) both; }

/* Option cochable d'un panneau de filtre : seul le texte change de couleur. */
.aq-option { transition: color .2s ease; }
.aq-option:hover:not(:disabled) { color: #1a9ad6; }

/* Champ de recherche interne à un panneau : anneau cyan à la saisie. */
.aq-recherche-panneau {
  background: #FFFFFF; border: 1px solid #E1E4E6; transition: border-color .2s ease;
}
.aq-recherche-panneau:focus-within { border-color: #51c7ff; box-shadow: 0 0 0 3px rgba(81,199,255,.4); }

/* Entrée des écrans et des panneaux. */
.aq-ecran { animation: fadeIn .32s ease both; }
.aq-barre { animation: barIn .34s cubic-bezier(.22,.61,.36,1) both; }
.aq-panneau { animation: fadeUp .18s cubic-bezier(.22,.61,.36,1) both; }
.aq-voile { animation: scrimIn .24s ease both; }
.aq-terme { animation: srchPill .28s cubic-bezier(.22,.61,.36,1) both; }

/* Entrée du menu de bascule de marché. */
.aq-menu { animation: fadeUp .24s cubic-bezier(.22,.61,.36,1) both; }
.aq-menu-item { transition: background .25s ease, padding .28s cubic-bezier(.22,.61,.36,1); }
.aq-menu-item:hover:not(:disabled) { background: #f5f7fc; padding-left: 28px; }

/* Accueil, variante grand écran : les noms de marché forment un bloc serré et
   le compte se déplie au survol en poussant le nom. Le gabarit anime
   width + opacity ; la poussée du nom vient naturellement du flux flex.
   Le compte apparaît aussi au focus clavier : le cacher derrière le seul
   survol le rendrait inatteignable sans souris. */
.aq-marche-compte {
  flex: none; width: 0; overflow: hidden; opacity: 0; white-space: nowrap;
  transition: width .4s cubic-bezier(.22,.61,.36,1), opacity .3s ease;
}
.aq-marche:hover .aq-marche-compte,
.aq-marche:focus-visible .aq-marche-compte,
.aq-marche:focus-within .aq-marche-compte { width: 148px; opacity: 1; }

/* Nom du marché dans l'entête : le dégradé fait deux fois la largeur du mot et
   glisse au survol, ce qui fait virer la fin du mot au cyan. */
.aq-titre-marche { transition: background-position .6s cubic-bezier(.22,.61,.36,1); }
.aq-titre-marche:hover { background-position: 100% 0; }

/* Champ de recherche de la bande de filtres. Fond, bordure et ombre vivent ici
   et non en inline, sinon :focus-within ne pourrait pas les reprendre. */
.aq-recherche {
  background: #FFFFFF; border: 1px solid #E1E4E6;
  transition: border-color .2s ease, box-shadow .22s ease;
}
.aq-recherche:focus-within { border-color: #213f99; box-shadow: 0 4px 12px rgba(33,63,153,.07); }
.aq-effacer-x { background: #EDF1FA; color: #213f99; transition: background .18s ease, color .18s ease; }
.aq-effacer-x:hover { background: #213f99; color: #FFFFFF; }

/* Pastille d'un filtre actif : seule la bordure réagit au survol. */
.aq-pastille {
  background: #EDF1FA; border: 1px solid transparent; color: #213f99;
  animation: chipPop .3s cubic-bezier(.22,.61,.36,1) backwards;
  transition: border-color .2s ease, background .2s ease;
}
.aq-pastille:hover { border-color: #C9D4EE; }
.aq-pastille-x { color: #213f99; transition: color .18s ease; }
.aq-pastille-x:hover { color: #1a9ad6; }

/* Lien « Effacer » : souligné fin révélé au survol. */
.aq-effacer { color: #213f99; text-decoration: none; transition: color .18s ease; }
.aq-effacer:hover { color: #1a9ad6; text-decoration: underline; text-decoration-thickness: .5px; }

/* Compteur d'organisations : il repart de -5px à chaque changement de total. */
.aq-compte { animation: countPopB .42s cubic-bezier(.22,.61,.36,1) backwards; }
