/* ============================================
   OPTIMIZACIÓN MÓVIL - FORMULARIO VISIBLE SIN SCROLL
   Mantiene los colores originales, solo ajusta layout
   ============================================ */

@media (max-width: 767px) {
  
  /* ====================
     AJUSTE DEL HEADER
     ==================== */
  
  /* Header más compacto */
  header {
    height: 56px !important;
    min-height: 56px !important;
  }
  
  header .container {
    height: 56px !important;
  }
  
  /* Logo y texto más pequeños */
  header .flex.items-center.space-x-2 {
    font-size: 14px !important;
  }
  
  header .w-8.h-8 {
    width: 28px !important;
    height: 28px !important;
  }
  
  
  /* ====================
     HERO SECTION
     ==================== */
  
  /* Reducir dramáticamente padding superior */
  section.min-h-screen {
    min-height: auto !important;
    padding-top: 64px !important; /* Espacio para header fijo */
    padding-bottom: 1rem !important;
  }
  
  section.py-12,
  section.py-16,
  section.py-20 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  
  /* Contenedor principal del hero */
  main > section:first-child {
    padding-top: 72px !important;
    padding-bottom: 0.5rem !important;
  }
  
  
  /* ====================
     TÍTULOS
     ==================== */
  
  /* Título principal - más pequeño y compacto */
  .text-center.mb-6 {
    margin-bottom: 12px !important;
  }
  
  h1,
  .text-subtitle-mobile,
  .text-hero {
    font-size: 20px !important;
    line-height: 1.2 !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
  }
  
  /* Subtítulo descriptivo */
  .text-center p,
  .text-body {
    font-size: 13px !important;
    line-height: 1.3 !important;
    margin-bottom: 0 !important;
  }
  
  
  /* ====================
     TARJETA DEL FORMULARIO
     ==================== */
  
  /* Contenedor de la tarjeta blanca */
  .max-w-2xl.mx-auto > div {
    padding: 16px !important;
    border-radius: 16px !important;
  }
  
  /* Reducir padding interno del formulario */
  .p-4,
  .p-12,
  .md\\:p-12 {
    padding: 12px !important;
  }
  
  
  /* ====================
     FORMULARIO
     ==================== */
  
  /* Espaciado entre grupos de campos */
  form .space-y-4,
  form .space-y-6 {
    gap: 10px !important;
  }
  
  form .space-y-4 > * + *,
  form .space-y-6 > * + * {
    margin-top: 10px !important;
  }
  
  /* Espaciado dentro de cada campo */
  .space-y-2 {
    gap: 6px !important;
  }
  
  .space-y-2 > * + * {
    margin-top: 6px !important;
  }
  
  .space-y-3 {
    gap: 8px !important;
  }
  
  .space-y-3 > * + * {
    margin-top: 8px !important;
  }
  
  
  /* ====================
     LABELS
     ==================== */
  
  label {
    font-size: 13px !important;
    margin-bottom: 4px !important;
    display: block !important;
  }
  
  
  /* ====================
     BOTONES DE TIPO DE VIAJE
     ==================== */
  
  /* Contenedor de botones radio - SIEMPRE en fila horizontal */
  /* Múltiples selectores para máxima compatibilidad */
  div.flex.flex-col.gap-4,
  div.flex.flex-col.sm\\:flex-row.gap-4,
  .flex.flex-col.gap-4,
  .flex.flex-col.sm\\:flex-row.gap-4,
  div[class*="flex-col"][class*="gap-4"],
  form div.flex.flex-col,
  form .flex.flex-col.gap-4 {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
  }
  
  /* Forzar horizontal en todos los contenedores flex dentro del formulario */
  form div.flex.flex-col:not(.space-y-2):not(.space-y-3):not(.space-y-4):not(.space-y-6) {
    flex-direction: row !important;
  }
  
  /* Cada opción de radio - distribución equitativa */
  label.flex.items-center.p-4,
  label.flex.items-center[class*="p-"],
  form label.flex.items-center {
    flex: 1 !important;
    padding: 10px 8px !important;
    border-radius: 10px !important;
    justify-content: center !important;
    text-align: center !important;
    min-width: 0 !important;
  }
  
  /* Círculo del radio button */
  label .w-5.h-5,
  label [class*="w-5"],
  label input[type="radio"] + div,
  label input[type="radio"] ~ div {
    width: 18px !important;
    height: 18px !important;
    margin-right: 6px !important;
    flex-shrink: 0 !important;
  }
  
  /* Texto del radio button - más compacto */
  label span,
  label.flex span {
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  
  /* ====================
     INPUTS Y SELECTS
     ==================== */
  
  /* Campos de entrada */
  input[type="text"],
  input[type="date"],
  input[type="email"],
  input[type="number"],
  select,
  textarea {
    height: 44px !important;
    font-size: 15px !important; /* Evita zoom automático en iOS */
    padding: 8px 12px !important;
    border-radius: 10px !important;
  }
  
  /* Ajustar padding cuando hay iconos */
  input[type="text"] + .absolute,
  input[type="date"] + .absolute,
  select + .absolute {
    left: 12px !important;
  }
  
  .relative input,
  .relative select {
    padding-left: 40px !important;
    padding-right: 12px !important;
  }
  
  /* Iconos dentro de inputs */
  .absolute.left-4 {
    left: 12px !important;
  }
  
  .absolute svg {
    width: 18px !important;
    height: 18px !important;
  }
  
  /* Textarea */
  textarea {
    height: auto !important;
    min-height: 80px !important;
    padding: 10px 12px !important;
  }
  
  
  /* ====================
     GRID DE CAMPOS
     ==================== */
  
  /* Grid de 2 columnas en formulario */
  .grid.grid-cols-1.md\\:grid-cols-2.gap-4 {
    gap: 10px !important;
  }
  
  
  /* ====================
     BOTÓN PRINCIPAL
     ==================== */
  
  /* Botón de "Buscar Vuelos" */
  button[type="submit"] {
    height: 48px !important;
    font-size: 15px !important;
    margin-top: 12px !important;
    border-radius: 10px !important;
    padding: 0 16px !important;
  }
  
  button[type="submit"] svg {
    width: 18px !important;
    height: 18px !important;
  }
  
  
  /* ====================
     MENSAJES DE ERROR
     ==================== */
  
  /* Mensajes de validación */
  p.text-sm {
    font-size: 11px !important;
    margin-top: 4px !important;
  }
  
  
  /* ====================
     AJUSTES FINALES
     ==================== */
  
  /* Remover margin-bottom excesivo */
  .mb-2,
  .mb-3,
  .mb-4,
  .mb-6,
  .mb-8 {
    margin-bottom: 8px !important;
  }
  
  /* Padding horizontal del contenedor */
  .px-4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Remover height mínimo de secciones */
  .min-h-screen {
    min-height: auto !important;
  }
  
  /* Ajustar contenedor principal */
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Primera sección después del header */
  body > div > main > section:first-child {
    padding-top: 72px !important;
  }
  
  /* Centrado del contenido */
  .flex.items-center.justify-center {
    align-items: flex-start !important;
    padding-top: 8px !important;
  }
}


/* ====================
   TABLETS PEQUEÑAS
   ==================== */

@media (min-width: 768px) and (max-width: 1023px) {
  section.py-16,
  section.py-20 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}


/* ====================
   LANDSCAPE MÓVIL (HORIZONTAL)
   ==================== */

@media (max-width: 767px) and (orientation: landscape) {
  /* Aún más compacto en modo horizontal */
  section.min-h-screen {
    padding-top: 60px !important;
  }
  
  h1 {
    font-size: 18px !important;
  }
  
  .text-center p {
    font-size: 12px !important;
  }
  
  input,
  select,
  button {
    height: 40px !important;
  }
  
  .space-y-4 > * + *,
  .space-y-6 > * + * {
    margin-top: 8px !important;
  }
}
