/* ==========================================================================
   BUSCADOR - Estilos reutilizables
   ========================================================================== */

.fv-search-widget {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: clamp(20px, 3vw, 28px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
  width: 100%;
  position: relative;
}

.fv-search-widget h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: #1b5e20;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fv-search-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.fv-search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.fv-search-field label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #112417;
  letter-spacing: 0.5px;
}

.fv-search-field input,
.fv-search-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid rgba(46, 125, 50, 0.2);
  border-radius: 8px;
  background: #fff;
  color: #112417;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-sizing: border-box;
}

.fv-search-field input:focus,
.fv-search-field select:focus {
  border-color: #512da8;
  box-shadow: 0 0 0 4px rgba(81, 45, 168, 0.1);
}

.fv-search-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.fv-search-btn {
  flex: 1;
  min-width: 180px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #2e7d32 0%, #512da8 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.fv-search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(81, 45, 168, 0.35);
}

.fv-search-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.fv-search-btn-secondary {
  background: #fff;
  color: #512da8;
  border: 2px solid #512da8;
  box-shadow: none;
}

.fv-search-btn-secondary:hover {
  background: #512da8;
  color: #fff;
}

/* Resultados en tiempo real (dropdown) */
.fv-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(46, 125, 50, 0.2);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.fv-search-results.active {
  display: block;
}

.fv-search-results-header {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(46, 125, 50, 0.15);
  font-size: 0.85rem;
  color: #4b6353;
  font-weight: 600;
  background: #f9fdfb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.fv-search-result-item {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(46, 125, 50, 0.1);
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
}

.fv-search-result-item:hover {
  background: #f2f7f3;
}

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

.fv-search-result-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e3efe5;
}

.fv-search-result-info {
  flex: 1;
  min-width: 0;
}

.fv-search-result-info h4 {
  font-size: 0.92rem;
  margin: 0 0 4px 0;
  color: #112417;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fv-search-result-info p {
  font-size: 0.78rem;
  color: #4b6353;
  margin: 0;
}

.fv-search-empty {
  padding: 30px 20px;
  text-align: center;
  color: #4b6353;
  font-size: 0.9rem;
}

.fv-search-loading {
  padding: 20px;
  text-align: center;
  color: #4b6353;
  font-size: 0.85rem;
}

/* Grid de resultados (para buscador.html) */
.fv-results-header {
  text-align: center;
  padding: 40px 24px 20px;
}

.fv-results-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: #1b5e20;
  margin-bottom: 10px;
}

.fv-results-header p {
  color: #4b6353;
  font-size: 1.05rem;
}

.fv-results-count {
  display: inline-block;
  background: #f1ecfa;
  color: #4a148c;
  padding: 6px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 12px;
}

/* Responsive */
@media (max-width: 1024px) {
  .fv-search-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .fv-search-grid {
    grid-template-columns: 1fr;
  }
  .fv-search-actions {
    flex-direction: column;
  }
  .fv-search-btn {
    width: 100%;
  }
  .fv-search-results {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
  }
}