/* Espaciado global */
:root {
    --site-section-space-y: clamp(3.5rem, 4.5vw, 4rem);
    --site-section-space-y-mobile: 3.25rem;
    --site-section-space-y-small: 2.75rem;
    --site-header-height: 96px;
    --site-header-height-mobile: 64px;
    --site-inner-hero-height: 490px;
    --site-inner-hero-height-mobile: 420px;
    --site-inner-hero-height-small: 380px;
}

main {
    min-height: 48vh;
}

/* ============================================
   CONTENEDOR GLOBAL - Mismo ancho que el header en todas las páginas
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max-width, 1536px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

header .container,
main .container,
footer .container {
    /* Todos usan el mismo contenedor fluido sin max-width forzado */
}

main > section:first-child,
main > div:first-child {
    margin-top: 0;
}

main > section:first-child[class*="pt-"],
main > div:first-child[class*="pt-"] {
    padding-top: clamp(8.5rem, 10vw, 9.5rem) !important;
}

main > section:first-child[class*="pb-"],
main > div:first-child[class*="pb-"] {
    padding-bottom: clamp(4rem, 6vw, 5rem) !important;
}

/* Solo el hero del home tiene altura completa de pantalla */
.hero-bg.min-h-screen {
    min-height: 100vh !important;
}

main > section,
main > .hero-bg,
section[class*="py-5"],
section[class*="py-16"],
section[class*="py-20"],
.canales-section,
.paquetes-section,
.section-compatibilidad,
.section-dark-bg,
.tutorial-carousel-section,
#faq-section {
    padding-top: calc(var(--site-section-space-y) / 2) !important;
    padding-bottom: calc(var(--site-section-space-y) / 2) !important;
}

#virtudes,
#planes,
#canales,
#caracteristicas,
#dispositivos,
#preguntas-frecuentes,
#paquetes-adicionales,
#instalacion,
#tutoriales {
    padding-top: calc(var(--site-section-space-y) / 2) !important;
    padding-bottom: calc(var(--site-section-space-y) / 2) !important;
}

#tutoriales {
    padding-bottom: calc(var(--site-section-space-y) / 2) !important;
}

#tutoriales + #faq-section {
    padding-top: calc(var(--site-section-space-y) / 2) !important;
}

#canales {
    padding-bottom: calc(var(--site-section-space-y) / 2) !important;
}

#canales + #paquetes-adicionales {
    padding-top: calc(var(--site-section-space-y) / 2) !important;
}

#canales .canales-carruseles,
#canales .canales-carousel-container:last-child {
    margin-bottom: 0 !important;
}

.hero-bg {
    padding-top: max(var(--site-section-space-y), 6rem) !important;
    padding-bottom: var(--site-section-space-y) !important;
}

.hero-bg .hero-content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

main > section:first-child[style*="height: 700px"]:not(.hero-bg),
main > section:first-of-type[style*="height: 700px"]:not(.hero-bg),
.legal-hero,
.hero-soporte {
    height: auto !important;
    min-height: var(--site-inner-hero-height) !important;
    padding-top: var(--site-header-height) !important;
    padding-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box;
}

main > section:first-child[style*="height: 700px"]:not(.hero-bg) > .container,
main > section:first-of-type[style*="height: 700px"]:not(.hero-bg) > .container,
.legal-hero > .container,
.hero-soporte > .container {
    transform: none;
}

main > section:first-child[style*="height: 700px"]:not(.hero-bg) h1,
main > section:first-of-type[style*="height: 700px"]:not(.hero-bg) h1,
.legal-hero h1,
.hero-soporte h1,
.hero-soporte .hero-title {
    font-size: clamp(2.35rem, 4.2vw, 3.65rem) !important;
    line-height: 1.12 !important;
    overflow-wrap: break-word;
}

main > section:first-child[style*="height: 700px"]:not(.hero-bg) p,
main > section:first-of-type[style*="height: 700px"]:not(.hero-bg) p,
.legal-hero p,
.hero-soporte p,
.hero-soporte .hero-subtitle {
    max-width: 52rem !important;
}

section .mb-16 {
    margin-bottom: clamp(2.25rem, 4vw, 3.5rem) !important;
}

section .mb-12 {
    margin-bottom: clamp(2rem, 3vw, 3rem) !important;
}

.container > :last-child {
    margin-bottom: 0;
}

footer .container {
    padding-top: calc(var(--site-section-space-y) * 0.7) !important;
    padding-bottom: calc(var(--site-section-space-y) * 0.65) !important;
}

.site-compact-cta {
    padding: clamp(1.75rem, 3vw, 2.5rem) !important;
}

