/**
 * Home — UI/UX system (desktop + mobile).
 * Jerarquía visual, tipografía fluida, cards 2×2, CTAs 50/50.
 */

body.page-home {
    --home-text-xs: var(--cw-text-xs);
    --home-text-sm: var(--cw-text-sm);
    --home-text-base: var(--cw-text-base);
    --home-text-lg: var(--cw-text-lg);
    --home-title-section: var(--cw-title-section);
    --home-title-hero: var(--cw-title-hero);
    --home-gap-section: clamp(1.75rem, 3vw, 2.75rem);
    --home-gap-card: clamp(0.85rem, 1.2vw, 1.35rem);
}

/* ——— Tipografía y jerarquía ——— */
body.page-home .hero-title {
    font-size: var(--home-title-hero) !important;
    line-height: 1.15 !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0.55rem !important;
}

body.page-home .hero-copy-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0 0 1.1rem;
    max-width: min(36rem, 100%);
}

body.page-home .hero-brand-tagline {
    margin: 0;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: clamp(1rem, 1.15vw, 1.12rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
}

body.page-home .hero-subtitle {
    margin: 0 !important;
    max-width: 46ch;
    padding: 0;
    border: 0;
    background: none;
    font-size: clamp(0.95rem, 1.05vw, 1.05rem) !important;
    font-weight: 400 !important;
    letter-spacing: 0.01em !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.72) !important;
    text-transform: none;
}

body.page-home .badge {
    font-size: var(--home-text-xs) !important;
    padding: 0.55rem 1.1rem !important;
    margin-bottom: 0.75rem !important;
}

body.page-home .badge-mexico {
    font-size: var(--home-text-xs) !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
}

body.page-home .content-section {
    gap: 0;
}

body.page-home .cards-section--bridge,
body.page-home .cards-section--solutions {
    position: relative;
    z-index: 2;
    margin-top: clamp(0.5rem, 1.5vw, 1rem) !important;
    margin-bottom: clamp(0.75rem, 2vw, 1.25rem) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    padding: var(--home-gap-section) 0 calc(var(--home-gap-section) * 0.85) !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none;
    box-shadow: none;
    overflow: visible;
}

body.page-home .cards-section--solutions::before {
    display: none;
}

body.page-home .cards-section__eyebrow {
    display: block;
    width: fit-content;
    margin: 0 auto 0.85rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(0, 243, 255, 0.92);
    border: 1px solid rgba(0, 243, 255, 0.28);
    background: rgba(0, 243, 255, 0.07);
    box-shadow: 0 4px 18px rgba(0, 243, 255, 0.1);
}

body.page-home .cards-section--bridge .section-title {
    font-size: var(--home-title-section) !important;
    line-height: 1.18 !important;
    margin-bottom: 0.65rem !important;
    letter-spacing: 1px !important;
    position: relative;
}

body.page-home .cards-section--solutions .section-title::after {
    content: '';
    display: block;
    width: min(110px, 32%);
    height: 3px;
    margin: 0.8rem auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--neon-blue, #00f3ff), var(--neon-purple, #b967ff), transparent);
    opacity: 0.75;
}

body.page-home .cards-section .section-subtitle {
    font-size: var(--home-text-base) !important;
    line-height: 1.58 !important;
    color: rgba(255, 255, 255, 0.62) !important;
    margin: 0 auto 1.75rem !important;
    max-width: 54ch;
}

body.page-home .cards-scroll-hint {
    display: none;
}

