/* ==========================================================================
   Hero v2 — Page d'accueil Savoor.fr
   Refonte de la section hero (prototype design new/hero/)

   Ce fichier est chargé APRÈS hero-search-modes.css et page-accueil.css,
   ses règles ont donc la priorité et écrasent les anciens styles.
   ========================================================================== */

/* ==========================================================================
   1. Variables CSS (réutilisent --primary-color et --color-restes globaux)
   ========================================================================== */
:root {
  /* Accents dynamiques (changent selon l'onglet) */
  --hero-accent: var(--primary-color);
  --hero-accent-hover: #e55a5a;
  --hero-accent-glow: rgba(255, 107, 107, 0.3);
  --hero-accent-bg-soft: rgba(255, 107, 107, 0.15);

  /* Surfaces du hero — dark (photo de fond sombre) */
  --hero-box-bg: rgba(42, 53, 64, 0.85);
  --hero-box-bg-solid: #2a3540;
  --hero-input-bg: rgba(255, 255, 255, 0.08);
  --hero-input-border: rgba(255, 255, 255, 0.1);

  --hero-badge-bg: rgba(58, 69, 80, 0.9);
  --hero-badge-bg-hover: rgba(74, 85, 96, 0.95);
  --hero-badge-border: rgba(255, 255, 255, 0.12);
  --hero-badge-text: rgba(255, 255, 255, 0.9);
  --hero-badge-icon: rgba(255, 255, 255, 0.65);

  /* Typographie hero */
  --hero-title-color: #ffffff;
  --hero-subtitle-color: rgba(255, 255, 255, 0.85);

  /* Modales — dark (défaut) */
  --hero-modal-bg: #2a3540;
  --hero-modal-text: #f0f0f0;
  --hero-modal-border: rgba(255, 255, 255, 0.08);
  --hero-modal-option-bg: #3a4550;
  --hero-modal-option-bg-hover: #4a5560;
  --hero-modal-option-text: #f0f0f0;
  --hero-modal-overlay: rgba(0, 0, 0, 0.6);
  --hero-modal-close-bg: rgba(255, 255, 255, 0.1);
  --hero-modal-close-color: rgba(255, 255, 255, 0.7);
  --hero-modal-input-bg: rgba(255, 255, 255, 0.08);
  --hero-modal-input-border: rgba(255, 255, 255, 0.12);
}

/* Mode clair : search box et modales passent en clair */
html:not(.dark-mode) {
  --hero-box-bg: rgba(255, 255, 255, 0.92);
  --hero-box-bg-solid: #ffffff;
  --hero-input-bg: rgba(0, 0, 0, 0.04);
  --hero-input-border: rgba(0, 0, 0, 0.08);

  --hero-badge-bg: #ffffff;
  --hero-badge-bg-hover: #f5f5f5;
  --hero-badge-border: rgba(0, 0, 0, 0.08);
  --hero-badge-text: #333333;
  --hero-badge-icon: #777777;

  --hero-modal-bg: #ffffff;
  --hero-modal-text: #333333;
  --hero-modal-border: #eeeeee;
  --hero-modal-option-bg: #f0f0f0;
  --hero-modal-option-bg-hover: #e5e5e5;
  --hero-modal-option-text: #333333;
  --hero-modal-close-bg: #f0f0f0;
  --hero-modal-close-color: #666666;
  --hero-modal-input-bg: #f7f7f7;
  --hero-modal-input-border: #e0e0e0;
}

/* ==========================================================================
   2. Section Hero
   ========================================================================== */
main > .hero,
.hero {
  position: relative !important;
  text-align: center;
  padding: 60px 20px 60px !important;
  min-height: 570px;
  overflow: hidden !important;
  display: flex !important;
  /* flex-start pour que le titre reste à la même position verticale peu
     importe la hauteur de la search box (qui peut grandir en mode restes
     quand on ajoute des pills d'ingrédients) */
  align-items: flex-start !important;
  justify-content: center;
  isolation: isolate;
}

/* Background : div avec background-image injecté par page-accueil.js */
.hero #heroBackground {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat;
  z-index: 0 !important;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hero #heroBackground.loaded {
  opacity: 1;
}

/* Overlay sombre pour lisibilité du texte (au-dessus du bg, sous le contenu) */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.45) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Conteneur du contenu (titre, sous-titre, search box) au-dessus */
.hero > .container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 0 !important;
}

/* ==========================================================================
   3. Titre + sous-titre
   ========================================================================== */
.hero #heroTitle,
.hero .hero-title,
.hero h1 {
  font-size: 2.4rem !important;
  font-weight: 800 !important;
  color: var(--hero-title-color) !important;
  margin: 0 0 14px !important;
  line-height: 1.15 !important;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.hero #heroSubtitle,
.hero .hero-subtitle,
.hero p:first-of-type {
  font-size: 1.1rem !important;
  color: var(--hero-subtitle-color) !important;
  margin: 0 auto 32px !important;
  font-weight: 400 !important;
  text-align: center !important;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  max-width: none !important;
}

/* ==========================================================================
   4. Search Box (glassmorphism + glow radial interne)
   Utilise #heroSearchBox pour battre .dark-mode .hero-search-box { !important }
   ========================================================================== */
#heroSearchBox {
  position: relative !important;
  background: var(--hero-box-bg) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 22px !important;
  padding: 8px 30px 36px !important;
  max-width: 720px !important;
  min-height: 330px !important;
  margin: 0 auto !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35) !important;
  /* overflow visible pour laisser sortir le dropdown d'autocomplétion ;
     le glow radial ::before est clippé via son propre conteneur */
  overflow: visible !important;
  isolation: isolate;
}

