/* ========================================
   CLIMA.CSS — DroneMedellín
   Chequeo Climático para Drone — /clima
   ======================================== */

/* Reutiliza variables del sistema de diseño principal */
:root {
  --blue:        #265cdc;
  --blue-dark:   #1a45b0;
  --dark:        #1b1b1b;
  --gray-bg:     #f7f7f7;
  --white:       #ffffff;
  --text:        #333333;
  --text-light:  #666666;
  --font-head:   'Montserrat', sans-serif;
  --font-body:   'Lato', sans-serif;
  --transition:  0.3s ease;
  --radius:      8px;
  --radius-md:   12px;
  --radius-lg:   14px;
  --shadow:      0 2px 16px rgba(0,0,0,0.10);

  /* Semáforo */
  --verde:       #16a34a;
  --verde-bg:    #f0fdf4;
  --verde-borde: #86efac;
  --amarillo:    #b45309;
  --amarillo-bg: #fffbeb;
  --amarillo-borde: #fcd34d;
  --rojo:        #dc2626;
  --rojo-bg:     #fef2f2;
  --rojo-borde:  #fca5a5;
  --error-bg:    #fff3cd;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text); background: var(--gray-bg); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
.oculto { display: none !important; }

/* ─── HEADER ──────────────────────────────────────────────── */
.clima-header {
  background: var(--dark);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.clima-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.clima-logo img { height: 34px; width: auto; }
.clima-header-title {
  flex: 1;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  letter-spacing: 0.03em;
}
.clima-back {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  transition: color var(--transition);
  white-space: nowrap;
}
.clima-back:hover { color: #fff; }

/* Language toggle */
.clima-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-toggle {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 20px;
  padding: 4px 6px;
  display: flex;
  gap: 2px;
  cursor: pointer;
  transition: background var(--transition);
}
.lang-toggle:hover { background: rgba(255,255,255,0.15); }
.lang-opt {
  color: rgba(255,255,255,0.5);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 16px;
  transition: all var(--transition);
  cursor: pointer;
}
.lang-opt.active {
  background: #fff;
  color: var(--dark);
}

/* ─── LAYOUT ──────────────────────────────────────────────── */
.clima-main { min-height: calc(100vh - 64px); }
.clima-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── INTRO ───────────────────────────────────────────────── */
.clima-intro {
  background: var(--blue);
  padding: 40px 0 36px;
  text-align: center;
}
.clima-intro h1 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.clima-intro p {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  max-width: 520px;
  margin: 0 auto;
}

/* ─── TOOL SECTION ────────────────────────────────────────── */
.clima-tool { padding: 32px 0 48px; }

/* ─── BÚSQUEDA ────────────────────────────────────────────── */
.busqueda-wrap { margin-bottom: 16px; }
.form-label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}
.busqueda-input-wrap { position: relative; }
.busqueda-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
}
.busqueda-input:focus { border-color: var(--blue); }

.btn-mi-ubicacion {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
  z-index: 10;
}
.btn-mi-ubicacion:hover {
  background: var(--blue-dark);
  transform: translateY(-50%) scale(1.02);
}
.btn-mi-ubicacion:active {
  transform: translateY(-50%) scale(0.98);
}
.btn-mi-ubicacion:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.lugar-descripcion {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.3;
  min-height: 16px;
}

.sugerencias {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}
.sug-item {
  padding: 11px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background var(--transition);
  line-height: 1.4;
}
.sug-item:last-child { border-bottom: none; }
.sug-item:hover { background: #f0f4ff; }
.sug-empty { color: var(--text-light); cursor: default; }
.sug-empty:hover { background: none; }

/* ─── UBICACIÓN HEADER COMPACTA ──────────────── */
.ubicacion-header-compact {
  margin-bottom: 20px;
}

.ubicacion-row {
  background: linear-gradient(135deg, #f8faff 0%, #ffffff 100%);
  border: 2px solid #e0e7f1;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ubicacion-info-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}

.ubicacion-nombre-compact {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
  line-height: 1.2;
}

.separador-inline {
  color: #cbd5e1;
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 700;
  user-select: none;
}

.fecha-hora-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
  white-space: nowrap;
}

.btn-cambiar-ubicacion-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--blue);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-cambiar-ubicacion-compact .btn-icon {
  font-size: 1rem;
  line-height: 1;
}

.btn-cambiar-ubicacion-compact .btn-text {
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-cambiar-ubicacion-compact:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn-cambiar-ubicacion-compact:active {
  transform: translateY(0);
}

.metar-badge {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  border: 2px solid #3b82f6;
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.metar-badge-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.metar-badge-text {
  font-size: 0.9rem;
  color: #1e40af;
  line-height: 1.4;
}

.metar-badge-text strong {
  font-weight: 700;
  color: #1e3a8a;
}

/* ─── MODAL BÚSQUEDA ───────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}

.modal-busqueda {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  width: 90%;
  max-width: 500px;
  animation: slideDown 0.3s ease;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  position: relative;
}

.btn-cerrar-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 1.1rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-cerrar-modal:hover {
  background: #e5e7eb;
  color: #374151;
  transform: rotate(90deg);
}

.modal-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 20px 0;
}

/* Controles dentro del modal */
.controles-row-modal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.controles-row-modal .control-group {
  width: 100%;
}

.controles-row-modal .form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.controles-row-modal .control-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: 2px solid #ddd;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  cursor: pointer;
}

.controles-row-modal .control-input:focus {
  border-color: var(--blue);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -55%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* ─── BOTÓN CONSULTAR (dentro del modal) ────────────────────────────────── */
.btn-consultar {
  width: 100%;
  min-height: 52px;
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 16px rgba(38, 92, 220, 0.28);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  margin-top: 20px;
}
.btn-consultar:hover {
  background: #2d63df;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(38, 92, 220, 0.32);
}
.btn-consultar:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(38, 92, 220, 0.26);
}
.btn-consultar:focus-visible,
.btn-whatsapp:focus-visible,
.btn-avanzado:focus-visible,
.busqueda-input:focus-visible,
.control-input:focus-visible {
  outline: 3px solid rgba(38, 92, 220, 0.24);
  outline-offset: 2px;
}

/* ─── MAPA ────────────────────────────────────────────────── */
.clima-mapa {
  width: 100%;
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #ddd;
  box-shadow: var(--shadow);
  margin-bottom: 6px;
  background: #e8eaf0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.clima-mapa.zoom-in {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.mapa-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 24px;
  text-align: center;
}

/* ─── RESULTADO SEMÁFORO ──────────────────────────────────── */
.resultado-card {
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  background: var(--white);
  border: 2px solid #ddd;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.resultado-card.sem-verde  { background: var(--verde-bg);    border-color: var(--verde-borde); }
.resultado-card.sem-amarillo { background: var(--amarillo-bg); border-color: var(--amarillo-borde); }
.resultado-card.sem-rojo   { background: var(--rojo-bg);     border-color: var(--rojo-borde); }
.resultado-card.sem-error  { background: var(--error-bg);    border-color: #ffc107; }

.sem-circulo {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 10px;
}
.sem-texto {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 4px;
}
.sem-verde  .sem-texto  { color: var(--verde); }
.sem-amarillo .sem-texto { color: var(--amarillo); }
.sem-rojo   .sem-texto  { color: var(--rojo); }

.sem-lugar {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.datos-fuente {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
  font-weight: 500;
}

.cargando {
  font-size: 1rem;
  color: var(--text-light);
  padding: 16px 0;
}
.error-msg {
  font-size: 0.95rem;
  color: #856404;
  padding: 8px 0;
}

/* Datos clave */
.datos-clave {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 4px;
}
.dato-item {
  background: rgba(255,255,255,0.7);
  border-radius: 6px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.dato-ico { font-size: 1.2rem; }
.dato-val { font-size: 1rem; }
.dato-val strong { font-size: 1.05rem; }
.dato-lbl { font-size: 0.72rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.04em; }

/* ─── WHATSAPP ────────────────────────────────────────────── */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 13px 20px;
  background: #22c55e;
  color: #fff;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.96rem;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 16px rgba(18, 160, 80, 0.24);
  cursor: pointer;
  margin-bottom: 24px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-whatsapp:hover {
  background: #1db055;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(18, 160, 80, 0.28);
}
.btn-whatsapp:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(18, 160, 80, 0.24);
}

/* ─── MODO AVANZADO ───────────────────────────────────────── */
.avanzado-section { margin-top: 8px; }
.btn-avanzado {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8faff;
  color: #1f3f8f;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid #cfe0ff;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
  letter-spacing: 0.01em;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-avanzado:hover {
  border-color: #b8d0ff;
  background: #eef4ff;
  color: #17357d;
}
.btn-avanzado:active { transform: translateY(1px); }

.panel-avanzado {
  margin-top: 16px;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tabla-scroll { overflow-x: auto; }
.tabla-horas {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 520px;
}
.tabla-horas th {
  background: var(--dark);
  color: #fff;
  padding: 10px 12px;
  text-align: center;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tabla-horas th small { font-weight: 400; opacity: 0.7; }
.tabla-horas td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
}
.tabla-horas tr:last-child td { border-bottom: none; }
.tabla-horas tr:nth-child(even) { background: var(--gray-bg); }
.tabla-horas tr.hora-activa {
  background: #eff6ff;
  font-weight: 700;
}
.tabla-horas tr.hora-activa td { color: var(--blue); }
.hora-col { white-space: nowrap; font-weight: 600; text-align: left; }

/* METAR rows */
.metar-separator {
  background: #e0f2fe !important;
  font-weight: 700;
  color: var(--blue-dark);
}
.metar-separator td {
  padding: 10px 12px !important;
  text-align: left !important;
  border-top: 2px solid var(--blue);
  border-bottom: 1px solid var(--blue);
}
.metar-row {
  background: #f0f9ff !important;
}
.metar-row td {
  text-align: left !important;
  font-size: 0.9rem;
}
.metar-row td:first-child {
  font-weight: 600;
  color: var(--blue-dark);
}
.metar-row details {
  cursor: pointer;
}
.metar-row summary {
  font-weight: 600;
  color: var(--blue);
  padding: 4px 0;
}
.metar-row summary:hover {
  color: var(--blue-dark);
}
.metar-row code {
  display: block;
  background: #f5f5f5;
  padding: 8px;
  margin-top: 8px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.disclaimer-metar {
  padding: 14px 18px;
  font-size: 0.82rem;
  color: var(--text-light);
  background: #fffbeb;
  border-top: 1px solid #fcd34d;
  line-height: 1.5;
}

/* ─── FOOTER ──────────────────────────────────────────────── */
.clima-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 24px 0;
  font-size: 0.85rem;
}
.clima-footer p + p { margin-top: 6px; }
.clima-footer a { color: rgba(255,255,255,0.8); transition: color var(--transition); }
.clima-footer a:hover { color: #fff; }
.footer-apis { font-size: 0.78rem; opacity: 0.7; }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .clima-header-title { display: none; }
  .clima-back { font-size: 0.78rem; }
  .lang-toggle { padding: 3px 5px; }
  .lang-opt { 
    font-size: 0.68rem; 
    padding: 3px 8px; 
  }
  .clima-intro { padding: 28px 0 24px; }
  .clima-intro h1 { font-size: clamp(1.3rem, 6vw, 1.8rem); }
  .clima-intro p { font-size: 0.92rem; }
  .clima-tool { padding: 20px 0 38px; }
  .clima-tool .clima-container {
    background: #ffffff;
    border: 1px solid #e7ecf4;
    border-radius: 18px;
    padding-top: 16px;
    padding-bottom: 16px;
    box-shadow: 0 8px 24px rgba(27, 27, 27, 0.06);
  }
  .clima-mapa { height: 220px; }
  .form-label {
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    margin-bottom: 7px;
  }
  .btn-mi-ubicacion {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 8px;
    min-height: 44px;
    font-size: 0.88rem;
  }
  .btn-mi-ubicacion:hover,
  .btn-mi-ubicacion:active {
    transform: none;
  }
  .lugar-descripcion {
    font-size: 0.75rem;
    margin-top: 6px;
  }
  
  /* Ubicacion header responsive */
  .ubicacion-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .ubicacion-info-compact {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  .ubicacion-nombre-compact {
    font-size: 1.05rem;
    text-align: center;
  }
  .separador-inline {
    display: none;
  }
  .fecha-hora-info {
    font-size: 0.8rem;
    justify-content: center;
  }
  .btn-cambiar-ubicacion-compact {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  .btn-cambiar-ubicacion-compact .btn-icon {
    font-size: 1.1rem;
  }
  .btn-cambiar-ubicacion-compact .btn-text {
    font-size: 0.9rem;
  }
  .metar-badge {
    padding: 10px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .metar-badge-icon {
    font-size: 1.3rem;
  }
  .metar-badge-text {
    font-size: 0.85rem;
  }
  .modal-busqueda {
    width: 95%;
    max-width: none;
  }
  .modal-content {
    padding: 20px 16px;
  }
  .modal-title {
    font-size: 1.1rem;
    margin-bottom: 16px;
  }
  .controles-row-modal {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .controles-row-modal .control-input {
    min-height: 48px;
  }
  .busqueda-input,
  .control-input,
  .btn-consultar,
  .btn-whatsapp,
  .btn-avanzado {
    min-height: 50px;
    font-size: 0.95rem;
    border-radius: 12px;
  }
  .busqueda-input,
  .control-input {
    border-color: #d8deea;
    background: #fff;
  }
  .btn-consultar,
  .btn-whatsapp,
  .btn-avanzado {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }
  .btn-avanzado {
    font-size: 0.86rem;
    line-height: 1.25;
  }
  .resultado-card { padding: 22px 16px; }
  .sem-circulo { font-size: 2.8rem; }
  .sem-texto { font-size: 1.2rem; }
  .datos-clave { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dato-val strong { font-size: 0.95rem; }
  .panel-avanzado { margin-top: 12px; }
  .btn-whatsapp { font-size: 0.92rem; padding: 12px 18px; }
}

@media (max-width: 400px) {
  .clima-container { padding: 0 12px; }
  .clima-tool .clima-container { border-radius: 14px; }
  .controles-row { grid-template-columns: 1fr; }
  .clima-mapa { height: 200px; }
  .btn-consultar,
  .btn-whatsapp,
  .btn-avanzado {
    font-size: 0.9rem;
  }
  .datos-clave { grid-template-columns: 1fr 1fr; gap: 6px; }
  .dato-item { padding: 8px 6px; }
  .dato-val strong { font-size: 0.9rem; }
  .dato-lbl { font-size: 0.68rem; }
  .btn-whatsapp { padding: 11px 14px; }
}

/* ─── TIMELINE HOURLY (NEW) ───────────────────────────────── */
.timeline-section {
  margin-top: 24px;
  background: var(--white);
  border: 1px solid #e0e7f1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.timeline-title {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  padding: 16px 20px;
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.timeline-scroll {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px;
  gap: 12px;
  background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
}

/* Hide scrollbar but keep functionality */
.timeline-scroll::-webkit-scrollbar {
  height: 6px;
}
.timeline-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}
.timeline-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.timeline-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.timeline-hour {
  flex: 0 0 auto;
  width: 90px;
  scroll-snap-align: center;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
}

.timeline-hour:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  border-color: #3b82f6;
}

.timeline-hour:active {
  transform: translateY(-2px);
}

.timeline-hour.active {
  border-color: #2563eb;
  border-width: 3px;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.timeline-hour.selected {
  border-color: #1e40af;
  border-width: 3px;
  background: linear-gradient(135deg, #bfdbfe 0%, #dbeafe 100%);
}

/* Semáforo indicator */
.timeline-hour.status-green {
  border-left: 4px solid #10b981;
}
.timeline-hour.status-yellow {
  border-left: 4px solid #f59e0b;
}
.timeline-hour.status-red {
  border-left: 4px solid #ef4444;
}

.timeline-time {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.timeline-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin: 8px 0;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.timeline-temp {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: #334155;
  margin: 6px 0 4px;
}

.timeline-wind {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 4px;
}

.timeline-source {
  font-size: 0.85rem;
  margin-top: 6px;
  opacity: 0.7;
  line-height: 1;
}

/* Details Panel */
.timeline-details {
  border-top: 2px solid #e2e8f0;
  background: #f8fafc;
  padding: 24px 20px;
  position: relative;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-details {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: #ffffff;
  border-radius: 50%;
  font-size: 1.2rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.close-details:hover {
  background: #ef4444;
  color: #ffffff;
  transform: rotate(90deg);
}

.details-content {
  max-width: 800px;
  margin: 0 auto;
}

.details-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
}

.details-hour-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
}

.details-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  margin-top: 8px;
}

.details-status.status-green {
  background: #d1fae5;
  color: #065f46;
}
.details-status.status-yellow {
  background: #fef3c7;
  color: #92400e;
}
.details-status.status-red {
  background: #fee2e2;
  color: #991b1b;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.details-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.details-card-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.details-card-value {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
}

.details-metar {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  border: 2px solid #3b82f6;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.details-metar-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.details-metar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.details-metar-item {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 12px;
}

.details-metar-label {
  font-size: 0.7rem;
  color: #3b82f6;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.details-metar-value {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.details-metar-raw {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #bfdbfe;
}

.details-metar-raw summary {
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 6px 0;
}

.details-metar-raw summary:hover {
  color: #1e40af;
}

.details-metar-raw code {
  display: block;
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px;
  margin-top: 8px;
  overflow-x: auto;
  font-family: 'Courier New', 'Monaco', monospace;
  font-size: 0.85rem;
  border-radius: 6px;
  line-height: 1.5;
  border: 1px solid #334155;
}

/* Responsive Timeline */
@media (max-width: 600px) {
  .timeline-scroll {
    padding: 16px 12px;
    gap: 10px;
  }
  .timeline-hour {
    width: 80px;
    padding: 12px 6px;
  }
  .timeline-icon {
    font-size: 2.4rem;
    margin: 6px 0;
  }
  .timeline-temp {
    font-size: 1rem;
  }
  .timeline-wind {
    font-size: 0.7rem;
  }
  .timeline-details {
    padding: 20px 16px;
  }
  .details-hour-title {
    font-size: 1.3rem;
  }
  .details-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .details-metar-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
