/* ==========================================================
   RESPONSIVE.CSS - ZOIK AGENCY
   Versión optimizada, fluida y con layout móvil compacto
   ========================================================== */

/* ==========================================================
   1. BASE GLOBAL + FUENTES + PREVENCIÓN DE DESBORDES
   ========================================================== */
html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after {
    box-sizing: border-box;
    min-width: 0;
}

img, video, iframe, svg, canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================
   2. CHATBOT SIEMPRE FLOTANTE
   ========================================================== */
.chatbot-toggle,
#chatbotToggle {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    z-index: 999999 !important;
    cursor: pointer !important;
    border: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s ease !important;
}

.chatbot-toggle:hover,
#chatbotToggle:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 12px 30px rgba(50, 211, 255, 0.45) !important;
}

.chatbot-toggle img,
#chatbotToggle img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.chatbot-container,
#chatbotContainer {
    position: fixed !important;
    bottom: 100px !important;
    right: 24px !important;
    z-index: 999998 !important;
    width: 380px !important;
    max-width: calc(100vw - 32px) !important;
    height: 540px !important;
    max-height: calc(100vh - 140px) !important;
}

/* ==========================================================
   3. TABLETS (max-width: 1024px)
   ========================================================== */
@media screen and (max-width: 1024px) {

    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-inline: 20px !important;
    }

    section,
    .section {
        padding-block: 60px !important;
        padding-inline: 16px !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    .products__grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px !important;
    }
}

/* ==========================================================
   4. MÓVILES (max-width: 991px)
   ========================================================== */
@media screen and (max-width: 991px) {

    /* Header */
    header,
    .header,
    .header__wrapper {
        width: 100% !important;
        padding-inline: 16px !important;
    }

    .header__logo img,
    .header img[class*="logo"],
    [class*="logo"] img {
        max-width: 120px !important;
        height: auto !important;
    }

    .header__menu {
        display: none !important;
    }

    .header__toggle {
        display: flex !important;
    }

    /* Hero */
    .hero,
    section.hero {
        padding-top: 90px !important;
        padding-bottom: 40px !important;
        min-height: auto !important;
    }

    .hero__wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 24px !important;
    }

    .hero__title {
        font-size: clamp(1.9rem, 7vw, 2.5rem) !important;
        line-height: 1.15 !important;
    }

    .hero__astronaut,
    .hero img[class*="astronaut"],
    [class*="astronaut"] {
        max-width: 78% !important;
        margin-inline: auto !important;
    }

    /* Productos */
    .products__grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
    }

    .product-card,
    .products__grid > * {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Problema */
    .problem__wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
    }

    .problem__item {
        flex-direction: column !important;
        text-align: left !important;
        width: 100% !important;
    }

    .problem__image {
        max-width: 240px !important;
        margin-inline: auto !important;
    }

    .problem__glow {
        display: none !important;
    }

    /* Ecosistema - Formato Lista Compacta y Núcleo Reducido */
    .ecosystem__orbit,
    .ecosystem__connections {
        display: none !important;
    }

    .ecosystem__center {
        width: min(45vw, 140px) !important;
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        margin: 0 auto 10px !important;
        order: -1 !important;
    }

    .ecosystem__center-glow {
        width: 120% !important;
        height: 120% !important;
        filter: blur(14px) !important;
    }

    .ecosystem__center-ring {
        inset: -6px !important;
    }

    .ecosystem__wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
        padding-inline: 16px !important;
    }

    .ecosystem__node {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        width: 100% !important;
        max-width: 520px !important;
        gap: 16px !important;
        padding: 10px 14px !important;
        border-radius: 16px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }

    .ecosystem__node-circle {
        width: 46px !important;
        min-width: 46px !important;
        height: 46px !important;
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 4px 14px rgba(0, 30, 80, 0.15), inset 0 1px 1px #ffffff !important;
    }

    .ecosystem__node-circle img,
    .ecosystem__node-circle svg {
        width: 22px !important;
        height: 22px !important;
    }

    .ecosystem__node-inner {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 2px !important;
        width: 100% !important;
    }

    .ecosystem__name {
        font-size: 0.98rem !important;
        line-height: 1.25 !important;
        text-align: left !important;
    }

    .ecosystem__text {
        font-size: 0.82rem !important;
        line-height: 1.35 !important;
        text-align: left !important;
    }

    /* Metodología */
    .methodology__step {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        gap: 14px !important;
    }

    .methodology__number {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.15rem !important;
        margin-inline: auto !important;
    }

    /* About */
    .about__wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
        text-align: center !important;
    }

    .about__feature {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    /* CTA */
    .cta__container {
        display: flex !important;
        flex-direction: column !important;
        text-align: center !important;
        padding: 28px 16px !important;
    }

    /* Footer */
    .footer__wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 28px !important;
    }

    .footer__brand,
    .footer__column {
        width: 100% !important;
        text-align: left !important;
    }

    /* Chatbot en móvil */
    .chatbot-toggle,
    #chatbotToggle {
        bottom: 18px !important;
        right: 18px !important;
        width: 56px !important;
        height: 56px !important;
    }

    .chatbot-container,
    #chatbotContainer {
        width: 92vw !important;
        max-width: 92vw !important;
        height: 72vh !important;
        max-height: 560px !important;
        right: 4vw !important;
        left: 4vw !important;
        bottom: 90px !important;
        border-radius: 16px !important;
    }
}

/* ==========================================================
   5. TELÉFONOS PEQUEÑOS (max-width: 480px)
   ========================================================== */
@media screen and (max-width: 480px) {

    .hero__title {
        font-size: clamp(1.75rem, 8vw, 2.2rem) !important;
    }

    .chatbot-container,
    #chatbotContainer {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
    }
}

/* ==========================================================
   6. LANDSCAPE (móviles horizontales)
   ========================================================== */
@media screen and (max-height: 520px) and (orientation: landscape) {

    .header__menu {
        max-height: 75vh !important;
        overflow-y: auto !important;
        top: 55px !important;
    }

    .hero {
        padding-block: 70px 30px !important;
    }

    .chatbot-container,
    #chatbotContainer {
        height: 85vh !important;
        max-height: 85vh !important;
        bottom: 70px !important;
    }
}

/* ==========================================================
   7. ACCESIBILIDAD Y RENDIMIENTO
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

button,
.button,
a.button,
input,
textarea,
[role="button"] {
    pointer-events: auto !important;
    cursor: pointer !important;
}