/* ——— Cards: 6 servicios principales (3×2 en PC) ——— */
body.page-home .cards-container--quad {
    --card-svc-accent: var(--neon-blue, #00f3ff);
}

body.page-home .cards-container--rail {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: var(--home-gap-card) !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    overflow: visible !important;
}

/* PC / tablet ancha: 6 cards en 3×2 */
@media (min-width: 969px) {
    body.page-home .home-flow__services .cards-container.cards-container--rail.cards-container--quad,
    body.page-home .cards-container.cards-container--rail.cards-container--quad {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-auto-flow: row !important;
        grid-auto-rows: 1fr !important;
        gap: clamp(0.7rem, 1vw, 1.05rem) !important;
        width: 86% !important;
        max-width: min(1447px, 86%) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-items: stretch !important;
    }

    body.page-home .home-flow__services .cards-container--rail.cards-container--quad > .card-svc,
    body.page-home .cards-container--rail.cards-container--quad > .card-svc {
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
        grid-column: auto !important;
        grid-row: auto !important;
        min-height: 100%;
        display: flex;
        flex-direction: column;
    }

    body.page-home .cards-container--rail.cards-container--quad .card-content {
        flex: 1 1 auto;
    }

    body.page-home .cards-container--rail.cards-container--quad .card p {
        display: -webkit-box !important;
        -webkit-line-clamp: 5;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
    }
}

body.page-home .cards-container--rail > .card-svc {
    position: relative;
    isolation: isolate;
    min-height: auto !important;
    padding: clamp(1.15rem, 1.6vw, 1.55rem) clamp(0.95rem, 1.2vw, 1.2rem) clamp(1.1rem, 1.4vw, 1.35rem) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: border-color 0.22s ease, background 0.22s ease;
    overflow: hidden;
}

body.page-home .cards-container--rail > .card-svc::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--card-svc-accent),
        transparent
    );
    opacity: 0.7;
    z-index: 2;
}

body.page-home .card-svc__glow {
    display: none !important;
}

/* Acentos alineados al menú corporativo (home + landings MX) */
.card-svc--software { --card-svc-accent: #00f3ff; }
.card-svc--web { --card-svc-accent: #60a5fa; }
.card-svc--seo { --card-svc-accent: #34d399; }
.card-svc--shop { --card-svc-accent: #fbbf24; }
.card-svc--hosting { --card-svc-accent: #22d3ee; }
.card-svc--ia { --card-svc-accent: #c084fc; }

body.page-home .cards-container--rail > .card-svc:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--card-svc-accent) 32%, rgba(255, 255, 255, 0.12)) !important;
    background: color-mix(in srgb, var(--card-svc-accent) 6%, rgba(255, 255, 255, 0.035)) !important;
    box-shadow: none !important;
}

body.page-home .cards-container--rail > .card-svc:hover .card-svc__glow {
    transform: none;
    opacity: 0;
}

body.page-home .cards-container--rail .card-svc .card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 0.65rem;
}

body.page-home .cards-container--rail .card-svc__title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

body.page-home .cards-container--rail .card-svc .card-icon {
    width: clamp(40px, 3.2vw, 46px) !important;
    height: clamp(40px, 3.2vw, 46px) !important;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem) !important;
    border-radius: 10px !important;
    margin: 0 !important;
    flex-shrink: 0;
    color: var(--card-svc-accent) !important;
    background: color-mix(in srgb, var(--card-svc-accent) 10%, rgba(255, 255, 255, 0.03)) !important;
    border: 1px solid color-mix(in srgb, var(--card-svc-accent) 24%, rgba(255, 255, 255, 0.1)) !important;
    box-shadow: none !important;
}

body.page-home .cards-container--rail .card-svc__heading {
    min-width: 0;
    flex: 1 1 auto;
}

body.page-home .cards-container--rail .card-svc__tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 0.28rem;
    padding: 0.14rem 0.42rem;
    border-radius: 999px;
    font-family: Inter, 'Segoe UI', system-ui, sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--card-svc-accent) 78%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--card-svc-accent) 24%, transparent);
    background: color-mix(in srgb, var(--card-svc-accent) 8%, rgba(255, 255, 255, 0.03));
}

