/* ============================================
   RESPONSIVE - Media Queries
   ============================================ */

/* ---------- TABLET GRANDE / LAPTOP PEQUEÑA (max 1024px) ---------- */
@media (max-width: 1024px) {
    :root {
        --header-height: 72px;
    }

    .container {
        padding: 0 20px;
    }

    .hero__container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero__image {
        order: -1;
        max-width: 400px;
        margin: 0 auto;
    }

    .hero__image-placeholder {
        max-width: 320px;
    }

    .about__container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about__image {
        max-width: 400px;
        margin: 0 auto;
    }

    .contact__container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer__container {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .support-strip__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* ---------- TABLET (max 900px) ---------- */
@media (max-width: 900px) {

    /* ===== HEADER ===== */
    .header {
        z-index: 1000;
    }

    /* Ocultar CTA del header en móvil */
    .header__cta {
        display: none !important;
    }

    /* ===== MENÚ HAMBURGUESA (botón) ===== */
    .menu-toggle {
        display: flex;
        position: relative;
        z-index: 1200; /* Por encima de TODO */
    }

    /* ===== NAV LATERAL ===== */
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        height: 100dvh;
        background-color: #FFFFFF;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
        padding: calc(var(--header-height) + 30px) 28px 40px;
        transition: right 0.35s ease;
        z-index: 1150;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* ✅ FORZAR visibility siempre visible */
        visibility: visible !important;
        display: block !important;
        opacity: 1 !important;
    }

    .nav--open {
        right: 0 !important;
        visibility: visible !important;
        display: block !important;
        opacity: 1 !important;
    }

    .nav__list {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .nav__link {
        display: block;
        padding: 16px 18px;
        font-size: 1.05rem;
        font-weight: 500;
        color: var(--dark);
        border-radius: var(--radius-sm);
        transition: background-color 0.2s ease, color 0.2s ease;
        /* ✅ Asegurar clic */
        position: relative;
        z-index: 1;
        cursor: pointer;
        pointer-events: auto;
    }

    .nav__link:hover,
    .nav__link:active {
        color: var(--primary);
        background-color: var(--primary-soft);
    }

    .nav__link--active {
        color: var(--primary);
        font-weight: 600;
        background-color: var(--primary-soft);
    }

    /* ===== OVERLAY (fondo oscuro) ===== */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 900; /* ✅ CAMBIO: MENOR que el header (1000) */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
    }

    .nav-overlay--active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* ===== BODY ===== */
    body {
        padding-bottom: 60px;
    }

    /* ===== BOTÓN FLOTANTE WHATSAPP ===== */
    .float-whatsapp {
        bottom: 80px;
        right: 16px;
        width: 54px;
        height: 54px;
        z-index: 800; /* ✅ CAMBIO */
    }

    /* ===== BARRA MÓVIL INFERIOR ===== */
    .mobile-bar {
        display: flex;
        z-index: 1000;
    }

    /* ===== SECCIONES ===== */
    .section {
        padding: 60px 0;
    }

    .section__header {
        margin-bottom: 40px;
    }

    .page-hero {
        padding: calc(var(--header-height) + 40px) 0 40px;
    }
}

/* ---------- MÓVIL (max 640px) ---------- */
@media (max-width: 640px) {
    :root {
        --header-height: 64px;
    }

    .container {
        padding: 0 16px;
    }

    .header__logo-img {
        height: 40px;
    }

    .section {
        padding: 48px 0;
    }

    .section__title {
        font-size: 1.6rem;
    }

    .section__text {
        font-size: 1rem;
    }

    .hero {
        padding: calc(var(--header-height) + 40px) 0 60px;
    }

    .hero__title {
        font-size: 1.5rem;
    }

    .hero__text {
        font-size: 1rem;
    }

    .hero__buttons {
        flex-direction: column;
    }

    .hero__buttons .btn {
        width: 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }

    .support-strip {
        padding: 32px 0;
    }

    .support-strip__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .support-strip__icon {
        width: 56px;
        height: 56px;
    }

    .support-strip__title {
        font-size: 1.05rem;
    }

    .problem__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 24px 20px;
    }

    .solution__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .solution__step {
        padding: 32px 20px;
    }

    .check-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .check-list__item {
        font-size: 0.95rem;
        padding: 14px 16px 14px 52px;
    }

    .modalities__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .modality {
        padding: 32px 24px;
    }

    .modality__title {
        font-size: 1.2rem;
    }

    .about__badges {
        gap: 8px;
    }

    .badge {
        font-size: 0.8rem;
        padding: 6px 14px;
    }

    .how__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .how__step {
        padding: 24px 16px;
    }

    .cta-intermediate {
        padding: 60px 0;
    }

    .cta-intermediate__buttons {
        flex-direction: column;
    }

    .cta-intermediate__buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .accordion__header {
        padding: 18px 20px;
        font-size: 0.95rem;
    }

    .accordion__item--active .accordion__content {
        padding: 0 20px 20px;
    }

    .form {
        padding: 24px 20px;
    }

    .form__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cta-final {
        padding: 48px 0;
    }

    .cta-final__buttons {
        flex-direction: column;
    }

    .cta-final__buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .footer {
        padding: 48px 0 0;
    }

    .footer__container {
        grid-template-columns: 1fr;
        gap: 32px;
        padding-bottom: 32px;
    }

    .footer__buttons {
        flex-direction: column;
    }

    .footer__bottom {
        padding: 20px 0;
    }

    .footer__legal {
        font-size: 0.8rem;
    }

    .legal-content h2 {
        font-size: 1.15rem;
    }

    .legal-content p,
    .legal-content li {
        font-size: 0.95rem;
    }

    .page-hero__title {
        font-size: 1.5rem;
    }

    .page-hero__text {
        font-size: 1rem;
    }

    .float-whatsapp {
        bottom: 76px;
        right: 14px;
        width: 50px;
        height: 50px;
    }

    .mobile-bar__btn {
        font-size: 0.85rem;
        padding: 14px 8px;
    }
}

/* ---------- MÓVIL PEQUEÑO (max 380px) ---------- */
@media (max-width: 380px) {
    .header__logo-img {
        height: 34px;
    }

    .hero__title {
        font-size: 1.35rem;
    }

    .section__title {
        font-size: 1.4rem;
    }

    .solution__number {
        font-size: 2.4rem;
    }

    .modality {
        padding: 24px 16px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .mobile-bar__btn {
        font-size: 0.8rem;
        gap: 6px;
    }
}

/* ---------- DESKTOP GRANDE (min 1400px) ---------- */
@media (min-width: 1400px) {
    :root {
        --container-width: 1280px;
    }
}

/* ---------- REDUCIR MOVIMIENTO ---------- */
@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;
    }
}

/* ---------- PRINT ---------- */
@media print {
    .header,
    .float-whatsapp,
    .mobile-bar,
    .cta-intermediate,
    .cta-final,
    .footer__buttons {
        display: none !important;
    }

    body {
        padding-bottom: 0;
    }

    .section {
        padding: 20px 0;
        page-break-inside: avoid;
    }
}