/* ------------------------------------------------------------------
   HÄNDLERSUCHE (CSS) — Produktion Ready (Altura 4 Tarjetas)
   ------------------------------------------------------------------ */

/* ------------- VARIABLES ------------- */
:root {
  --primary:        #06305f; /* Marburg-Blau */
  --primary-light:  #0c4e9a;
  --bg-light:       #f5f7fa;
  --border:         #d9e0e8;
  --radius:         12px;
  --shadow:         0 4px 12px rgba(0, 0, 0, 0.05);
  --font-main:      'Montserrat', sans-serif;
}

/* ------------- RESET ------------- */
.haendlersuche-wrapper,
.haendlersuche-wrapper * {
  box-sizing: border-box;
  font-family: var(--font-main);
}

/* ------------- WRAPPER ------------- */
.haendlersuche-wrapper {
  max-width: 95%;
  margin: 0 auto 3rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}

/* ------------- FORM ------------- */
.haendlersuche-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: end;
  margin-bottom: 2rem;
}

.haendlersuche-form fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: none;
  padding: 0;
  margin: 0;
}

.haendlersuche-form label {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
}

.haendlersuche-form input,
.haendlersuche-form select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--bg-light);
  transition: all 0.3s ease;
}

.haendlersuche-form input:focus,
.haendlersuche-form select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(12, 78, 154, 0.15);
}

/* ------------ BOTÓN CON SHIMMER ------------ */
.haendlersuche-form button {
  padding: 0.7rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.haendlersuche-form button:hover,
.haendlersuche-form button:focus-visible {
  background: var(--primary-light) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(12, 78, 154, 0.3);
  color: #fff;
}

.haendlersuche-form button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
  transform: skewX(-25deg);
}

.haendlersuche-form button:hover::before,
.haendlersuche-form button:focus-visible::before {
  animation: shimmer 0.8s forwards;
}

@keyframes shimmer {
  to { left: 130%; }
}

.haendlersuche-form button:active {
  transform: translateY(0);
  box-shadow: none;
  outline: none;
}

.haendlersuche-form button:disabled {
  background: var(--primary) !important;
  color: #fff;
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ------------- OUTPUT GRID ------------- */
.haendlersuche-output {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 992px) {
  .haendlersuche-output {
    grid-template-columns: 350px 1fr;
  }
}

/* ------------- RESULT LIST ------------- */
.result-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 580px; /* Bloqueado para mostrar ~4 tarjetas */
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-light) transparent;
}

.result-list::-webkit-scrollbar { width: 6px; }
.result-list::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }

/* ------------- RESULT CARDS (ANIMADAS) ------------- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card {
  position: relative;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 0; 
  animation: fadeSlideUp 0.5s ease forwards;
}

.result-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--primary-light);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.result-card.active {
  background: var(--bg-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
  transform: translateY(-2px);
}

.result-card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; color: var(--primary); }
.result-card p { margin: 0.2rem 0; font-size: 0.9rem; color: #444; }

/* ------------- MAP (STICKY & FIXED HEIGHT) ------------- */
.haendlersuche-map {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 400px; /* Móviles */
}

@media (min-width: 992px) {
  .haendlersuche-map {
    position: sticky;
    top: 130px; 
    height: 580px; /* Bloqueado al mismo tamaño que la lista para simetría perfecta */
  }
}

/* ------------- UTILS & LOADER ------------- */
.text-center { text-align: center; }
.d-none { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.loader {
  display: inline-block;
  width: 22px; height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { 
  to { transform: rotate(360deg); } 
}