/* Le glow radial est clippé par un pseudo-élément en overflow hidden
   pour ne pas déborder, tandis que la box reste ouverte pour les enfants. */
#heroSearchBox::before {
  border-radius: 22px;
  overflow: hidden;
}

html.dark-mode #heroSearchBox {
  background: var(--hero-box-bg) !important;
}

html:not(.dark-mode) #heroSearchBox {
  border-color: rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25) !important;
}

/* Glow radial interne (bas-centre, teinté selon le mode actif) */
#heroSearchBox::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 70% at 50% 100%,
    rgba(255, 107, 107, 0.22) 0%,
    rgba(255, 107, 107, 0.10) 35%,
    rgba(255, 107, 107, 0.03) 60%,
    transparent 80%
  );
  z-index: 0;
  pointer-events: none;
  transition: background 0.4s ease;
}

/* Glow vert en mode "Cuisiner les restes" */
#heroSearchBox[data-mode="restes"]::before {
  background: radial-gradient(
    ellipse 80% 70% at 50% 100%,
    rgba(124, 176, 131, 0.22) 0%,
    rgba(124, 176, 131, 0.10) 35%,
    rgba(124, 176, 131, 0.03) 60%,
    transparent 80%
  );
}

/* Tous les enfants directs passent au-dessus du glow */
#heroSearchBox > * {
  position: relative;
  z-index: 1;
}

/* L'input wrapper doit passer au-dessus des zones filtres/restes pour que
   le dropdown d'autocomplétion (enfant positionné en absolute) descende
   au-dessus des chips/badges situés plus bas dans le DOM. */
#heroSearchBox .hero-search-input-wrapper {
  z-index: 10 !important;
}

/* ==========================================================================
   5. Onglets
   ========================================================================== */
#heroSearchBox .hero-mode-tabs {
  display: flex !important;
  position: relative;
  margin-bottom: 32px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: none !important;
  padding: 0 !important;
  gap: 0 !important;
  justify-content: stretch !important;
  flex-wrap: nowrap !important;
}

html:not(.dark-mode) #heroSearchBox .hero-mode-tabs {
  border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

/* Neutralise l'ancien séparateur inline de hero-search-modes.css */
#heroSearchBox .hero-mode-tabs .hero-mode-separator {
  display: none !important;
}

#heroSearchBox .hero-mode-tab {
  flex: 1 !important;
  background: none !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 0.98rem !important;
  font-weight: 600 !important;
  padding: 16px 0 20px 0 !important;
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
  z-index: 2;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
}

#heroSearchBox .hero-mode-tab:hover {
  color: rgba(255, 255, 255, 0.85) !important;
  background: none !important;
}

#heroSearchBox .hero-mode-tab.active {
  color: #fff !important;
  background: none !important;
}

html:not(.dark-mode) #heroSearchBox .hero-mode-tab {
  color: rgba(0, 0, 0, 0.55) !important;
}

html:not(.dark-mode) #heroSearchBox .hero-mode-tab:hover {
  color: rgba(0, 0, 0, 0.85) !important;
}

html:not(.dark-mode) #heroSearchBox .hero-mode-tab.active {
  color: #222 !important;
}

/* Masque l'icône (flame/search) de l'ancien markup */
#heroSearchBox .hero-mode-tab > i {
  display: none !important;
}

/* Force l'affichage du label span sur tous les breakpoints
   (override de hero-search-modes.css L.306 qui le masque en mobile) */
#heroSearchBox .hero-mode-tab > span {
  display: inline-block !important;
}

/* Indicateur animé sous l'onglet actif */
#heroSearchBox .hero-mode-tabs::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50%;
  height: 3px;
  background: var(--hero-accent);
  border-radius: 3px 3px 0 0;
  transition: transform 0.3s ease, background-color 0.3s ease;
  z-index: 1;
}

#heroSearchBox[data-mode="restes"] .hero-mode-tabs::after {
  transform: translateX(100%);
  background: var(--color-restes);
}

/* ==========================================================================
   6. Input de recherche
   ========================================================================== */
#heroSearchBox .hero-search-input-wrapper {
  display: flex !important;
  align-items: center !important;
  background: var(--hero-input-bg) !important;
  border-radius: 16px !important;
  padding: 7px 7px 7px 8px !important;
  border: 1px solid var(--hero-input-border) !important;
  transition: border-color 0.2s, background 0.2s;
  box-shadow: none !important;
  overflow: visible !important;
}

#heroSearchBox .hero-search-input-wrapper:focus-within {
  border-color: var(--hero-accent) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}

html:not(.dark-mode) #heroSearchBox .hero-search-input-wrapper:focus-within {
  background: rgba(0, 0, 0, 0.06) !important;
}

#heroSearchBox[data-mode="restes"] .hero-search-input-wrapper:focus-within {
  border-color: var(--color-restes) !important;
}

