/* ==========================================================================
   search.css - Styles dédiés au système de recherche globale Sanarois
   ========================================================================== */

/* Conteneur de la liste déroulante des résultats */
.search-dropdown-menu,
.navbar-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(0, 0, 0, 0.06);
  max-height: 380px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  z-index: 1100;
  padding: 6px 0;
  box-sizing: border-box;
}

.search-dropdown-menu.show,
.navbar-search-dropdown.show {
  display: flex;
  animation: searchDropdownFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ligne d'un plat dans la liste */
.search-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f7fafc;
  text-align: left;
}

.search-item-row:last-child {
  border-bottom: none;
}

.search-item-row:hover {
  background-color: #fff9f0;
}

/* Vignette du plat */
.search-item-img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #edf2f7;
}

/* Informations du plat */
.search-item-info {
  flex: 1;
  min-width: 0;
}

.search-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.search-item-name {
  font-weight: 700;
  font-size: 14px;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-price {
  font-weight: 700;
  font-size: 13px;
  color: #961D00;
  white-space: nowrap;
}

.search-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-item-resto {
  font-size: 11px;
  color: #718096;
  display: flex;
  align-items: center;
  gap: 3px;
}

.search-item-category {
  font-size: 11px;
  background: #edf2f7;
  color: #4a5568;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}

/* Surlignage du terme recherché */
.search-highlight,
mark.search-highlight {
  background-color: #ffebb3;
  color: #8f4d05;
  padding: 0 3px;
  border-radius: 3px;
  font-weight: inherit;
}

/* États de chargement et liste vide */
.search-dropdown-loading,
.search-dropdown-empty {
  padding: 22px 16px;
  text-align: center;
  color: #718096;
  font-size: 13px;
}

.search-dropdown-loading i {
  margin-right: 6px;
  animation: searchSpin 1s infinite linear;
  display: inline-block;
  font-size: 16px;
  vertical-align: middle;
}

@keyframes searchSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Badges de correspondance de recherche */
.search-item-match-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.search-item-match-tag.match-nom {
  background: #e6fffa;
  color: #234e52;
  border: 1px solid #b2f5ea;
}

.search-item-match-tag.match-keyword {
  background: #fefcbf;
  color: #744210;
  border: 1px solid #faf089;
}

.search-item-match-tag.match-category {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
}

