/* ==========================================================================
   ListingHive Pro V33 — Système de style global pour les champs
   dynamiques de la barre de recherche
   ==========================================================================

   PROBLÈME CORRIGÉ (rappel) :
   La barre de recherche du thème (".hp-form--listing-search" /
   ".hp-form--vendor-search") est transparente ("effet verre"). L'extension
   HivePress Geolocation ajoute automatiquement un champ "Localisation" à
   cette barre (comportement HivePress standard). Ce champ gardait une
   bande blanche derrière lui et cassait l'uniformité transparente de la
   barre. Le bouton "Rechercher", lui, ne doit JAMAIS être touché : il
   garde son propre dégradé animé aux couleurs du site (voir style.css >
   "PRO V4 — Bouton Rechercher"), sa forme et son animation, à l'identique
   de la V28 d'origine.

   HISTORIQUE DES CORRECTIFS SUR CE FICHIER (pour mémoire) :
   - V29/V30 : ciblage large de "[data-component]" dans la barre de
     recherche → corrigeait bien la bande blanche du champ Localisation,
     MAIS attrapait aussi le bouton "Rechercher" (qui porte lui aussi un
     attribut "data-component", posé par HivePress pour gérer son état de
     chargement au clic) → régression : le bouton perdait son dégradé.
   - V31 : tentative de correction en restreignant tous les sélecteurs à
     l'intérieur de ".hp-form__field-wrap", en supposant que ce conteneur
     enveloppe chaque champ mais jamais le bouton → a bien protégé le
     bouton, MAIS s'est avéré ne pas envelopper non plus le champ
     Localisation sur ce site : la bande blanche est réapparue.
   - V32 (ce fichier) : on revient au ciblage large de la V30 (qui
     corrigeait bien la bande blanche), et on protège le bouton
     autrement : par SON IDENTITÉ PROPRE plutôt que par sa position dans
     le DOM. Le bouton est exclu de chaque sélecteur via QUATRE signaux
     indépendants et redondants — ":not(.hp-form__button)"
     ":not(button)" ":not([type='submit'])" ":not([type='button'])" — de
     sorte qu'il soit protégé quelle que soit la façon exacte dont
     HivePress le construit dans le HTML, sans dépendre d'une hypothèse
     sur la structure des conteneurs.
   - V33 : ajout de la section "4. Couleur et taille du texte des champs"
     (texte blanc, légèrement plus petit) — voir plus bas. N'affecte que
     le texte ; les corrections de fond/bordure ci-dessus restent
     inchangées.

   Sélecteurs volontairement génériques pour les CHAMPS (aucun nom
   d'extension codé en dur) : "hp-field", "[class*='hp-field--']" et
   "[data-component]" sont les conteneurs que HivePress utilise pour
   N'IMPORTE QUEL champ, qu'il vienne du cœur HivePress ou d'une
   extension (Geolocation aujourd'hui, une autre extension demain).

   Aucun fichier de HivePress, du thème parent ListingHive, ni d'aucune
   extension n'est modifié : ce fichier est strictement additif.
   ========================================================================== */

/* Fragment d'exclusion du bouton "Rechercher", réutilisé sur chaque
   sélecteur ci-dessous. Quatre signaux indépendants : si HivePress
   change demain l'un d'entre eux (ex. renomme la classe du bouton), les
   trois autres continuent de le protéger. */

/* ------------------------------------------------------------------------
   1. Transparence forcée, à TOUS les niveaux, avec spécificité renforcée
   ------------------------------------------------------------------------
   "body.lhp-pro-v33" (classe posée par ce thème sur <body>, voir
   functions.php > add_filter( 'body_class', ... )) est ajouté devant
   chaque sélecteur pour garantir que ces règles l'emportent sur toute
   règle du thème parent, du cœur HivePress ou d'une extension — quel que
   soit l'ordre de chargement des fichiers CSS.
   ------------------------------------------------------------------------ */