#heroSearchBox .hero-search-input {
  flex: 1 !important;
  background: none !important;
  border: none !important;
  color: #fff !important;
  padding: 14px 16px !important;
  font-size: 1rem !important;
  outline: none !important;
  min-width: 0;
}

#heroSearchBox .hero-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

html:not(.dark-mode) #heroSearchBox .hero-search-input {
  color: #222 !important;
}

html:not(.dark-mode) #heroSearchBox .hero-search-input::placeholder {
  color: rgba(0, 0, 0, 0.4) !important;
}

#heroSearchBox .hero-search-btn {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: none !important;
  background: var(--hero-accent) !important;
  color: white !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--hero-accent-glow) !important;
  overflow: hidden;
}

/* Neutralise l'effet de pulse ::after de page-accueil.css */
#heroSearchBox .hero-search-btn::after {
  display: none !important;
}

#heroSearchBox .hero-search-btn:hover {
  background: var(--hero-accent-hover) !important;
  transform: scale(1.06) !important;
  box-shadow: 0 6px 18px var(--hero-accent-glow) !important;
}

#heroSearchBox .hero-search-btn:active {
  transform: scale(0.98) !important;
}

#heroSearchBox .hero-search-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  position: static !important;
}

#heroSearchBox[data-mode="restes"] .hero-search-btn {
  background: var(--color-restes) !important;
  box-shadow: 0 4px 14px rgba(124, 176, 131, 0.3) !important;
}

#heroSearchBox[data-mode="restes"] .hero-search-btn:hover {
  background: var(--color-restes-hover) !important;
}

/* ==========================================================================
   7. Zone Filtres (mode Rechercher) — grille 3×2
   ========================================================================== */
#heroSearchBox .hero-filters-container {
  margin-top: 32px !important;
  /* Pas de hauteur fixe ici : c'est #heroSearchBox { min-height } qui
     assure la parité de hauteur entre les deux modes au chargement. */
  height: auto !important;
  min-height: auto !important;
  display: block !important;
}

#heroSearchBox .hero-filters {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 18px !important;
  max-width: 560px !important;
  margin: 0 auto !important;
  flex-wrap: initial !important;
  justify-content: initial !important;
}

/* Badge de filtre (override complet des anciens styles inline) */
#heroSearchBox .hero-filter-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 11px 16px !important;
  background: var(--hero-badge-bg) !important;
  border: 1px solid var(--hero-badge-border) !important;
  border-radius: 25px !important;
  color: var(--hero-badge-text) !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  box-shadow: none !important;
}

#heroSearchBox .hero-filter-badge > i {
  color: var(--hero-badge-icon) !important;
  font-size: 0.95rem !important;
  transition: color 0.2s ease;
}

#heroSearchBox .hero-filter-badge:hover {
  background: var(--hero-badge-bg-hover) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

#heroSearchBox .hero-filter-badge:hover > i {
  color: var(--hero-accent) !important;
}

html:not(.dark-mode) #heroSearchBox .hero-filter-badge:hover {
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #111 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

#heroSearchBox .hero-filter-badge.has-filters {
  border-color: var(--hero-accent) !important;
  background: var(--hero-accent-bg-soft) !important;
  color: #fff !important;
}

#heroSearchBox .hero-filter-badge.has-filters > i {
  color: var(--hero-accent) !important;
}

html:not(.dark-mode) #heroSearchBox .hero-filter-badge.has-filters {
  color: #111 !important;
}

/* Compteur en pastille positionnée en haut-droite du badge (notification dot) */
#heroSearchBox .hero-filter-badge .filter-count {
  display: none;
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;
  background: var(--hero-accent) !important;
  color: white !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  line-height: 22px !important;
  text-align: center !important;
  margin: 0 !important;
  border: 2px solid var(--hero-box-bg-solid, #2a3540) !important;
  box-shadow: 0 2px 6px var(--hero-accent-glow) !important;
  pointer-events: none;
}

#heroSearchBox .hero-filter-badge.has-filters .filter-count {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* NEUTRALISATION : anciens dropdowns inline sous les badges */
#heroSearchBox .hero-filter-badge .hero-filter-dropdown,
#heroSearchBox .hero-filter-dropdown {
  display: none !important;
}

/* ==========================================================================
   8. Zone Restes (mode Cuisiner les restes)
   ========================================================================== */
#heroSearchBox .hero-restes-zone {
  margin-top: 32px !important;
  /* Pas de hauteur fixe : la zone s'étend naturellement quand on ajoute
     des pills d'ingrédients. La hauteur minimale de la search box est
     garantie par #heroSearchBox { min-height: 340px }. */
  min-height: auto !important;
  height: auto !important;
  display: none !important;
  animation: heroV2FadeIn 0.25s ease;
}

#heroSearchBox[data-mode="restes"] .hero-restes-zone {
  display: block !important;
}

#heroSearchBox[data-mode="restes"] .hero-filters-container {
  display: none !important;
}

@keyframes heroV2FadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Chips d'exemples en HAUT */
#heroSearchBox .hero-restes-examples {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  justify-content: center !important;
  max-width: 560px !important;
  margin: 0 auto !important;
}

#heroSearchBox .hero-restes-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 18px !important;
  background: transparent !important;
  border: 1.5px solid var(--color-restes) !important;
  border-radius: 25px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* Masque les anciens emojis au profit des icônes FA */
