/* Buscador en tiempo real: lo comparten el catálogo (catalogo.html) y la página de
   cajitas (coleccion.html). */
/* ======================================================
   BUSCADOR EN TIEMPO REAL — ESTILOS PREMIUM
   ====================================================== */

.search-bar-wrapper {
  position: relative;
  max-width: 680px;
  margin: 0 auto 1.8rem auto;
  z-index: 50;
}

.search-input-container {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1.5px solid rgba(197, 168, 128, 0.25);
  border-radius: 50px;
  padding: 0 18px;
  height: 54px;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(31, 26, 23, 0.06);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-input-container:focus-within {
  border-color: #E5989B;
  box-shadow: 0 4px 24px rgba(229, 152, 155, 0.18);
}

.search-icon-svg {
  width: 20px;
  height: 20px;
  color: #C5A880;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.search-input-container:focus-within .search-icon-svg {
  color: #E5989B;
}

.search-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 0.95rem !important;
  color: #1F1A17 !important;
  font-weight: 500;
  min-width: 0;
  padding: 0 !important;
}

.search-input::placeholder {
  color: #B0A8A0;
  font-weight: 400;
}

.search-clear-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(229, 152, 155, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #D68285;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.search-clear-btn:hover {
  background: rgba(229, 152, 155, 0.25);
  transform: rotate(90deg);
}

/* Dropdown de sugerencias */
.search-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid rgba(197, 168, 128, 0.18);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(31, 26, 23, 0.10);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-height: 380px;
  overflow-y: auto;
}

.search-suggestions-dropdown.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(197, 168, 128, 0.07);
}

a.search-suggestion-item {
  text-decoration: none;
  color: inherit;
}

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

.search-suggestion-item:hover,
.search-suggestion-item.hovered {
  background: rgba(250, 243, 238, 0.9);
}

.suggestion-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  object-position: bottom;
  flex-shrink: 0;
  background: #F0EAE4;
}

.suggestion-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.suggestion-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1F1A17;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-price {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #E5989B;
}

.suggestion-arrow {
  color: #C5A880;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Highlight de búsqueda */
mark.search-highlight {
  background: rgba(229, 152, 155, 0.22);
  color: #C05E61;
  border-radius: 3px;
  padding: 0 2px;
  font-style: normal;
}

/* Sin resultados */
.search-no-results {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.88rem;
  color: #9E9590;
  font-weight: 500;
}

.search-no-results svg {
  color: #C5A880;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .search-input-container { height: 48px; padding: 0 14px; gap: 9px; }
  .search-input { font-size: 0.88rem !important; }
  .search-bar-wrapper { margin-bottom: 1.2rem; }
}