/* 1a. Le formulaire lui-même (déjà transparent par défaut, on le rappelle
   ici pour que la transparence soit garantie même si un plugin de
   traduction/optimisation réordonne les styles). Ne touche jamais au
   bouton : "background-color" ne s'applique qu'à l'élément "<form>"
   lui-même, jamais à ses descendants. */
body.lhp-pro-v33 .hp-form--listing-search,
body.lhp-pro-v33 .hp-form--vendor-search {
	background-color: rgba(255, 255, 255, 0.08) !important;
}

/* 1b. Conteneurs de champ (natifs ET ajoutés par une extension) : fond,
   bordure et ombre neutralisés — SAUF le bouton "Rechercher", exclu par
   son identité propre (classe, balise, type), pas par sa position dans
   le DOM. On ne touche jamais aux dimensions (padding, margin, display,
   flex), qui restent gérées par le champ lui-même, pour ne jamais casser
   sa mise en page interne (ex. icône "Me localiser" du champ
   Localisation). */
body.lhp-pro-v33 .hp-form--listing-search .hp-field:not(.hp-form__button):not(button):not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--listing-search [class*="hp-field--"]:not(.hp-form__button):not(button):not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--listing-search [data-component]:not(.hp-form__button):not(button):not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--vendor-search .hp-field:not(.hp-form__button):not(button):not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--vendor-search [class*="hp-field--"]:not(.hp-form__button):not(button):not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--vendor-search [data-component]:not(.hp-form__button):not(button):not([type="submit"]):not([type="button"]) {
	background-color: transparent !important;
	background-image: none !important;
	border-color: transparent !important;
	box-shadow: none !important;
	border-radius: 0 !important;
}

/* 1c. Le "<input>"/"<select>"/"<textarea>" réel : transparence forcée
   directement, sans dépendre de l'héritage depuis le conteneur ci-dessus.
   Le bouton n'est de toute façon jamais un "<input>"/"<select>"/
   "<textarea>", mais l'exclusion des types "submit"/"button" est
   conservée en défense en profondeur, au cas où il serait rendu en
   "<input type='submit'>" sur une autre installation. */
body.lhp-pro-v33 .hp-form--listing-search input:not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--listing-search select,
body.lhp-pro-v33 .hp-form--listing-search textarea,
body.lhp-pro-v33 .hp-form--vendor-search input:not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--vendor-search select,
body.lhp-pro-v33 .hp-form--vendor-search textarea {
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
}

/* Le bouton "Rechercher" (".hp-form__button") N'EST JAMAIS ciblé par ce
   fichier — il est explicitement exclu de chaque règle ci-dessus. Son
   dégradé animé, sa vibration périodique et sa forme restent entièrement
   définis par style.css, sections "PRO V4 — Bouton Rechercher" et
   "V21 — dégradé animé", strictement identiques à la V28 d'origine. */

/* ------------------------------------------------------------------------
   2. Icône/bouton interne du champ Localisation ("Me localiser")
   ------------------------------------------------------------------------
   Ces éléments sont des "<a>" : ils ne peuvent de toute façon jamais
   correspondre à "<button>" (tag différent), mais l'exclusion par classe
   est conservée en cohérence avec le reste du fichier. */
body.lhp-pro-v33 .hp-form--listing-search .hp-field a:not(.hp-form__button),
body.lhp-pro-v33 .hp-form--listing-search [class*="hp-field--"] a:not(.hp-form__button),
body.lhp-pro-v33 .hp-form--vendor-search .hp-field a:not(.hp-form__button),
body.lhp-pro-v33 .hp-form--vendor-search [class*="hp-field--"] a:not(.hp-form__button) {
	background: transparent !important;
	color: var(--surface-ink-faint, rgba(15, 23, 39, 0.45)) !important;
	transition: color 0.2s var(--smooth-ease, ease);
}

