/* ==========================================================================
   BUSCADOR INTERACTIVO DE AUTOBUSES DE ELCHE (/autobuses-elche · CLS = 0)
   ========================================================================== */
.bf-hero {
  background: linear-gradient(135deg, #07192f 0%, #0b4f4a 55%, #0d9488 100%);
  color: #ffffff;
  border-radius: 22px;
  padding: 1.65rem 1.75rem;
  margin: 1.1rem 0 1.35rem;
  box-shadow: 0 18px 40px -14px rgba(13, 148, 136, 0.35);
}

.bf-hero h1 {
  margin: 0.25rem 0 0.45rem !important;
  font-size: clamp(1.55rem, 3vw, 2.2rem) !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  letter-spacing: -0.02em;
}

.bf-hero p {
  margin: 0 !important;
  color: #ccfbf1 !important;
  font-size: 0.96rem;
  max-width: 760px;
}

.bf-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.bf-kpi-pill {
  padding: 0.24rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.76rem;
  font-weight: 800;
  color: #f0fdfa;
}

.bf-alert {
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  margin-bottom: 1.15rem;
  font-size: 0.9rem;
  font-weight: 750;
  border-left: 5px solid #d97706;
  background: #fffbeb;
  color: #92400e;
}

/* CAJA DEL PLANIFICADOR ORIGEN -> DESTINO */
.bf-planner-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 12px 30px -12px rgba(9, 17, 31, 0.1);
  margin-bottom: 1.25rem;
}

.bf-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: end;
}

.bf-field {
  position: relative;
  min-width: 0;
}

.bf-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.77rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #334155;
  margin-bottom: 0.35rem;
}

.bf-gps-btn {
  border: 0;
  background: #ecfdf5;
  color: #0b6e66;
  font-size: 0.72rem;
  font-weight: 850;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid #99f6e4;
}
.bf-gps-btn:hover { background: #ccfbf1; }

.bf-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  font-size: 0.93rem;
  font-weight: 650;
  color: #09111f;
  background: #f8fafc;
}
.bf-input:focus {
  outline: none;
  border-color: #0d9488;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.bf-suggest-box {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 95;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 13px;
  box-shadow: 0 16px 34px -8px rgba(9, 17, 31, 0.2);
  max-height: 270px;
  overflow-y: auto;
  display: none;
}
.bf-suggest-box.is-open { display: block; }

.bf-sug-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  padding: 0.58rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #0f172a;
}
.bf-sug-item:hover { background: #f0fdfa; }
.bf-sug-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  flex-shrink: 0;
}

.bf-swap-btn {
  width: 42px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bf-swap-btn:hover { border-color: #0d9488; color: #0b6e66; background: #f0fdfa; }

.bf-search-btn {
  height: 45px;
  padding: 0 1.3rem;
  border-radius: 12px;
  border: 1px solid #0b6e66;
  background: linear-gradient(180deg, #0d9488 0%, #0b6e66 100%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}
.bf-search-btn:hover { filter: brightness(1.06); }

/* DESTINOS RAPIDOS EN 1 CLIC */
.bf-quick-chips {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #e2e8f0;
}
.bf-quick-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 0.45rem;
  display: block;
}
.bf-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.bf-chip {
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  color: #1e293b;
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  font-size: 0.77rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
}
.bf-chip:hover, .bf-chip.is-selected {
  background: #0d9488;
  border-color: #0b6e66;
  color: #ffffff;
}

/* LAYOUT DE RESULTADOS + MAPA INTERACTIVO */
.bf-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.95fr);
  gap: 1.15rem;
  align-items: start;
  margin-bottom: 2rem;
}

.bf-results-col {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.bf-route-option {
  background: #ffffff;
  border: 1.5px solid #dbe3ee;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.bf-route-option:hover,
.bf-route-option.is-active {
  border-color: #0d9488;
  box-shadow: 0 12px 26px -10px rgba(13, 148, 136, 0.22);
}

.bf-opt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.bf-line-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 0.24rem 0.62rem;
  border-radius: 9px;
  color: #ffffff !important;
  font-weight: 900;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.bf-stops-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
}
.bf-stops-badge.is-transfer {
  background: #eff6ff;
  color: #1e40af;
}

.bf-step-list {
  margin: 0;
  padding: 0 0 0 0.85rem;
  border-left: 3px solid #cbd5e1;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-size: 0.85rem;
  color: #334155;
}

.bf-map-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  padding: 0.75rem;
  position: sticky;
  top: 86px;
}
#bf-leaflet-map {
  width: 100%;
  height: 410px;
  border-radius: 13px;
  background: #e2e8f0;
}

/* DIRECTORIO DE TODAS LAS LINEAS */
.bf-lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}

.bf-line-card {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.bf-line-card:hover {
  border-color: #0d9488;
  transform: translateY(-2px);
}

/* BANNER COMPACTO EN ARTICULOS HISTORICOS DE LINEAS DE AUTOBUS */
.esm-bus-article-cta {
  background: linear-gradient(90deg, #f0fdfa 0%, #f8fafc 100%);
  border: 1px solid #99f6e4;
  border-left: 5px solid #0d9488;
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .bf-form-grid {
    grid-template-columns: 1fr;
  }
  .bf-swap-btn {
    width: 100%;
    height: 36px;
  }
  .bf-workspace {
    grid-template-columns: 1fr;
  }
  .bf-map-card {
    position: static;
  }
  #bf-leaflet-map {
    height: 310px;
  }
  .bf-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .bf-chip { white-space: nowrap; }
}

/* === FICHA COMPLETA INTERACTIVA AL CLICAR CUALQUIER LINEA DE AUTOBUS === */
.bf-line-card.is-selected {
  border-color: #0d9488 !important;
  background: #f0fdfa !important;
  box-shadow: 0 8px 22px -8px rgba(13, 148, 136, 0.28) !important;
}

.bf-line-detail-box {
  background: #ffffff;
  border: 1.5px solid #0d9488;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 32px -12px rgba(13, 148, 136, 0.22);
}

.bf-ld-head {
  padding: 1rem 1.15rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bf-ld-meta {
  padding: 0.75rem 1.15rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.81rem;
  color: #334155;
  align-items: center;
  justify-content: space-between;
}

.bf-variant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem 0.2rem;
}

.bf-var-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 9px;
  padding: 0.36rem 0.72rem;
  font-size: 0.77rem;
  font-weight: 800;
  cursor: pointer;
}
.bf-var-btn.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.bf-stops-filter-wrap {
  padding: 0.55rem 1.15rem;
}

.bf-stops-timeline {
  max-height: 330px;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem 1.15rem 1rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  scrollbar-width: thin;
}

.bf-stop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.6rem;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  font-size: 0.82rem;
}
.bf-stop-row:hover {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.bf-stop-seq {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bf-stop-act {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  border-radius: 6px;
  padding: 0.16rem 0.44rem;
  font-size: 0.69rem;
  font-weight: 800;
  cursor: pointer;
}
.bf-stop-act:hover {
  border-color: #0d9488;
  color: #0b6e66;
}
