/* ============================================================
   Kayron — hoja de estilos compartida
   Capa responsive + navegación móvil (hamburguesa).
   El diseño de escritorio NO cambia: las reglas responsive
   solo aplican por debajo de 900px. Se retrofitea sobre el
   HTML con estilos inline mediante selectores de atributo +
   !important (external CSS con !important gana a inline).
   ============================================================ */

/* --- Base --- */
img { max-width: 100%; height: auto; }
a:focus-visible, button:focus-visible { outline: 2px solid #0E8C8C; outline-offset: 2px; border-radius: 4px; }

/* Botón hamburguesa y menú móvil: ocultos en escritorio */
.nav-toggle { display: none; }
#m-menu { display: none; }

/* ============ TABLET / MÓVIL ( <= 900px ) ============ */
@media (max-width: 900px) {

  /* 1) Anular el ancho fijo de escritorio para permitir el reflow */
  [style*="min-width:1440px"] {
    min-width: 0 !important;
    width: 100% !important;
    overflow-x: hidden;
  }

  /* 2) Padding horizontal fluido para todas las secciones (…px 48px) */
  [style*="padding"][style*="48px"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* 3) Barra superior secundaria: se oculta en móvil (info no esencial) */
  [style*="height:36px; background:#0A1A33"] { display: none !important; }

  /* 4) Cabecera: ocultar enlaces y CTAs de escritorio, mostrar hamburguesa */
  span[style*="gap:26px; font-size:14px; margin-left:8px"] { display: none !important; }
  a[style*="height:40px; border-radius:6px"] { display: none !important; }
  [style*="height:80px; border-bottom:1px solid #E2E8F0"] { gap: 12px !important; }
  .nav-toggle {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    width: 44px; height: 40px; flex: none;
    background: #fff; border: 1px solid #CBD5E1; border-radius: 6px;
    color: #0A1A33; cursor: pointer;
  }

  /* 5) Menú móvil desplegable */
  #m-menu.open {
    display: flex !important; flex-direction: column;
    position: fixed; top: 80px; left: 0; right: 0; z-index: 100;
    background: #fff; border-top: 1px solid #E2E8F0; border-bottom: 1px solid #E2E8F0;
    padding: 8px 20px 16px; box-shadow: 0 10px 24px rgba(10,26,51,.14);
    max-height: calc(100vh - 80px); overflow-y: auto;
  }
  #m-menu.open a {
    padding: 13px 4px; font-size: 15px; color: #0A1A33; text-decoration: none;
    border-bottom: 1px solid #F1F5F9;
  }
  #m-menu.open a.cta { color: #0E8C8C; font-weight: 600; border-bottom: none; margin-top: 6px; }
  #m-menu.open a.cta-primary { color: #1D5AA0; font-weight: 600; }

  /* 6) Rejillas → una sola columna (genérico: cubre TODOS los patrones inline,
        incl. listas numeradas 60px/1fr/340px, cabeceras 320px/1fr, form 1fr/420px) */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  /* items que ocupaban 2 columnas: evitar que generen una 2ª columna implícita */
  [style*="grid-column:span 2"] { grid-column: auto !important; }
  /* separadores verticales entre celdas ya no aplican en 1 columna */
  [style*="border-left:1px solid #E2E8F0"] { border-left: none !important; }

  /* 6b) Filas flex horizontales (CTA/cabeceras título+acción) → apilar */
  [style*="display:flex"][style*="align-items:center"][style*="gap:40px"],
  [style*="display:flex"][style*="align-items:flex-end"] {
    flex-direction: column !important; align-items: flex-start !important;
  }
  [style*="margin-left:auto"] { margin-left: 0 !important; }
  /* Barra legal del footer (© · RIF · correo) → que envuelva en vez de apretarse */
  [style*="align-items:center"][style*="gap:20px"][style*="#64748B"] { flex-wrap: wrap !important; }
  /* hijos de ancho fijo no deben forzar overflow ni quedar estrechos */
  [style*="width:420px"], [style*="width:460px"], [style*="width:480px"],
  [style*="width:520px"], [style*="width:840px"], [style*="width:880px"] {
    width: 100% !important; max-width: 100% !important;
  }

  /* 7) Hero: alturas/tipografía/posición fluidas */
  [style*="min-height:640px"] { min-height: 0 !important; }
  h2[style*="font-size:50px"] { font-size: clamp(28px, 8vw, 40px) !important; line-height: 1.15 !important; }
  [style*="padding:76px 48px 170px"] { padding: 40px 20px 40px !important; max-width: 100% !important; }
  /* tarjeta absoluta bajo el hero → a flujo normal, pero relative (no static)
     para quedar POR ENCIMA del degradado absoluto del hero y no perder contraste */
  [style*="position:absolute; left:48px; right:48px; bottom:-1px"] {
    position: relative !important; left: auto !important; right: auto !important;
    bottom: auto !important; margin: 24px 20px 0; border-radius: 12px !important;
    z-index: 2;
  }

  /* 8) Bloques con alto fijo (imágenes) → más bajos */
  [style*="height:340px"] { height: 220px !important; }

  /* 9) Títulos grandes de sección algo menores en móvil */
  h3[style*="font-size:32px"] { font-size: clamp(22px, 6vw, 32px) !important; }
}

/* Ajuste fino para teléfonos muy estrechos */
@media (max-width: 480px) {
  [style*="padding"][style*="48px"] { padding-left: 16px !important; padding-right: 16px !important; }
}
