/* ===========================================
   1. TIPOGRAFÍA Y VARIABLES
   =========================================== */

/* Fuente Corporativa: Crillee */
@font-face {
  font-family: "Crillee";
  src: url("/static/fonts/CrilleeItalicBT.ttf") format("truetype");
  font-style: italic;
  font-weight: normal;
}

/* Fuente Base: Roboto */
@font-face {
  font-family: "Roboto";
  src: url("/static/fonts/Roboto-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --primary: #005AA7;         /* Azul Corporativo */
  --primary-dark: #003c75;    /* Azul Oscuro para hovers */
  --primary-light: #e6f0fa;   /* Azul muy pálido para fondos suaves */
  --text-dark: #1e293b;       /* Gris oscuro para textos */
  --text-gray: #64748b;       /* Gris medio para iconos/labels */
  --bg-page: #f3f7fc;         /* Fondo general */
  
  /* Sombras Premium (Sin bordes negros) */
  --shadow-float: 0 20px 40px -5px rgba(0, 45, 114, 0.15);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 25px rgba(0, 45, 114, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Roboto", sans-serif !important;
  background: var(--bg-page);
  color: var(--text-dark);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ===========================================
   2. HERO SECTION (ENCABEZADO)
   =========================================== */

.search-hero {
  width: 100%;
  height: 190px; /* Reducido a la mitad */
  background: url("/static/img/buses-bg.png") center/cover no-repeat;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 20px 40px 20px; /* Padding inferior ajustado */
}

/* Overlay azul elegante */
.search-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
      180deg,
      rgba(0, 45, 114, 0.85) 0%,
      rgba(0, 45, 114, 0.40) 100%
  );
  z-index: 1;
}

.search-hero h1, 
.search-hero p, 
.hero-underline {
  position: relative;
  z-index: 2;
}

/* Título */
.search-hero h1 {
  font-family: "Crillee", sans-serif;
  font-size: 56px;
  color: #fff;
  margin: 0;
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Subrayado */
.hero-underline {
  width: 80px;
  height: 4px;
  background: #fff; /* Blanco para contrastar con el fondo azul */
  border-radius: 4px;
  margin: 15px auto;
  opacity: 0.8;
}

.search-hero p {
  font-family: "Roboto", sans-serif;
  font-size: 18px;
  color: #e9eef7;
  font-weight: 400;
  margin-top: 5px;
}

/* ===========================================
   3. BARRA DE BÚSQUEDA FLOTANTE (MODERNA)
   =========================================== */

.search-section {
  position: relative;
  z-index: 10;
  padding: 0 20px;
  margin-top: -30px; /* Efecto flotante sobre el hero */
  margin-bottom: 40px;
}

.search-container {
  max-width: 1100px;
  margin: 0 auto;
}

/* Contenedor principal estilo "Píldora" */
.search-box-modern {
  background: #fff;
  border-radius: 100px; /* Bordes completamente redondos */
  padding: 8px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-float);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Grupos de inputs (Origen, Destino, Fecha) */
.search-field-group {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: 50px;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

/* Efecto hover suave en los campos */
.search-field-group:hover {
  background-color: var(--primary-light); /* Azul muy suave */
}

/* Efecto cuando se escribe */
.search-field-group:focus-within {
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(0, 90, 167, 0.15); /* Anillo azul suave */
}

/* Iconos dentro de los inputs */
.icon-box {
  font-size: 20px;
  color: var(--text-gray);
  margin-right: 15px;
  display: flex;
  align-items: center;
}

.search-field-group:focus-within .icon-box {
  color: var(--primary); /* El icono se pone azul al enfocar */
}

/* Inputs y Labels */
.input-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.input-content label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary); /* Label en azul corporativo */
  margin-bottom: 2px;
  letter-spacing: 0.5px;
  font-family: "Roboto";
}

.input-content input {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 16px;
  color: var(--text-dark);
  font-weight: 500;
  width: 100%;
  outline: none;
  font-family: "Roboto";
}

.input-content input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

/* Línea divisora entre campos */
.divider-vertical {
  width: 1px;
  height: 32px;
  background-color: #e2e8f0;
}

/* Botón Buscar Redondo */
.btn-search-modern {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 36px;
  font-size: 17px;
  font-weight: 700;
  font-family: "Roboto";
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 90, 167, 0.4);
}

.btn-search-modern:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 90, 167, 0.5);
}

/* ===========================================
   4. CINTA DE BENEFICIOS
   =========================================== */
.benefits-strip {
  display: flex;
  justify-content: center;
  gap: 50px;
  padding: 20px;
  margin-top: 20px;
}

.benefits-strip span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 500;
  background: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.benefits-strip i {
  color: var(--primary);
  font-size: 18px;
}

/* ===========================================
   5. AUTOCOMPLETE (LISTA DESPLEGABLE)
   =========================================== */
.autocomplete {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 130%; /* Un poco separado del input */
  left: -20px; /* Alineado al contenedor padre */
  width: 300px;
  
  max-height: 250px;
  overflow-y: auto;
  
  background: #fff;
  border-radius: 12px;
  padding: 8px 0;
  
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border: 1px solid #f1f5f9;
  z-index: 100;
}

.autocomplete-list li {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-dark);
  border-bottom: 1px solid #f8fafc;
  transition: background 0.1s;
}

.autocomplete-list li:last-child {
  border-bottom: none;
}