#heroSearchBox .hero-restes-chip .chip-emoji {
  display: none !important;
}

#heroSearchBox .hero-restes-chip > i {
  color: var(--color-restes) !important;
  font-size: 0.85rem !important;
  transition: color 0.2s ease;
}

#heroSearchBox .hero-restes-chip:hover {
  background: rgba(124, 176, 131, 0.15) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

/* État actif : ingrédients sélectionnés depuis la modale */
#heroSearchBox .hero-restes-chip.has-filters {
  background: rgba(124, 176, 131, 0.18) !important;
  color: #fff !important;
}

html:not(.dark-mode) #heroSearchBox .hero-restes-chip.has-filters {
  color: #111 !important;
}

/* Compteur en pastille (verte) sur les chips restes, identique au système des badges */
#heroSearchBox .hero-restes-chip {
  position: relative;
}

#heroSearchBox .hero-restes-chip .filter-count {
  display: none;
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;
  background: var(--color-restes) !important;
  color: white !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  line-height: 22px !important;
  text-align: center !important;
  margin: 0 !important;
  border: 2px solid var(--hero-box-bg-solid, #2a3540) !important;
  box-shadow: 0 2px 6px rgba(124, 176, 131, 0.35) !important;
  pointer-events: none;
}

#heroSearchBox .hero-restes-chip.has-filters .filter-count {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

@media (max-width: 480px) {
  #heroSearchBox .hero-restes-chip .filter-count {
    width: 20px !important;
    min-width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    font-size: 0.7rem !important;
    top: -7px !important;
    right: -7px !important;
  }
}

html:not(.dark-mode) #heroSearchBox .hero-restes-chip {
  color: #333 !important;
}

html:not(.dark-mode) #heroSearchBox .hero-restes-chip:hover {
  color: #111 !important;
}

/* Pills des ingrédients ajoutés EN BAS (sous les chips) */
#heroSearchBox .hero-restes-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  justify-content: center !important;
  margin-top: 20px !important;
}

/* Tags neutres : clairement différents des hero-restes-chip (qui sont verts).
   Fond sombre translucide + bordure neutre, pour ne pas entrer en conflit
   visuel avec la couleur d'accent du mode restes. */
#heroSearchBox .hero-restes-tag {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 20px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.85rem !important;
}

html:not(.dark-mode) #heroSearchBox .hero-restes-tag {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #333 !important;
}

#heroSearchBox .hero-restes-tag-remove {
  background: none !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer;
  padding: 0 !important;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

#heroSearchBox .hero-restes-tag-remove:hover {
  color: #fff !important;
}

html:not(.dark-mode) #heroSearchBox .hero-restes-tag-remove {
  color: rgba(0, 0, 0, 0.5) !important;
}

html:not(.dark-mode) #heroSearchBox .hero-restes-tag-remove:hover {
  color: #111 !important;
}

/* ==========================================================================
   9. Modales de filtre (centrées, plein écran)
   ========================================================================== */

/* Verrouillage du scroll de la page quand une modale hero est ouverte.
   Convention : la scrollbar reste visible telle quelle (pas de compensation,
   pas de overflow:hidden qui masquerait la scrollbar). Voir
   .claude/rules/ui-ux-conventions.md. La position du scroll est stockée
   dans --scroll-top par le JS et restaurée à la fermeture.

   overflow-y: scroll sur <html> force la scrollbar à rester affichée,
   même quand <body> passe en position:fixed (sans contenu à scroller
   pour <html>, la scrollbar disparaîtrait autrement, créant un décalage). */
html.hero-modal-open {
  overflow-y: scroll;
}

body.hero-modal-open {
  position: fixed;
  width: 100%;
  top: calc(var(--scroll-top, 0px) * -1);
}

.hero-filter-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  padding: 20px;
}

.hero-filter-modal.open {
  opacity: 1;
  visibility: visible;
}

.hero-filter-modal-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-modal-overlay);
  backdrop-filter: blur(2px);
}

.hero-filter-modal-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  border-radius: 18px;
  overflow: hidden;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  background: var(--hero-modal-bg);
  color: var(--hero-modal-text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

html:not(.dark-mode) .hero-filter-modal-panel {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.hero-filter-modal.open .hero-filter-modal-panel {
  transform: scale(1) translateY(0);
}

.hero-filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hero-modal-border);
  flex-shrink: 0;
}

.hero-filter-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--hero-modal-text);
}

.hero-filter-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--hero-modal-close-bg);
  color: var(--hero-modal-close-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.hero-filter-modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: rotate(90deg);
}

html:not(.dark-mode) .hero-filter-modal-close:hover {
  background: #e0e0e0;
  color: #333;
}

.hero-filter-modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.hero-filter-modal-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Quand le contenu est un message pleine largeur (non connecté, vide) */
.hero-filter-modal-options > div:only-child {
  width: 100%;
}

/* Pills d'option (radio/checkbox caché, label stylé) */
.hero-filter-modal .filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 11px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s;
  user-select: none;
  border: 2px solid transparent;
  background: var(--hero-modal-option-bg);
  color: var(--hero-modal-option-text);
  margin: 0;
}

.hero-filter-modal .filter-pill:hover {
  background: var(--hero-modal-option-bg-hover);
  transform: translateY(-1px);
}

