/*    ALLO NATUREL — MODULE DE RECHERCHE
   Barre, suggestions de besoins et produits correspondants
   ===================================================== */

/* =====================================================
   RECHERCHE LIVE — ALLO NATUREL
   ===================================================== */

.an-header__search {
  position: relative;
  z-index: 1500;
}

.an-live-search {
  position: relative;
  width: 100%;
}


/* BARRE */

.an-live-search__form {
  width: 100%;

  min-height: 58px;

  display: flex;
  align-items: center;

  position: relative;

  padding:
    4px
    6px
    4px
    24px;

  background: #fff;

  border: 1px solid #ded8ce;
  border-radius: 999px;

  transition:
    border-color .15s ease,
    box-shadow .15s ease;
}

.an-live-search__form:focus-within {
  border-color: #b9c9c5;

  box-shadow:
    0 0 0 3px rgba(13, 76, 70, .05);
}


/* INPUT */

.an-live-search__input {
  width: 100%;

  min-width: 0;
  height: 48px;

  padding: 0 86px 0 0 !important;

  background: transparent !important;

  border: 0 !important;
  outline: 0 !important;

  box-shadow: none !important;

  font-family: "Geist", sans-serif;

  font-size: 15px;

  color: #0d4c46;
}

.an-live-search__input::placeholder {
  color: #758d88;
  opacity: 1;
}


/* CROIX */

.an-live-search__clear {
  position: absolute;

  right: 68px;
  top: 50%;

  transform: translateY(-50%);

  width: 32px;
  height: 32px;

  padding: 0;

  background: transparent;

  border: 0;

  color: #52716c;

  font-size: 26px;
  line-height: 1;

  cursor: pointer;
}

.an-live-search__clear[hidden] {
  display: none !important;
}


/* BOUTON RECHERCHE */

.an-live-search__submit {
  position: absolute;

  right: 6px;
  top: 50%;

  transform: translateY(-50%);

  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  background: #07574f;

  border: 0;
  border-radius: 50%;

  color: #fff;

  cursor: pointer;
}

.an-live-search__submit:hover {
  background: #063f3b;
}

.an-live-search__submit .material-icons {
  font-size: 23px;
}


/* =====================================================
   PANNEAU DE RÉSULTATS
   ===================================================== */

.an-live-search__results {
  position: absolute;

  top: calc(100% + 10px);
  left: 0;

  z-index: 9999;

  width: 100%;

  max-height: 620px;

  overflow-y: auto;

  padding: 24px;

  background: #fff;

  border: 1px solid #ded8ce;
  border-radius: 18px;

  box-shadow:
    0 20px 45px rgba(13, 76, 70, .14);
}

.an-live-search__results[hidden] {
  display: none !important;
}


/* GROUPE */

.an-search-group + .an-search-group {
  margin-top: 26px;
}

.an-search-group__title {
  margin-bottom: 10px;

  font-family: "Geist", sans-serif;

  font-size: 11px;
  font-weight: 500;

  letter-spacing: .13em;

  color: #7b9691;
}


/* RÉSULTAT */

.an-search-result {
  display: flex;
  flex-direction: column;

  gap: 3px;

  padding: 9px 0;

  color: #0d4c46 !important;

  text-decoration: none !important;
}

.an-search-result:hover .an-search-result__name {
  color: #ff9b43;
}

.an-search-result__name {
  font-family: "Geist", sans-serif;

  font-size: 15px;
  font-weight: 500;

  line-height: 1.3;

  color: #0d4c46;

  transition: color .15s ease;
}

.an-search-result__meta {
  font-family: "Geist", sans-serif;

  font-size: 12px;
  font-weight: 400;

  color: #7b9691;
}


/* CHARGEMENT / VIDE */

.an-search-loading,
.an-search-empty {
  padding: 12px 0;

  font-family: "Geist", sans-serif;

  font-size: 14px;

  color: #7b9691;
}


/* VOIR TOUT */

.an-search-all {
  margin-top: 20px;

  padding-top: 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-top: 1px solid #eee9e1;

  color: #0d4c46 !important;

  font-family: "Geist", sans-serif;

  font-size: 13px;
  font-weight: 600;

  text-decoration: none !important;
}