.site-compact-cta h2 {
    font-size: clamp(1.35rem, 2.4vw, 2rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 0.85rem !important;
}

.site-compact-cta p {
    font-size: clamp(0.9rem, 1.2vw, 1rem) !important;
    line-height: 1.55 !important;
    margin-bottom: 1.25rem !important;
}

.site-compact-cta .gradient-btn,
.site-compact-cta .btn-secondary {
    min-height: 42px !important;
    padding: 0.65rem 1.35rem !important;
    font-size: 0.875rem !important;
}

.caracteristicas-cta-section {
    padding-top: 1.5rem !important;
    padding-bottom: 3rem !important;
}

main .d-flex.align-items-start {
    min-width: 0;
}

main .d-flex.align-items-start > .material-icons:first-child {
    flex: 0 0 auto;
    line-height: 1;
    font-size: 1.2rem !important;
    margin-top: 0 !important;
    color: #CC04FF !important;
}

main .d-flex.align-items-start > .material-icons:first-child + div,
main .d-flex.align-items-start > .material-icons:first-child + span:not(.material-icons),
main .d-flex.align-items-start > .material-icons:first-child ~ .plan-feature-text {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
}

.responsive-info-list .d-flex.align-items-start > .material-icons {
    flex: 0 0 auto;
    line-height: 1;
}

.responsive-info-list .d-flex.align-items-start > div {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 480px) {
    .responsive-info-list .d-flex.align-items-start {
        flex-direction: column;
        align-items: center !important;
        text-align: center;
        gap: 0.75rem;
    }

    .responsive-info-list .d-flex.align-items-start > .material-icons {
        margin-right: 0 !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 768px) {
    /* Hero del home en mobile */
    .hero-bg.min-h-screen {
        min-height: 100vh !important;
    }

    main > section:first-child[class*="pt-"],
    main > div:first-child[class*="pt-"] {
        padding-top: 6.75rem !important;
    }

    main > section:first-child[class*="pb-"],
    main > div:first-child[class*="pb-"] {
        padding-bottom: 3rem !important;
    }

    /* Otras páginas en mobile - altura automática */
    main > section:first-child:not(.hero-bg),
    main > div:first-child:not(.hero-bg) {
        min-height: auto !important;
    }

    main > section,
    main > .hero-bg,
    section[class*="py-5"],
    section[class*="py-16"],
    section[class*="py-20"],
    .canales-section,
    .paquetes-section,
    .section-compatibilidad,
    .section-dark-bg,
    .tutorial-carousel-section,
    #faq-section {
        padding-top: calc(var(--site-section-space-y-mobile) / 2) !important;
        padding-bottom: calc(var(--site-section-space-y-mobile) / 2) !important;
    }

    #virtudes,
    #planes,
    #canales,
    #caracteristicas,
    #dispositivos,
    #preguntas-frecuentes,
    #paquetes-adicionales,
    #instalacion,
    #tutoriales {
        padding-top: calc(var(--site-section-space-y-mobile) / 2) !important;
        padding-bottom: calc(var(--site-section-space-y-mobile) / 2) !important;
    }

    #tutoriales {
        padding-bottom: calc(var(--site-section-space-y-mobile) / 2) !important;
    }

    #tutoriales + #faq-section {
        padding-top: calc(var(--site-section-space-y-mobile) / 2) !important;
    }

    #canales {
        padding-bottom: calc(var(--site-section-space-y-mobile) / 2) !important;
    }

    #canales + #paquetes-adicionales {
        padding-top: calc(var(--site-section-space-y-mobile) / 2) !important;
    }

    .hero-bg {
        padding-top: max(var(--site-section-space-y-mobile), 5.5rem) !important;
        padding-bottom: var(--site-section-space-y-mobile) !important;
    }

    main > section:first-child[style*="height: 700px"]:not(.hero-bg),
    main > section:first-of-type[style*="height: 700px"]:not(.hero-bg),
    .legal-hero,
    .hero-soporte {
        min-height: var(--site-inner-hero-height-mobile) !important;
        padding-top: var(--site-header-height-mobile) !important;
        padding-bottom: 0 !important;
    }

    main > section:first-child[style*="height: 700px"]:not(.hero-bg) > .container,
    main > section:first-of-type[style*="height: 700px"]:not(.hero-bg) > .container,
    .legal-hero > .container,
    .hero-soporte > .container {
        transform: none;
    }

    main > section:first-child[style*="height: 700px"]:not(.hero-bg) h1,
    main > section:first-of-type[style*="height: 700px"]:not(.hero-bg) h1,
    .legal-hero h1,
    .hero-soporte h1,
    .hero-soporte .hero-title {
        font-size: clamp(2rem, 7vw, 2.8rem) !important;
    }

    footer .container {
        padding-top: calc(var(--site-section-space-y-mobile) * 0.7) !important;
        padding-bottom: calc(var(--site-section-space-y-mobile) * 0.65) !important;
    }
}