.hero-filter-modal .filter-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.hero-filter-modal .filter-pill:has(input:checked) {
  background: var(--hero-accent);
  color: white;
  border-color: var(--hero-accent);
  box-shadow: 0 4px 14px var(--hero-accent-glow);
}

/* Footer */
.hero-filter-modal-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 22px;
  border-top: 1px solid var(--hero-modal-border);
  flex-shrink: 0;
}

.hero-filter-modal .filter-reset-btn {
  padding: 11px 22px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.hero-filter-modal .filter-reset-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

html:not(.dark-mode) .hero-filter-modal .filter-reset-btn {
  border-color: #ddd;
  color: #666;
}

html:not(.dark-mode) .hero-filter-modal .filter-reset-btn:hover {
  border-color: #999;
  color: #333;
}

/* Footer : espacement entre réinitialiser et valider */
.hero-filter-modal-footer {
  gap: 12px !important;
}

/* Bouton Valider — couleur dynamique selon l'onglet actif */
.hero-filter-modal .filter-validate-btn {
  padding: 11px 28px;
  border-radius: 12px;
  border: none;
  background: var(--hero-accent);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px var(--hero-accent-glow);
}

.hero-filter-modal .filter-validate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--hero-accent-glow);
}

/* Badge "Mes ingrédients" sur le hero — coeur rouge */
#heroSearchBox .hero-restes-suggestion-perso > i {
  color: #e57373 !important;
}

#heroSearchBox .hero-restes-suggestion-perso.has-filters {
  border-color: #e57373 !important;
  background: rgba(229, 115, 115, 0.15) !important;
}

#heroSearchBox .hero-restes-suggestion-perso.has-filters > i {
  color: #e57373 !important;
}

#heroSearchBox .hero-restes-suggestion-perso .filter-count {
  background: #e57373 !important;
}

/* Modale restes : bouton valider en vert */
.hero-filter-modal-restes .filter-validate-btn {
  background: var(--color-restes) !important;
  box-shadow: 0 4px 14px rgba(124, 176, 131, 0.3) !important;
}

.hero-filter-modal-restes .filter-validate-btn:hover {
  background: var(--color-restes-hover) !important;
  box-shadow: 0 6px 18px rgba(124, 176, 131, 0.4) !important;
}

/* ==========================================================================
   9a. Autocomplete dropdown (mode restes)
   - Fond plein opaque (au-dessus des chips et du glow)
   - Même largeur que la barre de recherche (pas de décalage)
   - Styles harmonisés avec le nouveau design
   ========================================================================== */
/* Dropdown en position fixed (ajouté au body, pas dans le hero) pour
   éviter le clip par overflow:hidden du .hero */
.hero-autocomplete-dropdown-fixed {
  position: fixed !important;
  /* top, left, width calculés par JS */
  /* Fond plein opaque */
  background: #1e2832 !important;
  background-color: #1e2832 !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  /* Apparence */
  border: 1px solid rgba(124, 176, 131, 0.35) !important;
  border-radius: 16px !important;
  padding: 0 !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6),
              0 4px 12px rgba(0, 0, 0, 0.4) !important;
  max-height: 320px !important;
  overflow: hidden !important;
  z-index: 9000 !important;
  opacity: 1 !important;
}

