/* ============================================================
   BUSCADOR INTERNO - Servicios en Zaragoza
   ============================================================ */

.search-wrapper {
  position: relative;
  max-width: 520px;
  margin: 0 auto 2.5rem;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 50px;
  padding: 0.5rem 1.2rem;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(27, 73, 101, 0.12);
}

.search-bar svg {
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.97rem;
  color: var(--gray-800);
  font-family: inherit;
}

#search-input::placeholder {
  color: var(--gray-400);
}

#search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  max-height: 340px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1.2rem;
  text-decoration: none;
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
}

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

.search-result-item:hover {
  background: rgba(27, 73, 101, 0.05);
}

.search-result-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-blue);
  background: rgba(27, 73, 101, 0.08);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-result-title {
  font-size: 0.92rem;
  font-weight: 500;
}

.search-no-results {
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  color: var(--gray-500);
  text-align: center;
}

/* Buscador en el hero */
.hero-search {
  margin-top: 2rem;
}

.hero-search .search-bar {
  background: rgba(255,255,255,0.95);
  border-color: transparent;
}

.hero-search #search-results {
  text-align: left;
}

/* Responsive buscador */
@media (max-width: 640px) {
  .search-wrapper {
    max-width: 100%;
    margin: 0 0 1.5rem;
  }

  .search-bar {
    padding: 0.5rem 1rem;
  }

  #search-input {
    font-size: 0.9rem;
  }

  #search-results {
    max-height: 260px;
  }

  .search-result-item {
    padding: 0.65rem 1rem;
  }
}