@media (max-width: 480px) {
    /* Hero del home en pantallas pequeñas */
    .hero-bg.min-h-screen {
        min-height: 100vh !important;
    }

    main > section:first-child[class*="pt-"],
    main > div:first-child[class*="pt-"] {
        padding-top: 6.25rem !important;
    }

    main > section:first-child[class*="pb-"],
    main > div:first-child[class*="pb-"] {
        padding-bottom: 2.75rem !important;
    }

    main > section,
    main > .hero-bg,
    section[class*="py-5"],
    section[class*="py-16"],
    section[class*="py-20"],
    .canales-section,
    .paquetes-section,
    .section-compatibilidad,
    .section-dark-bg,
    .tutorial-carousel-section,
    #faq-section {
        padding-top: calc(var(--site-section-space-y-small) / 2) !important;
        padding-bottom: calc(var(--site-section-space-y-small) / 2) !important;
    }

    #virtudes,
    #planes,
    #canales,
    #caracteristicas,
    #dispositivos,
    #preguntas-frecuentes,
    #paquetes-adicionales,
    #instalacion,
    #tutoriales {
        padding-top: calc(var(--site-section-space-y-small) / 2) !important;
        padding-bottom: calc(var(--site-section-space-y-small) / 2) !important;
    }

    #tutoriales {
        padding-bottom: calc(var(--site-section-space-y-small) / 2) !important;
    }

    #tutoriales + #faq-section {
        padding-top: calc(var(--site-section-space-y-small) / 2) !important;
    }

    #canales {
        padding-bottom: calc(var(--site-section-space-y-small) / 2) !important;
    }

    #canales + #paquetes-adicionales {
        padding-top: calc(var(--site-section-space-y-small) / 2) !important;
    }

    .hero-bg {
        padding-top: max(var(--site-section-space-y-small), 5rem) !important;
        padding-bottom: var(--site-section-space-y-small) !important;
    }

    main > section:first-child[style*="height: 700px"]:not(.hero-bg),
    main > section:first-of-type[style*="height: 700px"]:not(.hero-bg),
    .legal-hero,
    .hero-soporte {
        min-height: var(--site-inner-hero-height-small) !important;
        padding-top: var(--site-header-height-mobile) !important;
        padding-bottom: 0 !important;
    }

    main > section:first-child[style*="height: 700px"]:not(.hero-bg) > .container,
    main > section:first-of-type[style*="height: 700px"]:not(.hero-bg) > .container,
    .legal-hero > .container,
    .hero-soporte > .container {
        transform: none;
    }

    main > section:first-child[style*="height: 700px"]:not(.hero-bg) h1,
    main > section:first-of-type[style*="height: 700px"]:not(.hero-bg) h1,
    .legal-hero h1,
    .hero-soporte h1,
    .hero-soporte .hero-title {
        font-size: clamp(1.85rem, 9vw, 2.45rem) !important;
    }

    footer .container {
        padding-top: calc(var(--site-section-space-y-small) * 0.7) !important;
        padding-bottom: calc(var(--site-section-space-y-small) * 0.65) !important;
    }
}

@media (max-width: 1024px) {
    main nav.d-flex.align-items-center.gap-2.small {
        flex-wrap: wrap;
        min-width: 0;
        row-gap: 0.35rem !important;
    }

    main nav.d-flex.align-items-center.gap-2.small > span:not(.material-icons):last-child {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 1024px) and (max-height: 430px) {
    main > section:first-child[style*="height: 700px"]:not(.hero-bg),
    main > section:first-of-type[style*="height: 700px"]:not(.hero-bg),
    .legal-hero,
    .hero-soporte {
        min-height: 100svh !important;
        padding-top: var(--site-header-height-mobile) !important;
        padding-bottom: 1rem !important;
        align-items: center !important;
    }

    main > section:first-child[style*="height: 700px"]:not(.hero-bg) h1,
    main > section:first-of-type[style*="height: 700px"]:not(.hero-bg) h1,
    .legal-hero h1,
    .hero-soporte h1,
    .hero-soporte .hero-title {
        font-size: 1.85rem !important;
        line-height: 1.15 !important;
        margin-bottom: 0.75rem !important;
    }

    main > section:first-child[style*="height: 700px"]:not(.hero-bg) p,
    main > section:first-of-type[style*="height: 700px"]:not(.hero-bg) p,
    .legal-hero p,
    .hero-soporte p,
    .hero-soporte .hero-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.45 !important;
    }

    .site-compact-cta {
        padding: 1.35rem !important;
    }

    .site-compact-cta .d-flex.justify-content-center {
        flex-wrap: wrap;
    }
}