/* Conteneur scrollable interne (clippé par le border-radius du parent) */
.hero-autocomplete-dropdown-fixed .hero-autocomplete-inner {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.hero-autocomplete-dropdown-fixed .hero-autocomplete-inner::-webkit-scrollbar {
  width: 6px;
}

.hero-autocomplete-dropdown-fixed .hero-autocomplete-inner::-webkit-scrollbar-track {
  background: transparent;
}

.hero-autocomplete-dropdown-fixed .hero-autocomplete-inner::-webkit-scrollbar-thumb {
  background: rgba(124, 176, 131, 0.4);
  border-radius: 3px;
}

.hero-autocomplete-dropdown-fixed .hero-autocomplete-inner::-webkit-scrollbar-thumb:hover {
  background: var(--color-restes);
}

html:not(.dark-mode) .hero-autocomplete-dropdown-fixed {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-color: rgba(124, 176, 131, 0.4) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18),
              0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Items de l'autocomplétion */
.hero-autocomplete-dropdown-fixed .hero-autocomplete-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 14px !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 10px !important;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.hero-autocomplete-dropdown-fixed .hero-autocomplete-item + .hero-autocomplete-item {
  margin-top: 2px !important;
}

.hero-autocomplete-dropdown-fixed .hero-autocomplete-item:hover,
.hero-autocomplete-dropdown-fixed .hero-autocomplete-item.selected {
  background: rgba(124, 176, 131, 0.18) !important;
  background-color: rgba(124, 176, 131, 0.18) !important;
  transform: translateX(2px);
}

.hero-autocomplete-dropdown-fixed .hero-autocomplete-item i {
  color: var(--color-restes) !important;
  font-size: 1rem !important;
  width: 22px !important;
  text-align: center !important;
  flex-shrink: 0;
}

.hero-autocomplete-dropdown-fixed .hero-autocomplete-item span {
  flex: 1 !important;
  font-size: 0.95rem !important;
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 500 !important;
  text-align: left !important;
  line-height: 1.3;
}

.hero-autocomplete-dropdown-fixed .hero-autocomplete-item span strong {
  color: var(--color-restes) !important;
  font-weight: 700 !important;
}

html:not(.dark-mode) .hero-autocomplete-dropdown-fixed .hero-autocomplete-item span {
  color: #333 !important;
}

html:not(.dark-mode) .hero-autocomplete-dropdown-fixed .hero-autocomplete-item:hover,
html:not(.dark-mode) .hero-autocomplete-dropdown-fixed .hero-autocomplete-item.selected {
  background: rgba(124, 176, 131, 0.14) !important;
  background-color: rgba(124, 176, 131, 0.14) !important;
}

/* Scrollbar plus fine et discrète */
.hero-autocomplete-dropdown-fixed::-webkit-scrollbar {
  width: 6px !important;
}

.hero-autocomplete-dropdown-fixed::-webkit-scrollbar-track {
  background: transparent !important;
}

.hero-autocomplete-dropdown-fixed::-webkit-scrollbar-thumb {
  background: rgba(124, 176, 131, 0.4) !important;
  border-radius: 3px !important;
}

.hero-autocomplete-dropdown-fixed::-webkit-scrollbar-thumb:hover {
  background: var(--color-restes) !important;
}

html:not(.dark-mode) .hero-autocomplete-dropdown-fixed .hero-autocomplete-item {
  border-bottom-color: #eee !important;
}

html:not(.dark-mode) .hero-autocomplete-dropdown-fixed .hero-autocomplete-item span {
  color: #333 !important;
}

html:not(.dark-mode) .hero-autocomplete-dropdown-fixed .hero-autocomplete-item:hover,
html:not(.dark-mode) .hero-autocomplete-dropdown-fixed .hero-autocomplete-item.selected {
  background: rgba(124, 176, 131, 0.15) !important;
}

/* ==========================================================================
   9b. Modale "Cuisiner les restes" — sélection d'ingrédients par chip
   Couleurs vertes (color-restes) au lieu du corail des filtres recettes
   ========================================================================== */

/* Pills sélectionnées : vertes au lieu de corail */
#heroFilterModal-restes .filter-pill:has(input:checked) {
  background: var(--color-restes) !important;
  color: white !important;
  border-color: var(--color-restes) !important;
  box-shadow: 0 4px 14px rgba(124, 176, 131, 0.3) !important;
}

/* Footer mode restes : un seul bouton "Réinitialiser", aligné à gauche */
.hero-filter-modal-footer-restes {
  justify-content: flex-start !important;
}

/* ==========================================================================
   9b2. Chips de suggestions d'ingrédients populaires (mode restes)
   Même grille 3×2 et même style que les badges de filtres du mode Rechercher,
   mais avec la couleur verte du mode restes.
   ========================================================================== */

/* Zone cachée par défaut, affichée en mode restes */
#heroSearchBox .hero-restes-suggestions {
  display: none !important;
  margin-top: 32px !important;
}

#heroSearchBox[data-mode="restes"] .hero-restes-suggestions {
  display: block !important;
  animation: heroV2FadeIn 0.25s ease;
}

/* Grille identique aux filtres */
#heroSearchBox .hero-restes-suggestions-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 18px !important;
  max-width: 560px !important;
  margin: 0 auto !important;
}

/* Chip de suggestion — même base que hero-filter-badge */
#heroSearchBox .hero-restes-suggestion {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 11px 16px !important;
  background: var(--hero-badge-bg) !important;
  border: 1px solid var(--hero-badge-border) !important;
  border-radius: 25px !important;
  color: var(--hero-badge-text) !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  box-shadow: none !important;
}

#heroSearchBox .hero-restes-suggestion > i {
  color: var(--hero-badge-icon) !important;
  font-size: 0.95rem !important;
  transition: color 0.2s ease;
}

#heroSearchBox .hero-restes-suggestion:hover {
  background: var(--hero-badge-bg-hover) !important;
  border-color: var(--color-restes) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

#heroSearchBox .hero-restes-suggestion:hover > i {
  color: var(--color-restes) !important;
}

html:not(.dark-mode) #heroSearchBox .hero-restes-suggestion:hover {
  border-color: var(--color-restes) !important;
  color: #111 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* État actif — ingrédient sélectionné (vert plein) */
#heroSearchBox .hero-restes-suggestion.active {
  background: var(--color-restes) !important;
  border-color: var(--color-restes) !important;
  color: #fff !important;
}

#heroSearchBox .hero-restes-suggestion.active > i {
  color: #fff !important;
}

html:not(.dark-mode) #heroSearchBox .hero-restes-suggestion.active {
  color: #fff !important;
}

/* Compteur en pastille (même système que les badges de filtres) */
#heroSearchBox .hero-restes-suggestion {
  position: relative;
}

#heroSearchBox .hero-restes-suggestion .filter-count {
  display: none;
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;
  background: var(--color-restes) !important;
  color: white !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  line-height: 22px !important;
  text-align: center !important;
  margin: 0 !important;
  border: 2px solid var(--hero-box-bg-solid, #2a3540) !important;
  box-shadow: 0 2px 6px rgba(124, 176, 131, 0.35) !important;
  pointer-events: none;
}

