/* ------------------------------------------------------------------
   HÄNDLERSUCHE (CSS) — Stand 08 Jun 2025
   Este Stylesheet pertenece a WP Coder y controla el aspecto del
   componente de búsqueda de distribuidores. Todos los nombres de clase están prefijados
   para evitar conflictos con temas/plugins de terceros.
   ------------------------------------------------------------------ */

/* ------------- VARIABLES ------------- */
:root {
  --primary:        #06305f; /* Marburg-Blau */
  --primary-light:  #0c4e9a;
  --bg-light:       #f5f7fa;
  --border:         #d9e0e8;
  --radius:         8px;
  --shadow:         0 2px 8px rgba(0, 0, 0, 0.07);
  --font-main:      'Montserrat', sans-serif;
}

/* ------------- RESET ------------- */
.haendlersuche-wrapper,
.haendlersuche-wrapper * {
  box-sizing: border-box;
  font-family: var(--font-main);
}

/* ------------- WRAPPER ------------- */
.haendlersuche-wrapper {
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* ------------- FORM ------------- */
.haendlersuche-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  margin-bottom: 2rem;
}

.haendlersuche-form fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  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.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--bg-light);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.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.25);
}

.haendlersuche-form button {
  padding: 0.7rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s, transform 0.15s;
}

.haendlersuche-form button:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* ------------- OUTPUT GRID ------------- */
.haendlersuche-output {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .haendlersuche-output {
    grid-template-columns: 1fr 1fr; /* Ergebnisliste | Karte */
  }
}

/* ------------- RESULT LIST ------------- */
.result-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.5rem; /* Platz für Scrollbar */
  scrollbar-gutter: stable;
}

/* Scrollbar (WebKit) */
.result-list::-webkit-scrollbar {
  width: 6px;
}
.result-list::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

/* Scrollbar (Firefox) */
.result-list {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

/* Einzelkarte */
.result-card {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}
.result-card.active {
  border-color: var(--primary-light);
  background: var(--bg-light);
  box-shadow: 0 0 0 3px rgba(12, 78, 154, 0.2);
}
.result-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: var(--primary);
}
.result-card p {
  margin: 0.15rem 0;
  font-size: 0.9rem;
}
.result-card a {
  color: var(--primary-light);
  text-decoration: underline;
  font-size: 0.9rem;
}

/* ------------- MAP ------------- */
.haendlersuche-map {
  width: 100%;
  min-height: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 1024px) {
  .haendlersuche-map {
    min-height: 500px;
  }
}

/* ------------- UTILS ------------- */
.text-center { text-align: center; }
.d-none       { display: none !important; }

/* ------------- ACCESSIBILITY ------------- */
@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)}}

/* ------------ BOTÓN CON SHIMMER ------------ */
.haendlersuche-form button{
  position:relative;          /* necesario para el ::before */
  overflow:hidden;            /* oculta el brillo mientras cruza */
}

/* Brillo diagonal que cruza el botón */
.haendlersuche-form button::before{
  content:'';
  position:absolute;
  top:0;
  left:-120%;                 /* empieza fuera de vista */
  width:60%;
  height:100%;
  background:linear-gradient(
            120deg,
            transparent 0%,
            rgba(255,255,255,0.45) 50%,
            transparent 100%);
  transform:skewX(-25deg);    /* ligera inclinación */
}

/* Animación al hacer hover/focus */
.haendlersuche-form button:hover::before,
.haendlersuche-form button:focus-visible::before{
  animation:shimmer 0.8s forwards;
}

/* Fondo hover (azul claro) y sin sombras rosas de Elementor */
.haendlersuche-form button:hover,
.haendlersuche-form button:focus-visible{
  background:var(--primary-light) !important;
  color:#fff;
  box-shadow:none;            /* por si Elementor mete sombras */
}

/* Keyframes: desliza el brillo de izquierda a derecha */
@keyframes shimmer{
  to{ left:130%; }
}

/* ------------ DESACTIVA ROSA ELEMENTOR DESPUÉS DEL CLIC ------------ */
.haendlersuche-form button:active,
.haendlersuche-form button:focus,
.haendlersuche-form button:focus-visible{
  background:var(--primary-light) !important;   /* mismo azul hover */
  color:#fff;
  box-shadow:none;                              /* quita resplandor rosa */
  outline:none;
}

/* Estado deshabilitado (mientras carga) */
.haendlersuche-form button:disabled{
  background:var(--primary) !important;
  color:#fff;
  opacity:0.6;             /* leve atenuación para indicar “off” */
  cursor:not-allowed;
  box-shadow:none;
}