.autocomplete-list li:hover {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

/* Estados de visibilidad del autocomplete */
.autocomplete-list:not(.active) {
  display: none !important;
}
.autocomplete-list.active {
  display: block !important;
}

/* ===========================================
   6. RESULTADOS (LAYOUT Y FILTROS)
   =========================================== */
.results-section {
  max-width: 1100px;
  margin: 0 auto 60px auto;
  padding: 0 20px;
}

.results-header-container {
  margin-bottom: 25px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 15px;
}

.results-title {
  font-family: "Roboto";
  font-size: 24px;
  color: var(--text-dark);
  margin: 0;
}

.results-layout {
  display: grid;
  grid-template-columns: 260px 1fr; /* Sidebar fija, contenido flexible */
  gap: 30px;
}

.result-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Sidebar de Filtros */
.filters-panel {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  height: fit-content;
  box-shadow: var(--shadow-card);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.filters-header h3 {
  font-size: 16px;
  margin: 0;
  color: var(--text-dark);
}

.filters-clear {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.filter-group {
  margin-bottom: 25px;
  border-top: 1px solid #f1f5f9;
  padding-top: 15px;
}

.filter-group:first-of-type {
  border-top: none;
}

.filter-group h4 {
  font-size: 14px;
  margin: 0 0 12px 0;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-dark);
  cursor: pointer;
}

.filter-option input[type="checkbox"] {
  accent-color: var(--primary); /* Checkbox azul */
  width: 16px;
  height: 16px;
}

/* ===========================================
   7. TARJETAS DE RESULTADOS (TICKETS)
   =========================================== */

.result-card.pro {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  margin-bottom: 25px;
  border: 1px solid #f1f5f9;
}

.result-card.pro:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

/* Header de la tarjeta (logo + nombre empresa) */
.card-header-band {
  background: var(--primary); /* Azul sólido */
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.card-header-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.card-header-name {
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.4px;
  font-family: "Crillee", "CrilleeBT", sans-serif;
  font-style: italic;
}

/* Cuerpo de la tarjeta */
.card-body {
  padding: 24px;
  position: relative;
}

/* Ruta y Precio */
.r-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 15px;
}

.r-title {
  font-size: 20px;
  color: var(--text-dark);
  margin: 0;
  font-weight: 700;
}

/* Precio en verde estándar (NO AMARILLO) */
.r-price-chip {
  color: var(--primary); /* Azul corporativo */
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 22px;
  font-weight: 800;
}

/* Horarios */
.r-times-box {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.r-time {
  text-align: center;
}

.r-time-label {
  display: block;
  font-size: 12px;
  color: var(--text-gray);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.r-time-val {
  font-size: 26px;
  color: var(--text-dark);
  font-weight: 700;
}

/* Duración en el centro (compacta) */
.r-dur {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.r-dur-text {
  font-size: 13px;
  color: var(--text-gray);
}

/* Información del Bus */
.r-capacity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-dark);
}

.r-capacity-main,
.r-capacity-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.r-capacity-main i {
  color: var(--primary);
  font-size: 16px;
}

.r-capacity-label {
  font-weight: 700;
  text-transform: uppercase;
}

.r-capacity-item strong {
  color: var(--primary);
}

.r-service-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #e9f3ff;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
}

.r-service-chip i {
  color: var(--primary);
  font-size: 18px;
}

.r-service-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.r-service-text small {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-gray);
  font-weight: 700;
}

.r-service-text strong {
  font-size: 13px;
  color: var(--primary);
}

/* Botón de acción */
.r-cta {
  margin-top: 10px;
}

.btn-view-seats {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: "Roboto";
}

.btn-view-seats:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(0, 45, 114, 0.2);
}

/* Botón Política (Texto pequeño) */
.policy-chip {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
  font-weight: 600;
}
.policy-chip i {
  font-size: 16px;
}
.policy-chip:hover {
  color: var(--primary);
  text-decoration: underline;
}

.r-route-block {
  text-align: center;
  padding: 4px 0 12px;
}

/* ===========================================
   8. RESPONSIVE (CELULAR)
   =========================================== */

@media (max-width: 900px) {
  .search-hero {
    height: 150px;
    padding: 16px 16px 28px 16px;
  }
  
  .search-hero h1 {
    font-size: 38px;
  }
  
  .search-box-modern {
    flex-direction: column;
    border-radius: 24px;
    padding: 16px;
    gap: 12px;
  }
  
  .divider-vertical {
    display: none;
  }

  .search-field-group {
    width: 100%;
    background: #f8fafc; /* Fondo gris claro en móvil para distinguir campos */
    border: 1px solid #e2e8f0;
    border-radius: 12px;
  }
  
  .btn-search-modern {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    margin-top: 8px;
  }

  .results-layout {
    grid-template-columns: 1fr;
  }

  /* El panel de filtros se puede ocultar o mostrar arriba, 
     aquí lo dejamos fluido */
  .filters-panel {
    margin-bottom: 20px;
  }
  
  .benefits-strip {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  
  .benefits-strip span {
    width: 100%;
    justify-content: center;
  }
}

/* ===========================================
   9. LOADER Y UTILIDADES
   =========================================== */

.global-loader {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  z-index: 9999;
  padding: 20px;
  text-align: center;
}

.global-loader.hidden {
  display: none;
}

.loader-bus {
  width: min(320px, 70vw);
  max-width: 360px;
  margin-bottom: 22px;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,0.16));
}

.global-loader p {
  font-size: 20px;
  font-weight: 700;
  color: #0B2E4E;
  letter-spacing: 0.02em;
}

.hidden {
  display: none !important;
}

.no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-gray);
  font-size: 16px;
}
