/**
 * Home — mejoras móvil (≤968px)
 * Carga al final del head en index.php.
 */

@media (max-width: 968px) {
    body.page-home {
        --home-mobile-x: 1rem;
        --home-shell-pad: 1rem;
        --hs-pad: 1rem;
        overflow-x: hidden;
    }

    /* Misma columna: banner y soluciones usan solo --home-mobile-x */
    body.page-home .home-intro-bridge {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-left: var(--home-mobile-x) !important;
        padding-right: var(--home-mobile-x) !important;
        box-sizing: border-box;
    }

    body.page-home .home-hero-zone {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0.15rem !important;
        margin-bottom: 0.5rem !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
    }

    body.page-home .home-hero-zone .container {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
    }

    body.page-home .home-hero-zone .content-section {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0.35rem 0 0.25rem !important;
        text-align: left;
        align-items: stretch !important;
        box-sizing: border-box;
    }

    body.page-home .home-hero-zone .visual-section {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    body.page-home .home-flow__services,
    body.page-home .home-flow__services.cards-section--bridge,
    body.page-home .home-flow__services.cards-section--solutions,
    body.page-home .cards-section--bridge,
    body.page-home .cards-section--solutions {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: var(--home-mobile-x) !important;
        padding-right: var(--home-mobile-x) !important;
        box-sizing: border-box !important;
        /* Misma atmósfera que el resto: sin caja / panel cortado */
        background: transparent !important;
        background-image: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    body.page-home .home-flow__services.cards-section--solutions {
        margin-top: 1.35rem !important;
        margin-bottom: 1.5rem !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        position: relative;
        z-index: 1;
    }

    body.page-home .cards-section--bridge::after,
    body.page-home .cards-section--solutions::before,
    body.page-home .home-intro-bridge::before {
        display: none !important;
        content: none !important;
    }

    body.page-home .cards-container--rail .card p {
        display: block !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        overflow: visible !important;
    }

    body.page-home .cards-section__eyebrow,
    body.page-home .cards-section--bridge .section-title,
    body.page-home .cards-section .section-subtitle,
    body.page-home .cards-container--rail {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: none !important;
        width: 100%;
        box-sizing: border-box;
    }

    body.page-home .visual-section {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

    /* Hero más corto y legible */
    body.page-home .hero-title {
        font-size: clamp(1.7rem, 7.2vw, 2.15rem) !important;
        line-height: 1.18 !important;
        letter-spacing: 0.2px !important;
        margin-bottom: 0.55rem !important;
        text-wrap: balance;
    }

    body.page-home .hero-brand-tagline {
        font-size: 0.92rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.65rem !important;
        max-width: 34ch;
    }

    body.page-home .badge {
        align-self: flex-start;
        font-size: 0.72rem !important;
        padding: 0.42rem 0.8rem !important;
        margin-bottom: 0.55rem !important;
    }

    body.page-home .badge-mexico {
        display: inline-flex;
        margin-bottom: 0.55rem !important;
        font-size: 0.7rem !important;
        padding: 0.38rem 0.75rem !important;
    }

    body.page-home .hero-subtitle {
        font-size: 0.98rem !important;
        line-height: 1.55 !important;
        margin-bottom: 1rem !important;
        max-width: 40ch;
    }

    /* CTA principal: WhatsApp a ancho completo */
    body.page-home .hero-cta-stack {
        width: 100%;
        gap: 0.75rem !important;
        margin-bottom: 0.95rem !important;
    }

    body.page-home .hero-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.55rem !important;
        width: 100%;
    }

    body.page-home .hero-btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        font-size: 0.92rem !important;
        padding: 0.85rem 1rem !important;
        border-radius: 14px;
    }

    body.page-home .hero-btn--primary {
        order: -1;
        box-shadow: 0 10px 28px rgba(37, 211, 102, 0.28);
    }

    body.page-home .hero-showcase-cta {
        width: 100%;
        border-radius: 16px;
        min-height: 64px;
    }

    body.page-home .hero-showcase-cta__copy strong {
        font-size: 0.9rem;
        line-height: 1.25;
    }

    body.page-home .hero-showcase-cta__copy span {
        font-size: 0.75rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Trust chips: una sola fila cómoda */
    body.page-home .hero-trust {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 0.4rem !important;
        width: 100%;
        margin: 0.2rem 0 0.75rem !important;
    }

    body.page-home .hero-trust__item {
        padding: 0.65rem 0.3rem !important;
        border-radius: 12px !important;
        min-height: 76px;
    }

    body.page-home .hero-trust__copy span {
        max-width: none !important;
        font-size: 0.62rem !important;
        line-height: 1.25 !important;
    }

    body.page-home .hero-proof-note {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
        margin-top: 0.15rem !important;
    }

    /* Nexus completo: más altura para que el brillo no se corte */
    body.page-home .home-hero-zone,
    body.page-home .home-hero-zone .container {
        overflow: visible !important;
    }

    body.page-home .visual-section,
    body.page-home .home-hero-zone .visual-section {
        min-height: clamp(300px, 72vw, 420px) !important;
        max-height: none !important;
        height: auto !important;
        padding: 1.25rem 0 1.75rem !important;
        margin-top: 0.35rem !important;
        margin-bottom: 0.85rem !important;
        overflow: visible !important;
        position: relative;
        z-index: 2;
    }

    body.page-home .visual-section .nexus-system {
        overflow: visible !important;
        width: 100%;
        min-height: inherit;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    body.page-home .quantum-orb {
        width: clamp(220px, 62vw, 340px) !important;
        height: clamp(220px, 62vw, 340px) !important;
    }

    body.page-home .quantum-orb .ring-1 { width: 300px !important; height: 300px !important; }
    body.page-home .quantum-orb .ring-2 { width: 265px !important; height: 265px !important; }
    body.page-home .quantum-orb .ring-3 { width: 230px !important; height: 230px !important; }
    body.page-home .quantum-orb .core-outer { width: 250px !important; height: 250px !important; }
    body.page-home .quantum-orb .core-middle { width: 175px !important; height: 175px !important; }
    body.page-home .quantum-orb .core-inner { width: 100px !important; height: 100px !important; }

    /* Servicios: tipografía del encabezado (sin solapamiento) */
    body.page-home .cards-section--bridge .section-title,
    body.page-home .home-flow__services .section-title {
        font-size: clamp(1.35rem, 5.4vw, 1.7rem) !important;
        line-height: 1.3 !important;
        letter-spacing: 0.5px !important;
        margin: 0 0 0.55rem !important;
        padding: 0 !important;
        text-align: left !important;
        max-width: 100% !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    body.page-home .cards-section .section-subtitle,
    body.page-home .home-flow__services .section-subtitle {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin: 0 0 1.1rem !important;
        text-align: left !important;
        max-width: 100% !important;
    }

    body.page-home .cards-section__eyebrow,
    body.page-home .home-flow__services .cards-section__eyebrow {
        display: block !important;
        margin: 0 0 0.5rem !important;
        text-align: left !important;
        letter-spacing: 0.1em !important;
        line-height: 1.3 !important;
    }

    /* Cards: título + icono sin encimarse en grid 2×2 */
    body.page-home .cards-container--rail .card-svc__title-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.55rem !important;
        width: 100%;
        min-width: 0;
    }

    body.page-home .cards-container--rail .card-svc .card-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
        margin: 0 !important;
        flex-shrink: 0;
        position: relative !important;
        z-index: 1;
    }

    body.page-home .cards-container--rail .card-svc__heading {
        width: 100%;
        min-width: 0;
    }

    body.page-home .cards-container--rail .card-svc__tag {
        margin-bottom: 0.25rem !important;
        font-size: 0.55rem !important;
        padding: 0.12rem 0.4rem !important;
        line-height: 1.2 !important;
    }

    body.page-home .cards-container--rail .card-svc__heading h3,
    body.page-home .cards-container--rail .card h3 {
        font-family: Inter, system-ui, sans-serif !important;
        font-size: clamp(0.82rem, 3.1vw, 0.95rem) !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        letter-spacing: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        color: rgba(255, 255, 255, 0.96) !important;
        background: none !important;
        -webkit-background-clip: unset !important;
        background-clip: unset !important;
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }

    body.page-home .cards-container--rail .card-svc .card-content {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        gap: 0.55rem !important;
        min-width: 0;
    }

    body.page-home .cards-container--rail .card p {
        font-size: clamp(0.74rem, 2.7vw, 0.84rem) !important;
        line-height: 1.45 !important;
        margin: 0 0 0.35rem !important;
        overflow-wrap: anywhere;
    }

    body.page-home .cards-container--rail > .card-svc {
        display: flex !important;
        flex-direction: column !important;
        min-height: 100%;
        border-radius: 16px !important;
        overflow: visible !important;
    }

    body.page-home .cards-container--rail .card-button,
    body.page-home .cards-container--rail .modern-button {
        margin-top: auto;
        min-height: 42px !important;
        font-size: 0.68rem !important;
        padding: 0.5rem 0.55rem !important;
        border-radius: 999px !important;
        letter-spacing: 0.04em !important;
        white-space: normal !important;
        line-height: 1.25 !important;
        text-align: center;
    }

    body.page-home .home-flow__why,
    body.page-home .home-flow__deliver,
    body.page-home .home-flow__benefits {
        padding-left: var(--home-mobile-x) !important;
        padding-right: var(--home-mobile-x) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    body.page-home .home-flow__trust {
        padding-left: var(--home-mobile-x) !important;
        padding-right: var(--home-mobile-x) !important;
    }
}

/* ——— Teléfonos chicos: hero (soluciones siguen 2×2) ——— */
@media (max-width: 560px) {
    body.page-home .cards-container--rail {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.6rem !important;
    }

    body.page-home .cards-container--rail > .card-svc {
        padding: 0.9rem 0.7rem !important;
    }

    body.page-home .badge-mexico {
        display: none !important;
    }

    body.page-home .hero-proof-note {
        display: none !important;
    }

    body.page-home .hero-showcase-cta__arrow {
        display: none;
    }

    body.page-home .visual-section,
    body.page-home .home-hero-zone .visual-section {
        min-height: clamp(280px, 78vw, 380px) !important;
        max-height: none !important;
        padding: 1.1rem 0 1.5rem !important;
    }

    body.page-home .quantum-orb {
        width: clamp(200px, 58vw, 300px) !important;
        height: clamp(200px, 58vw, 300px) !important;
    }

    body.page-home .quantum-orb .ring-1 { width: 270px !important; height: 270px !important; }
    body.page-home .quantum-orb .ring-2 { width: 240px !important; height: 240px !important; }
    body.page-home .quantum-orb .ring-3 { width: 210px !important; height: 210px !important; }
    body.page-home .quantum-orb .core-outer { width: 220px !important; height: 220px !important; }
    body.page-home .quantum-orb .core-middle { width: 155px !important; height: 155px !important; }
    body.page-home .quantum-orb .core-inner { width: 88px !important; height: 88px !important; }
}

@media (max-width: 400px) {
    body.page-home .hero-trust__item {
        min-height: 70px;
        padding: 0.55rem 0.2rem !important;
    }

    body.page-home .hero-trust__icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.76rem !important;
    }

    body.page-home .hero-trust__copy strong {
        font-size: 0.88rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.page-home .hero-btn--primary {
        box-shadow: none;
    }
}
