/**
 * Recherche plein écran sur téléphone.
 *
 * La loupe vit dans la rangée d'icônes de l'en-tête, le panneau est rendu dans
 * le pied de page (lib/recherche-mobile.php).
 */

/* ===== La loupe de l'en-tête =====
   Elle n'a de sens que là où la barre de recherche est masquée, c'est-à-dire
   en dessous de 992 px. Au-delà, la barre est dans l'en-tête et une loupe de
   plus ne ferait que dire deux fois la même chose. */
.pdc-rm-ouvrir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

@media screen and (min-width: 992px) {
  .pdc-rm-ouvrir,
  .pdc-rm {
    display: none !important;
  }
}

/* ===== Le panneau ===== */
.pdc-rm {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: none;
  padding: 12px 16px 16px;
  background: #fff;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pdc-rm.is-ouvert {
  display: block;
}

body.pdc-rm-ouvert {
  overflow: hidden;
}

.pdc-rm__barre {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Le conteneur de l'extension de recherche s'impose en width:100% : on le
   laisse prendre la place restante sans pousser la croix hors de l'écran. */
.pdc-rm__barre .aws-container {
  flex: 1 1 auto;
  min-width: 0;
}

.pdc-rm__barre .aws-search-form {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  border: 1.5px solid #e62ca1 !important;
  border-radius: 999px !important;
  background: #fff !important;
  overflow: hidden;
}

.pdc-rm__barre .aws-wrapper {
  flex: 1 1 auto;
  min-width: 0;
}

.pdc-rm__barre .aws-search-field {
  width: 100% !important;
  border: 0 !important;
  background: transparent !important;
  /* 16 px minimum : en dessous, iOS zoome sur le champ à la saisie. */
  font-size: 1rem !important;
  padding: 11px 14px !important;
}

.pdc-rm__barre .aws-search-btn,
.pdc-rm__barre .aws-form-btn {
  flex: 0 0 auto !important;
  width: 44px !important;
  background: transparent !important;
  border: 0 !important;
  cursor: pointer;
}

.pdc-rm__fermer {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: #2c463a;
  cursor: pointer;
}

.pdc-rm__fermer svg {
  width: 22px;
  height: 22px;
}

.pdc-rm__aide {
  margin: 12px 2px 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #4a6257;
}

/* Les suggestions de l'extension doivent couvrir la page, pas se retrouver
   coincées dans la barre. */
.pdc-rm .aws-search-result {
  position: static !important;
  width: 100% !important;
  margin-top: 10px;
  border-radius: 12px;
  box-shadow: none !important;
}