#heroSearchBox .hero-restes-suggestion.has-filters .filter-count {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Badge actif (a des ingrédients sélectionnés) */
#heroSearchBox .hero-restes-suggestion.has-filters {
  border-color: var(--color-restes) !important;
  background: rgba(124, 176, 131, 0.12) !important;
}

#heroSearchBox .hero-restes-suggestion.has-filters > i {
  color: var(--color-restes) !important;
}

/* Modale restes — pills sélectionnées en vert */
#heroFilterModal-restes-category .filter-pill:has(input:checked) {
  background: var(--color-restes) !important;
  color: white !important;
  border-color: var(--color-restes) !important;
  box-shadow: 0 4px 14px rgba(124, 176, 131, 0.3) !important;
}

/* ==========================================================================
   9c. Tags inline dans la barre de recherche (mode restes, style select2)
   ========================================================================== */

/* L'input wrapper passe en flex-wrap en mode restes pour accueillir les tags */
#heroSearchBox[data-mode="restes"] .hero-search-input-wrapper {
  flex-wrap: wrap !important;
  align-items: center !important;
  min-height: 64px !important;
  padding: 8px 8px 8px 12px !important;
  gap: 6px !important;
}

/* Conteneur des tags inline */
#heroSearchBox .hero-restes-tags-inline {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

#heroSearchBox[data-mode="restes"] .hero-restes-tags-inline {
  display: flex;
}

/* Tag individuel (style select2 / pill) */
#heroSearchBox .hero-restes-tag-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--color-restes);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  animation: heroTagAdd 0.2s ease-out;
  transition: background 0.15s ease;
}

#heroSearchBox .hero-restes-tag-inline:hover {
  background: var(--color-restes-hover);
}

html:not(.dark-mode) #heroSearchBox .hero-restes-tag-inline {
  background: var(--color-restes);
  color: #fff;
}

.hero-restes-tag-inline-text {
  line-height: 1.2;
}

/* Bouton supprimer un tag */
#heroSearchBox .hero-restes-tag-inline .hero-restes-tag-remove {
  background: rgba(255, 255, 255, 0.2) !important;
  border: none !important;
  color: #fff !important;
  cursor: pointer;
  padding: 0 !important;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: background 0.15s ease;
}

#heroSearchBox .hero-restes-tag-inline .hero-restes-tag-remove:hover {
  background: rgba(255, 255, 255, 0.4) !important;
}

/* Bouton "tout effacer" (x) à droite de la barre */
#heroSearchBox .hero-restes-clear-all {
  background: none !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.5) !important;
  cursor: pointer;
  padding: 4px !important;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

#heroSearchBox .hero-restes-clear-all:hover {
  color: rgba(255, 255, 255, 0.9) !important;
}

html:not(.dark-mode) #heroSearchBox .hero-restes-clear-all {
  color: rgba(0, 0, 0, 0.35) !important;
}

html:not(.dark-mode) #heroSearchBox .hero-restes-clear-all:hover {
  color: rgba(0, 0, 0, 0.7) !important;
}

/* L'input rétrécit pour laisser la place aux tags */
#heroSearchBox[data-mode="restes"] .hero-search-input {
  flex: 1 1 120px !important;
  min-width: 120px !important;
}

/* Animation d'ajout de tag */
@keyframes heroTagAdd {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* En mode restes sans chips, la search box n'a plus besoin de min-height élevée */
#heroSearchBox[data-mode="restes"] {
  min-height: auto !important;
}

/* ==========================================================================
   10. Responsive
   ========================================================================== */

/* ---------- Header compact sur la homepage v2 ---------------------
   Sur la plage 481-1024px, critical-header.css force le header à 120/130px
   pour accueillir la barre de recherche centrée. Or sur la homepage,
   cette barre est masquée (hideHeaderSearch=true) — on compacte le header
   pour éviter un vide visuel gigantesque. */
@media (min-width: 481px) and (max-width: 1024px) {
  body.page-home-v2 .main-header {
    height: 80px !important;
    padding-top: 0 !important;
    align-items: center !important;
  }

  body.page-home-v2 .header-container {
    height: 80px !important;
    flex-wrap: nowrap !important;
    align-content: center !important;
    align-items: center !important;
  }

  body.page-home-v2 .header-left,
  body.page-home-v2 .user-actions {
    height: auto !important;
    margin-top: 0 !important;
  }
}


/* Tablette : ≤ 1024px */
@media (max-width: 1024px) {
  .hero {
    padding: 50px 20px 55px !important;
    min-height: 580px;
  }

  .hero #heroTitle,
  .hero .hero-title,
  .hero h1 {
    font-size: 2.2rem !important;
  }

  .hero #heroSubtitle,
  .hero .hero-subtitle,
  .hero p:first-of-type {
    font-size: 1.05rem !important;
  }

  #heroSearchBox {
    max-width: 640px !important;
    padding: 8px 26px 32px !important;
  }
}