body.lhp-pro-v33 .hp-form--listing-search .hp-field a:not(.hp-form__button):hover,
body.lhp-pro-v33 .hp-form--listing-search [class*="hp-field--"] a:not(.hp-form__button):hover,
body.lhp-pro-v33 .hp-form--vendor-search .hp-field a:not(.hp-form__button):hover,
body.lhp-pro-v33 .hp-form--vendor-search [class*="hp-field--"] a:not(.hp-form__button):hover {
	color: var(--color-primary, #3b45c4) !important;
}

/* Contour de focus accessible : certaines extensions (dont HivePress
   Geolocation) retirent le contour par défaut du navigateur sur ce
   bouton interne. On restitue un contour cohérent avec le thème sans
   modifier le fichier de l'extension. */
body.lhp-pro-v33 .hp-form--listing-search .hp-field a:not(.hp-form__button):focus-visible,
body.lhp-pro-v33 .hp-form--listing-search [class*="hp-field--"] a:not(.hp-form__button):focus-visible,
body.lhp-pro-v33 .hp-form--vendor-search .hp-field a:not(.hp-form__button):focus-visible,
body.lhp-pro-v33 .hp-form--vendor-search [class*="hp-field--"] a:not(.hp-form__button):focus-visible {
	outline: 2px solid var(--color-primary, #3b45c4) !important;
	outline-offset: 2px;
	border-radius: 4px;
}

/* ------------------------------------------------------------------------
   3. Contexte "barre flottante blanche" (bannière de catégorie)
   ------------------------------------------------------------------------
   Dans ce contexte précis, la barre entière est volontairement blanche
   (voir style.css > "V15 — HERO DE CATÉGORIE", classe
   ".lhpv10-search-in-cover"). Les règles 1b/1c ci-dessus rendraient les
   champs transparents "dans le vide" : on réaffiche donc ici le même
   fond blanc que le reste de la barre dans ce contexte uniquement, pour
   que le champ Localisation se fonde dans la barre blanche exactement
   comme le champ mot-clé natif. Le bouton "Rechercher", déjà stylé par
   style.css (section "V15 — HERO DE CATÉGORIE"), reste exclu par les
   mêmes quatre signaux d'identité. */
body.lhp-pro-v33 .lhpv10-search-in-cover.hp-form--listing-search,
body.lhp-pro-v33 .lhpv10-search-in-cover .hp-form--listing-search {
	background-color: #fff !important;
}

body.lhp-pro-v33 .lhpv10-search-in-cover .hp-field:not(.hp-form__button):not(button):not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .lhpv10-search-in-cover [class*="hp-field--"]:not(.hp-form__button):not(button):not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .lhpv10-search-in-cover [data-component]:not(.hp-form__button):not(button):not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .lhpv10-search-in-cover input:not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .lhpv10-search-in-cover select,
body.lhp-pro-v33 .lhpv10-search-in-cover textarea {
	background-color: transparent !important;
}

/* ------------------------------------------------------------------------
   4. Couleur et taille du texte des champs (V33), devenue DÉPENDANTE DE
   LA PAGE en V34 (section 5 ci-dessous)
   ------------------------------------------------------------------------
   Taille inchangée depuis la V33 (légèrement réduite). La COULEUR, elle,
   n'est plus fixe : voir section 5 plus bas, qui la fait dépendre de la
   page affichée (blanc sur l'accueil, sombre ailleurs). Rien à modifier
   ici pour la taille.
   ------------------------------------------------------------------------ */

/* 4a. Taille du texte réellement saisi/sélectionné — inchangée, s'applique
   sur toutes les pages. La couleur est définie séparément en section 5. */
body.lhp-pro-v33 .hp-form--listing-search input:not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--listing-search select,
body.lhp-pro-v33 .hp-form--listing-search textarea,
body.lhp-pro-v33 .hp-form--vendor-search input:not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--vendor-search select,
body.lhp-pro-v33 .hp-form--vendor-search textarea {
	font-size: 0.9375rem !important;
}

/* 4c. Liste déroulante native ouverte (menu "select") : le système
   d'exploitation impose son propre fond (blanc/gris selon l'OS), non
   personnalisable en CSS de façon fiable sur tous les navigateurs. Le
   texte des options y reste donc sombre pour rester lisible sur ce fond
   système, quelle que soit la page — seul le champ fermé (au repos, dans
   la barre) suit la couleur dépendante de la page (section 5 ci-dessous).
   Inchangé depuis la V33. */
body.lhp-pro-v33 .hp-form--listing-search select option,
body.lhp-pro-v33 .hp-form--vendor-search select option {
	color: #1a1d29;
}

/* ------------------------------------------------------------------------
   5. Couleur du texte, du placeholder et des icônes SELON LA PAGE (V34)
   ------------------------------------------------------------------------
   Demande V34 : même barre, même design, seule la COULEUR change
   automatiquement selon la page affichée :
   - Page d'accueil (classe "body.lhpv34-search-on-home", posée par
     functions.php via is_front_page()) : texte, placeholder et icônes en
     BLANC (#fff), pour ressortir sur la bannière de la page d'accueil.
   - Toutes les autres pages (annonces, annonceurs, catégories, résultats
     de recherche...) : texte, placeholder et icônes en SOMBRE
     (var(--surface-ink), le même ton "encre" déjà utilisé ailleurs dans
     ce thème), pour rester lisibles sur un fond clair.
   Ce bloc ne concerne QUE la couleur : aucune structure, taille ou
   comportement n'est modifié (voir section 4 ci-dessus pour la taille,
   inchangée). Le bouton "Rechercher" n'est toujours jamais concerné : ce
   n'est de toute façon jamais un "<input>"/"<select>"/"<textarea>", donc
   hors de portée des sélecteurs ci-dessous.
   ------------------------------------------------------------------------ */

/* 5a. Réglage par défaut, valable sur TOUTES les pages : sombre. Placé
   avant le cas "page d'accueil" ci-dessous, qui le surcharge uniquement
   à cet endroit précis grâce à une classe body plus spécifique. */
body.lhp-pro-v33 .hp-form--listing-search input:not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--listing-search select,
body.lhp-pro-v33 .hp-form--listing-search textarea,
body.lhp-pro-v33 .hp-form--vendor-search input:not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .hp-form--vendor-search select,
body.lhp-pro-v33 .hp-form--vendor-search textarea {
	color: var(--surface-ink, #1a1d29) !important;
}

body.lhp-pro-v33 .hp-form--listing-search input::placeholder,
body.lhp-pro-v33 .hp-form--vendor-search input::placeholder {
	color: var(--surface-ink-faint, rgba(15, 23, 39, 0.45)) !important;
	opacity: 1 !important;
}

/* Icônes (loupe injectée par le thème, icône "Me localiser" du champ
   Localisation, ou toute icône <i>/<svg> qu'une extension ajouterait dans
   un champ de cette barre) : sombres par défaut, cohérentes avec le texte
   ci-dessus. */
body.lhp-pro-v33 .hp-form--listing-search .hp-field i,
body.lhp-pro-v33 .hp-form--listing-search .hp-field svg,
body.lhp-pro-v33 .hp-form--listing-search [class*="hp-field--"] i,
body.lhp-pro-v33 .hp-form--listing-search [class*="hp-field--"] svg,
body.lhp-pro-v33 .hp-form--listing-search [data-component] i,
body.lhp-pro-v33 .hp-form--listing-search [data-component] svg,
body.lhp-pro-v33 .hp-form--vendor-search .hp-field i,
body.lhp-pro-v33 .hp-form--vendor-search .hp-field svg,
body.lhp-pro-v33 .hp-form--vendor-search [class*="hp-field--"] i,
body.lhp-pro-v33 .hp-form--vendor-search [class*="hp-field--"] svg,
body.lhp-pro-v33 .hp-form--vendor-search [data-component] i,
body.lhp-pro-v33 .hp-form--vendor-search [data-component] svg,
body.lhp-pro-v33 .hp-form--listing-search .hp-form__field-wrap::before,
body.lhp-pro-v33 .hp-form--vendor-search .hp-form__field-wrap::before {
	color: var(--surface-ink-faint, rgba(15, 23, 39, 0.45)) !important;
	fill: currentColor !important;
}

/* 5b. Page d'accueil uniquement (classe posée par functions.php) :
   surcharge tout ce qui précède en blanc — texte, placeholder, icônes.
   Sélecteur plus spécifique (".lhpv34-search-on-home" en plus de
   ".lhp-pro-v33") donc prioritaire sans avoir besoin d'un "!important"
   supplémentaire ; les "!important" déjà présents ci-dessus sont
   neutralisés par les "!important" équivalents ci-dessous, à spécificité
   égale mais déclarés après dans le fichier. */
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search input:not([type="submit"]):not([type="button"]),
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search select,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search textarea,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search input:not([type="submit"]):not([type="button"]),
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search select,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search textarea {
	color: #ffffff !important;
}

body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search input::placeholder,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search input::placeholder {
	color: rgba(255, 255, 255, 0.75) !important;
	opacity: 1 !important;
}

body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search .hp-field i,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search .hp-field svg,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search [class*="hp-field--"] i,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search [class*="hp-field--"] svg,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search [data-component] i,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search [data-component] svg,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search .hp-field i,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search .hp-field svg,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search [class*="hp-field--"] i,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search [class*="hp-field--"] svg,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search [data-component] i,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search [data-component] svg,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search .hp-form__field-wrap::before,
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search .hp-form__field-wrap::before {
	color: #ffffff !important;
	fill: currentColor !important;
}

/* 5c. Icône "Me localiser" (lien <a> du champ Localisation, déjà stylée
   par couleur en section 2 ci-dessus) : suit désormais aussi la règle
   "selon la page" plutôt qu'une couleur fixe. Surcharge la section 2 sur
   la page d'accueil uniquement. */
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search .hp-field a:not(.hp-form__button),
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--listing-search [class*="hp-field--"] a:not(.hp-form__button),
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search .hp-field a:not(.hp-form__button),
body.lhpv34-search-on-home.lhp-pro-v33 .hp-form--vendor-search [class*="hp-field--"] a:not(.hp-form__button) {
	color: rgba(255, 255, 255, 0.85) !important;
}

/* 5d. Exception : contexte "barre flottante blanche" (bannière de
   catégorie, section 3 plus haut). Cette barre reste volontairement
   blanche même si elle apparaissait un jour sur la page d'accueil : du
   texte blanc y serait invisible. Priorité maximale (3 classes) pour
   toujours l'emporter, y compris sur la règle 5b ci-dessus. */
body.lhpv34-search-on-home.lhp-pro-v33 .lhpv10-search-in-cover input:not([type="submit"]):not([type="button"]),
body.lhpv34-search-on-home.lhp-pro-v33 .lhpv10-search-in-cover select,
body.lhpv34-search-on-home.lhp-pro-v33 .lhpv10-search-in-cover textarea,
body.lhp-pro-v33 .lhpv10-search-in-cover input:not([type="submit"]):not([type="button"]),
body.lhp-pro-v33 .lhpv10-search-in-cover select,
body.lhp-pro-v33 .lhpv10-search-in-cover textarea {
	color: #1a1d29 !important;
}

body.lhpv34-search-on-home.lhp-pro-v33 .lhpv10-search-in-cover input::placeholder,
body.lhp-pro-v33 .lhpv10-search-in-cover input::placeholder {
	color: rgba(15, 23, 39, 0.45) !important;
}
