/* ============================================================
   NEODATO — AJUSTES DE CELULAR (iPhone y similares)
   Se carga al final de cada página, después de sus propios estilos.
   TODO vive dentro de @media (max-width: 600px): en escritorio y
   tablet este archivo no aplica ninguna regla.
   ============================================================ */

@media (max-width: 600px) {

    /* ── BASE iOS ─────────────────────────────────────── */
    html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    a, button { -webkit-tap-highlight-color: rgba(166, 118, 63, 0.12); }
    /* iOS hace zoom al enfocar un campo con letra < 16 px */
    input, select, textarea { font-size: 16px !important; }

    /* ── HEADER: logo a la izquierda, navegación repartida a la derecha ── */
    header.site-header {
        padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
        gap: 0;
    }
    .header-left { flex: 1; justify-content: space-between; gap: 16px; }
    .logo-img { height: 26px; margin: 0 -35px; }
    .site-nav { gap: 20px; }
    .site-nav-link { font-size: 0.9rem; padding: 12px 0; }
    .site-nav-link::after { bottom: 6px; }

    /* ── BOTÓN FLOTANTE DE NEOBOT ─────────────────────── */
    .btn-chatbot-fab {
        right: max(16px, env(safe-area-inset-right));
        bottom: calc(16px + env(safe-area-inset-bottom));
        height: 48px;
        padding: 0 20px 0 7px;
    }
    .btn-chatbot-fab::before { width: 34px; height: 34px; }

    /* ── MIGAS ────────────────────────────────────────── */
    .breadcrumbs { padding: 0 20px; }

    /* ── FOOTER: centrado y con aire para el botón flotante ── */
    footer.main-footer { padding: 40px 20px calc(96px + env(safe-area-inset-bottom)); }
    .footer-content { flex-direction: column; align-items: center; text-align: center; gap: 20px; }
    .footer-brand { line-height: 1.6; max-width: 300px; }
    .footer-version { display: inline-block; }
    .footer-socials { flex-wrap: wrap; justify-content: center; gap: 6px; }
    .social-link { min-height: 36px; padding: 0 10px; gap: 5px; font-size: 0.74rem; }

    /* ============================================================
       HOME (index.html)
       ============================================================ */
    .nd-wrap { padding: 0 20px; }

    /* Hero centrado */
    .nd-hero-inner { padding: 132px 20px 44px; align-items: center; text-align: center; }
    .nd-hero h1 { font-size: clamp(2.35rem, 10.4vw, 2.8rem); line-height: 1.04; }
    .nd-hero-sub { margin-top: 18px; font-size: 1.02rem; max-width: 340px; }
    .nd-search { margin-top: 26px; height: 60px; padding: 0 5px 0 20px; }
    .nd-search input { font-size: 16px !important; }
    .nd-search button { width: 50px; height: 50px; }
    .nd-chips {
        margin-top: 18px; width: 100%;
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    }
    .nd-chip {
        justify-content: center; text-align: center; min-height: 44px; padding: 6px 12px;
        font-size: 0.8125rem; line-height: 1.25;
    }
    .nd-trust { justify-content: center; gap: 8px 18px; margin-top: 22px; font-size: 0.78rem; }

    /* Franja de cifras: centrada en cada celda */
    .nd-stats { padding: 40px 0 44px; }
    .nd-stats-grid { column-gap: 0; row-gap: 28px; }
    .nd-stat, .nd-stat:nth-child(odd) { padding: 0 12px; text-align: center; }
    .nd-stat:nth-child(odd) { border-left: 0; }
    .nd-stat:nth-child(even) { border-left: 1px solid #2A2925; }
    .nd-stat-v { font-size: clamp(1.7rem, 8vw, 2.1rem); }
    .nd-stat-l { font-size: 0.8rem; }

    /* Títulos de sección centrados */
    .nd-section, .nd-faq { padding-top: 56px; }
    .nd-head-row { align-items: center; text-align: center; gap: 12px; }
    .nd-head-aside { text-align: center; max-width: 320px; }
    .nd-h2 { font-size: clamp(1.9rem, 8.4vw, 2.3rem); }
    .nd-public > div:first-child,
    .nd-rep > div:first-child,
    .nd-botgrid > div:first-child { text-align: center; }
    .nd-lead { font-size: 1.02rem; }

    /* Módulos: contenido centrado dentro de cada tarjeta */
    .nd-modules { margin-top: 28px; gap: 14px; }
    .nd-mod { padding: 28px 22px; align-items: center; text-align: center; gap: 12px; }
    .nd-mod-t { font-size: 1.9rem; }
    .nd-mod-foot { width: 100%; flex-direction: column; align-items: center; gap: 18px; padding-top: 6px; }
    .nd-mod--proy .nd-mod-foot { align-items: stretch !important; }
    .nd-mod--proy .nd-mod-cta { align-self: center; }
    .nd-botmark { align-self: center; }
    .nd-mod-soon { flex-direction: column; justify-content: center; text-align: center; gap: 6px; padding: 20px 22px; }

    /* Datos públicos */
    .nd-public { gap: 36px; }
    .nd-doc { padding: 28px 20px 22px; }
    .nd-line { font-size: 1.14rem; padding: 18px 0; }
    .nd-doc-head { justify-content: center; text-align: center; }
    .nd-doc-src { text-align: center; }

    /* ¿Quién te representa? + Dato del día */
    .nd-duo { padding-top: 48px; gap: 20px; }
    .nd-rep, .nd-dato { padding: 28px 20px; }
    .nd-rep { gap: 22px; }
    .nd-rep-field { height: 58px; }
    .nd-btn { height: 54px; }
    .nd-link-arrow { align-self: center; }
    .nd-dato { text-align: center; }
    .nd-dato-head { justify-content: center; flex-direction: column; gap: 6px; }
    .nd-dato-v { margin-top: 26px; font-size: clamp(3.4rem, 17vw, 4.4rem); }
    .nd-dato-acts { justify-content: center; }
    .nd-dato-soon { flex: 1 1 auto; font-size: 0.86rem; padding: 0 14px; }

    /* Así responde Neobot */
    .nd-botsec { padding: 52px 0; }
    .nd-botgrid { gap: 32px; }
    .nd-feats { text-align: left; max-width: 360px; margin: 28px auto 0; }
    .nd-btn-pill { margin-top: 28px; }
    .nd-chat-top { padding: 0 18px; }
    .nd-chat-body { padding: 18px 16px; }
    .nd-bubble-b > div { padding: 16px; }

    /* Preguntas por tema */
    .nd-faq { padding-bottom: 48px; }
    .nd-faq .temas-grid { margin-top: 24px; gap: 12px; }
    .nd-faq .tema-card { padding: 20px 20px 6px; }

    /* ============================================================
       DIRECTORIO (directorio.html)
       ============================================================ */
    .dr-head { text-align: center; gap: 22px; }
    .dr-head h1 { font-size: clamp(2.3rem, 10.4vw, 2.8rem); }
    .dr-lead { margin-left: auto; margin-right: auto; font-size: 1.02rem; }
    .dr-updated { justify-content: center; text-align: left; }
    .dr-try { justify-content: center; }
    .dr-search-field input { font-size: 16px !important; }

    /* ============================================================
       PROYECTOS (proyectos.html)
       ============================================================ */
    .py-head { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
    .py-head h1 { font-size: clamp(2.3rem, 10.4vw, 2.8rem); }
    .py-lead { font-size: 1.02rem; max-width: 360px; }
    .py-funnel-foot { justify-content: center; text-align: center; }

    /* ============================================================
       EXPEDIENTES (diputado.html y proyecto.html · expediente.css)
       Carátula apilada y centrada: foto arriba, nombre, chips, acciones.
       ============================================================ */
    .ex-carpeta-in,
    .ex-carpeta-in.con-foto { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 26px 18px 18px; }
    .ex-foto { width: 112px; height: 134px; margin: 0 auto; border-radius: 14px; }
    .ex-ident { align-items: center; text-align: center; gap: 14px; }
    .ex-h1 { font-size: clamp(1.9rem, 8.6vw, 2.3rem); }
    .ex-h1.largo { font-size: clamp(1.4rem, 6.2vw, 1.7rem); }
    .ex-chips, .ex-meta { justify-content: center; }
    .ex-texto { text-align: center; }
    .ex-ley { justify-content: center; text-align: left; }
    .ex-acciones .ex-aviso { justify-content: center; text-align: left; }
    .ex-acciones .ex-btn-neobot { justify-content: center; }
    .ex-btn-fila > * { flex: 1 1 0; min-width: 0; justify-content: center; }

    /* ============================================================
       NEOBOT (neobot.html)
       ============================================================ */
    main.neobot { padding: 0 20px; }
    .bienvenida .eyebrow { letter-spacing: 0.08em; }
    .input-area { padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); }
}

/* Textos alternativos según dispositivo (se usan en el home) */
.solo-movil { display: none; }
@media (max-width: 600px) {
    .solo-escritorio { display: none; }
    .solo-movil { display: inline; }
}