/* Mobile large : ≤ 768px */
@media (max-width: 768px) {
  .hero {
    padding: 40px 18px 50px !important;
    min-height: auto !important;
  }

  .hero #heroTitle,
  .hero .hero-title,
  .hero h1 {
    font-size: 2rem !important;
    line-height: 1.1 !important;
  }

  .hero #heroSubtitle,
  .hero .hero-subtitle,
  .hero p:first-of-type {
    font-size: 1rem !important;
    margin-bottom: 26px !important;
  }

  #heroSearchBox {
    padding: 6px 22px 24px !important;
    border-radius: 20px !important;
    max-width: calc(100% - 20px) !important;
    min-height: auto !important;
  }

  #heroSearchBox .hero-filters-container {
    min-height: 120px !important;
    margin-top: 24px !important;
  }

  /* Suggestions restes : 2 colonnes sur tablette */
  #heroSearchBox .hero-restes-suggestions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  #heroSearchBox .hero-restes-suggestions {
    margin-top: 24px !important;
  }

  #heroSearchBox .hero-mode-tabs {
    margin-bottom: 22px !important;
  }

  #heroSearchBox .hero-mode-tab {
    font-size: 0.92rem !important;
    padding: 12px 0 !important;
  }

  #heroSearchBox .hero-search-input-wrapper {
    padding: 5px 5px 5px 6px !important;
  }

  #heroSearchBox .hero-search-input {
    font-size: 0.95rem !important;
    padding: 10px 10px !important;
    min-width: 0 !important;
  }

  #heroSearchBox .hero-search-btn {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
  }

  #heroSearchBox .hero-search-btn svg {
    width: 18px;
    height: 18px;
  }

  #heroSearchBox .hero-filter-badge {
    padding: 9px 10px !important;
    font-size: 0.8rem !important;
    gap: 6px !important;
  }

  #heroSearchBox .hero-filter-badge > i {
    font-size: 0.85rem !important;
  }

  /* Tags inline mode restes */
  #heroSearchBox .hero-restes-tag-inline {
    padding: 5px 8px !important;
    font-size: 0.82rem !important;
  }

  #heroSearchBox[data-mode="restes"] .hero-search-input-wrapper {
    min-height: 54px !important;
    gap: 5px !important;
  }
}

/* Mobile : ≤ 480px */
@media (max-width: 480px) {
  .hero {
    padding: 32px 15px 45px !important;
    min-height: auto !important;
  }

  .hero #heroTitle,
  .hero .hero-title,
  .hero h1 {
    font-size: 1.7rem !important;
  }

  .hero #heroSubtitle,
  .hero .hero-subtitle,
  .hero p:first-of-type {
    font-size: 0.95rem !important;
    margin-bottom: 22px !important;
  }

  #heroSearchBox {
    padding: 4px 14px 20px !important;
    border-radius: 18px !important;
    min-height: auto !important;
  }

  #heroSearchBox .hero-filters-container {
    min-height: 110px !important;
    margin-top: 20px !important;
  }

  #heroSearchBox .hero-mode-tabs {
    margin-bottom: 18px !important;
  }

  #heroSearchBox .hero-mode-tab {
    font-size: 0.85rem !important;
    padding: 11px 0 !important;
  }

  #heroSearchBox .hero-search-input-wrapper {
    padding: 4px 4px 4px 6px !important;
  }

  #heroSearchBox .hero-search-input {
    font-size: 0.9rem !important;
    padding: 9px 8px !important;
    min-width: 0 !important;
  }

  #heroSearchBox .hero-search-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }

  #heroSearchBox .hero-search-btn svg {
    width: 16px;
    height: 16px;
  }

  #heroSearchBox .hero-filters {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  #heroSearchBox .hero-filter-badge {
    padding: 12px 8px !important;
    font-size: 0.8rem !important;
    gap: 6px !important;
  }

  #heroSearchBox .hero-filter-badge > i {
    font-size: 0.8rem !important;
  }

  #heroSearchBox .hero-filter-badge .filter-count {
    width: 20px !important;
    min-width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    font-size: 0.7rem !important;
    top: -7px !important;
    right: -7px !important;
  }

  /* Tags inline mode restes */
  #heroSearchBox .hero-restes-tag-inline {
    padding: 4px 7px !important;
    font-size: 0.78rem !important;
    gap: 4px !important;
  }

  #heroSearchBox .hero-restes-tag-inline .hero-restes-tag-remove {
    width: 16px;
    height: 16px;
    min-width: 16px;
    font-size: 0.6rem;
  }

  #heroSearchBox[data-mode="restes"] .hero-search-input {
    flex: 1 1 100px !important;
    min-width: 100px !important;
  }

  /* Modales */
  .hero-filter-modal {
    padding: 12px;
  }

  .hero-filter-modal-panel {
    max-height: 90vh;
    border-radius: 16px;
  }

  .hero-filter-modal-header {
    padding: 14px 18px;
  }

  .hero-filter-modal-body {
    padding: 16px 18px;
  }

  .hero-filter-modal-footer {
    padding: 12px 18px;
  }

  .hero-filter-modal .filter-pill {
    padding: 9px 14px;
    font-size: 0.85rem;
  }
}

/* Petit mobile : ≤ 320px */
@media (max-width: 320px) {
  .hero {
    padding: 28px 12px 40px !important;
  }

  .hero #heroTitle,
  .hero .hero-title,
  .hero h1 {
    font-size: 1.5rem !important;
  }

  #heroSearchBox {
    padding: 2px 12px 20px !important;
  }

  #heroSearchBox .hero-filters {
    grid-template-columns: repeat(2, 1fr) !important;
  }

}