body.page-home .cards-container--rail .card-svc__heading h3,
body.page-home .cards-container--rail .card h3 {
    font-family: Inter, 'Segoe UI', system-ui, sans-serif !important;
    font-size: clamp(0.98rem, 1.05vw, 1.12rem) !important;
    font-weight: 650 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em !important;
    margin: 0 !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

body.page-home .cards-container--rail .card p {
    font-family: Inter, 'Segoe UI', system-ui, sans-serif !important;
    font-size: var(--home-text-sm) !important;
    line-height: 1.5 !important;
    margin: 0 0 0.35rem !important;
    color: rgba(255, 255, 255, 0.55) !important;
    display: block !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    flex: 1 1 auto;
}

body.page-home .cards-container--rail .card-svc__price {
    margin: 0.15rem 0 0.55rem !important;
    font-weight: 700 !important;
    font-size: 0.92rem !important;
    letter-spacing: -0.01em !important;
    color: color-mix(in srgb, var(--card-svc-accent, #00f3ff) 72%, #ffffff) !important;
}

body.page-home .cards-container--rail .card-button,
body.page-home .cards-container--rail .modern-button {
    font-family: Inter, 'Segoe UI', system-ui, sans-serif !important;
    font-size: clamp(0.78rem, 0.82vw, 0.88rem) !important;
    font-weight: 600 !important;
    padding: 0.55rem 0.75rem !important;
    min-height: 40px !important;
    letter-spacing: 0.02em;
    text-transform: none !important;
    margin-top: auto;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

body.page-home .cards-container--rail .card-svc:hover .card-button,
body.page-home .cards-container--rail .card-svc:hover .modern-button {
    background: color-mix(in srgb, var(--card-svc-accent) 10%, rgba(255, 255, 255, 0.04)) !important;
    border-color: color-mix(in srgb, var(--card-svc-accent) 28%, rgba(255, 255, 255, 0.12)) !important;
    box-shadow: none !important;
    color: #fff !important;
}

body.page-home .cards-container--rail .card-svc:hover .improved-icon {
    transform: none !important;
    border-color: color-mix(in srgb, var(--card-svc-accent) 36%, rgba(255, 255, 255, 0.12)) !important;
    box-shadow: none !important;
}

body.page-home .cards-container--rail .card-svc:hover .improved-icon i {
    color: var(--card-svc-accent) !important;
}

/* Pilares */
body.page-home .hero-pillars-band .hero-pillars-label {
    letter-spacing: 2px;
}

body.page-home .hero-pillars-band .feature-head h3,
body.page-home .hero-pillars-band .feature-text h3,
body.page-home .hero-pillars-band .feature-title-row h3 {
    font-size: 1.06rem;
}

body.page-home .hero-pillars-band .feature-desc,
body.page-home .hero-pillars-band .feature-text p {
    font-size: 0.9375rem;
    line-height: 1.55;
}

/* IA highlights 33/33/33 */
body.page-home .ia-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: var(--home-gap-card) !important;
}

body.page-home .ia-highlight h4 {
    font-size: var(--home-text-base);
}

body.page-home .ia-highlight p {
    font-size: var(--home-text-sm);
    line-height: 1.55;
}

/* ——— Escritorio: balance hero + 4 cards en fila ——— */
@media (min-width: 969px) {
    body.page-home .home-hero-zone {
        margin-top: 1.5rem;
    }

    body.page-home .content-section {
        padding: clamp(1.5rem, 2.5vw, 2.5rem) clamp(1.25rem, 3vw, 3rem);
        justify-content: center;
    }

    body.page-home .visual-section {
        padding: 3.5rem 3rem !important;
        min-height: clamp(520px, 48vh, 600px) !important;
    }

    body.page-home .cards-section--bridge .section-title,
    body.page-home .cards-section .section-subtitle,
    body.page-home .cards-section__eyebrow {
        text-align: center;
    }

    body.page-home .cards-section--bridge::after {
        display: none;
    }
}

@media (min-width: 1280px) {
    body.page-home .cards-container.cards-container--rail.cards-container--quad {
        gap: 0.95rem !important;
    }

    body.page-home .cards-container--rail.cards-container--quad > .card-svc {
        padding: 1.25rem 0.9rem 1.15rem !important;
    }
}

/* ——— Tablet / móvil ——— */
@media (max-width: 968px) {
    body.page-home {
        --home-shell-pad: 1rem;
        --home-mobile-x: 1rem;
        padding-top: 4.85rem;
    }

    body.page-home .home-hero-zone {
        margin-top: 0.2rem;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    body.page-home .home-intro-bridge {
        padding-left: var(--home-mobile-x, 1rem);
        padding-right: var(--home-mobile-x, 1rem);
    }

    body.page-home .content-section {
        padding: 0.35rem 0 0.25rem;
        align-items: flex-start;
    }

    body.page-home .hero-subtitle {
        max-width: 100%;
        margin-bottom: 0 !important;
    }

    body.page-home .hero-cta-stack,
    body.page-home .hero-trust,
    body.page-home .hero-proof-note {
        align-self: stretch;
        width: 100%;
        max-width: 100%;
    }

    body.page-home .visual-section {
        min-height: clamp(320px, 58vw, 420px) !important;
        max-height: none !important;
        padding: 1.25rem 0 1.85rem !important;
        margin-top: 0.7rem;
        margin-left: 0;
        margin-right: 0;
        overflow: hidden !important;
        max-width: 100%;
        border-radius: 20px;
        background:
            radial-gradient(ellipse 90% 80% at 50% 40%, rgba(0, 243, 255, 0.1) 0%, transparent 68%),
            radial-gradient(ellipse 60% 50% at 50% 55%, rgba(185, 103, 255, 0.07) 0%, transparent 70%);
    }

    body.page-home .cards-section--bridge,
    body.page-home .cards-section--solutions,
    body.page-home .home-flow__services {
        padding-left: var(--home-mobile-x, 1rem) !important;
        padding-right: var(--home-mobile-x, 1rem) !important;
    }

    body.page-home .cards-section--bridge .section-title,
    body.page-home .cards-section .section-subtitle,
    body.page-home .cards-section__eyebrow {
        margin-left: auto;
        margin-right: auto;
        max-width: none;
    }

    body.page-home .cards-section--solutions .section-title::after {
        margin-left: 0;
    }

    body.page-home .cards-scroll-hint {
        display: none !important;
    }

    body.page-home .cards-section--bridge,
    body.page-home .cards-section--solutions {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        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-intro-bridge::before {
        display: none !important;
    }

    body.page-home .cards-section--bridge {
        position: relative;
        overflow: visible;
    }

    body.page-home .cards-section--bridge::after {
        display: none;
    }

    body.page-home .cards-section--solutions::before {
        display: none;
    }

    /* Cards: grid fijo 2×2 (sin carrusel) */
    body.page-home .cards-container--rail {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-flow: row !important;
        gap: 0.65rem !important;
        overflow: visible !important;
        scroll-snap-type: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.page-home .cards-container--rail > .card-svc {
        flex: unset !important;
        min-width: 0 !important;
        width: auto !important;
        scroll-snap-align: unset;
        grid-column: auto !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body.page-home .cards-container--rail > .card-svc:nth-child(4) {
        grid-column: auto;
    }

    body.page-home .cards-container--rail .card-svc .card-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.95rem !important;
        border-radius: 11px !important;
    }

    body.page-home .cards-container--rail .card-svc__title-row {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    body.page-home .cards-container--rail .card-svc__tag {
        margin-bottom: 0.15rem;
        font-size: 0.55rem;
        padding: 0.15rem 0.4rem;
    }

    body.page-home .cards-container--rail .card-svc__heading h3,
    body.page-home .cards-container--rail .card h3 {
        font-size: var(--cw-title-card) !important;
        line-height: 1.3 !important;
        letter-spacing: 0 !important;
        background: none !important;
        -webkit-background-clip: unset !important;
        background-clip: unset !important;
        color: rgba(255, 255, 255, 0.96) !important;
    }

    body.page-home .cards-container--rail .card p {
        font-size: var(--cw-text-card) !important;
        display: block !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        overflow: visible !important;
        margin-bottom: 0.55rem !important;
    }

    body.page-home .cards-container--rail .card-button,
    body.page-home .cards-container--rail .modern-button {
        font-size: clamp(0.75rem, 2.6vw, 0.85rem) !important;
        padding: 0.55rem 0.75rem !important;
        min-height: var(--cw-btn-h-sm, 44px) !important;
    }

    body.page-home .hero-pillars-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    body.page-home .home-hero-zone {
        margin-top: 0;
    }

    body.page-home .content-section {
        padding: 0.35rem 0 0.25rem !important;
    }

    body.page-home .badge {
        margin-bottom: 0.45rem !important;
    }

    body.page-home .badge-mexico {
        margin-bottom: 0.55rem !important;
    }

    body.page-home .ia-highlights {
        gap: 0.5rem !important;
    }

    body.page-home .ia-highlight {
        padding: 0.85rem 0.55rem !important;
    }
}

/* Alinear módulo IA al mismo shell que demos / entregables */
body.page-home .ia-module {
    max-width: var(--home-shell-max, var(--cw-shell-wide, 1540px)) !important;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--home-shell-pad, var(--cw-shell-pad-x, 5%)) !important;
    padding-right: var(--home-shell-pad, var(--cw-shell-pad-x, 5%)) !important;
    box-sizing: border-box;
}

/* ——— Home flow: ritmo vertical continuo (sin rediseñar componentes) ——— */
body.page-home .home-flow {
    display: block;
    width: 100%;
}

body.page-home .home-flow__services.cards-section--solutions {
    margin-top: clamp(1.25rem, 3vw, 2rem) !important;
    margin-bottom: clamp(2rem, 5vw, 3.5rem) !important;
    padding-top: clamp(0.35rem, 1vw, 0.75rem) !important;
    padding-bottom: clamp(0.35rem, 1vw, 0.75rem) !important;
}

body.page-home .home-flow__benefits.services-section {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--home-shell-max, var(--cw-shell-wide, 1540px));
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
    padding-left: var(--home-shell-pad, var(--cw-shell-pad-x, 5%));
    padding-right: var(--home-shell-pad, var(--cw-shell-pad-x, 5%));
    box-sizing: border-box;
    background: transparent;
}

body.page-home .home-flow__proof {
    display: flex;
    flex-direction: column;
    gap: clamp(2.5rem, 5vw, 4rem);
    width: 100%;
    max-width: var(--home-shell-max, var(--cw-shell-wide, 1540px));
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
    padding: 0;
    box-sizing: border-box;
}

body.page-home .home-flow__deliver {
    width: 100%;
    max-width: var(--home-shell-max, var(--cw-shell-wide, 1540px));
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
    box-sizing: border-box;
}

body.page-home .home-flow__why {
    width: 100%;
    max-width: var(--home-shell-max, var(--cw-shell-wide, 1540px));
    margin: 0 auto clamp(2rem, 4vw, 3rem);
    box-sizing: border-box;
}

body.page-home .home-flow__tech {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 4vw, 3.25rem);
    width: 100%;
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
}

body.page-home .home-flow__trust {
    display: flex;
    flex-direction: column;
    gap: clamp(2.5rem, 5vw, 4rem);
    width: 100%;
    max-width: var(--home-shell-max, var(--cw-shell-wide, 1540px));
    margin: 0 auto clamp(2rem, 4vw, 3.25rem);
    padding: 0 var(--home-shell-pad, var(--cw-shell-pad-x, 5%));
    box-sizing: border-box;
}