/* Masque l'ancien autocomplete natif */
.searchbar-autocomplete,
.ui-autocomplete.searchbar-autocomplete {
  display: none !important;
}


/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 767px) {

  .an-live-search__results {
    position: fixed;

    top: 90px;
    left: 12px;
    right: 12px;

    width: auto;

    max-height:
      calc(100vh - 110px);
  }

}

/* =====================================================
   RECHERCHE LIVE — PRODUITS CORRESPONDANTS
   ===================================================== */

.an-live-search .an-search-products__list {
  display: grid;
  gap: 0;
}

.an-live-search .an-search-product {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #eee9e1;
}

.an-live-search .an-search-product:last-child {
  border-bottom: 0;
}

.an-live-search .an-search-product__image {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 9px;
  background: #f7f4ee;
}

.an-live-search .an-search-product__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.an-live-search .an-search-product__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.an-live-search .an-search-product__content .an-search-result__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.an-live-search .an-search-product__price {
  padding-left: 10px;
  font-family: "Bagrile", "Instrument Serif", Georgia, serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  color: #07574f;
  white-space: nowrap;
}

.an-live-search .an-search-product:hover .an-search-result__name {
  color: #ff9b43;
}

@media (max-width: 767px) {
  .an-live-search .an-search-product {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 10px;
  }

  .an-live-search .an-search-product__image {
    width: 50px;
    height: 50px;
  }

  .an-live-search .an-search-product__price {
    grid-column: 2;
    padding-left: 0;
    font-size: 15px;
  }
}

/* =====================================================
   BESOINS CORRESPONDANTS
   ===================================================== */
.an-live-search .an-search-needs__list {
  display: grid;
  gap: 0;
}

.an-live-search .an-search-need {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #eee9e1;
}

.an-live-search .an-search-need:last-child {
  border-bottom: 0;
}

.an-live-search .an-search-need__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.an-live-search .an-search-need__icon {
  flex: 0 0 auto;
  color: #9aaca8;
  font-size: 18px;
  transition: transform .15s ease, color .15s ease;
}

.an-live-search .an-search-need:hover .an-search-result__name,
.an-live-search .an-search-need:hover .an-search-need__icon {
  color: #ff9b43;
}

.an-live-search .an-search-need:hover .an-search-need__icon {
  transform: translateX(2px);
}

.an-live-search .an-search-product__image--empty::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 1px solid #d8e1de;
  border-radius: 50%;
}

.an-live-search .an-search-all:hover {
  color: #ff9b43 !important;
}

.an-live-search__results::-webkit-scrollbar {
  width: 8px;
}

.an-live-search__results::-webkit-scrollbar-thumb {
  background: #d8e1de;
  border-radius: 999px;
}

@media (max-width: 767px) {
  .an-live-search__results {
    padding: 18px;
  }

  .an-search-group + .an-search-group {
    margin-top: 20px;
  }

  .an-live-search .an-search-need {
    padding: 9px 0;
  }
}

/* Supprime le cadre orange au focus */
.an-live-search__form:focus-within {
  border-color: #ded8ce !important;
  box-shadow: none !important;
  outline: none !important;
}

.an-live-search__input:focus,
.an-live-search__input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* =====================================================
   SUPPRESSION TOTALE DU FOCUS ORANGE
   ===================================================== */

html body .an-header__search,
html body .an-live-search,
html body .an-live-search__form,
html body .an-live-search__input {
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}

html body .an-header__search:focus,
html body .an-header__search:focus-within,
html body .an-live-search:focus,
html body .an-live-search:focus-within,
html body .an-live-search__form:focus,
html body .an-live-search__form:focus-within,
html body .an-live-search__input:focus,
html body .an-live-search__input:focus-visible,
html body .an-live-search__input:active {
  outline: 0 !important;
  outline-color: transparent !important;
  box-shadow: none !important;
}

html body .an-live-search__form,
html body .an-live-search__form:focus-within {
  border: 1px solid #ded8ce !important;
  border-color: #ded8ce !important;
}

html body .an-live-search__input,
html body .an-live-search__input:focus,
html body .an-live-search__input:focus-visible,
html body .an-live-search__input:active {
  border: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
}
