/* 7. css/responsive.css - Media queries */
/* ---------------------------------------- */

/* Ocultar el botón de cierre "X" por defecto (en desktop) */
.nav__close {
    display: none;
}

/* Tablet styles (max-width: 1024px) */
@media (max-width: 1024px) {
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 30rem;
        max-width: 80%;
        height: 100vh;
        background-color: var(--color-white);
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-base);
        z-index: var(--z-modal);
        overflow-y: auto;
        padding-top: var(--space-2xl);
    }
    
    .nav--active {
        right: 0;
    }
    
    .nav__toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 3rem;
        height: 3rem;
        justify-content: center;
        align-items: center;
        z-index: var(--z-sticky);
    }
    
    .nav__toggle span {
        width: 2.8rem;
        height: 3px;
        background-color: var(--color-secondary);
        transition: all var(--transition-base);
        border-radius: 2px;
    }

    /* Mostrar el botón de cierre "X" solo en modo responsivo */
    .nav__close {
        display: block;
        position: absolute;
        top: 1.5rem;
        right: 2.5rem;
        font-size: 3.5rem;
        color: var(--color-text-light);
        background: none;
        border: none;
        cursor: pointer;
    }
    
    .nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: var(--space-3xl) var(--space-lg);
    }
    
    .nav__item {
        width: 100%;
    }
    
    .nav__link {
        display: flex;
        justify-content: space-between;
        width: 100%;
        padding: var(--space-md);
        border-bottom: 1px solid var(--color-border);
    }
    
    .nav__link::after {
        display: none;
    }
    
    .nav__dropdown,
    .nav__subdropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0 0 0 var(--space-lg);
        background-color: var(--color-light-bg);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }
    
    .nav__item--dropdown.active > .nav__dropdown,
    .nav__item--subdropdown.active > .nav__subdropdown {
        max-height: 500px;
    }
    
    .nav__item--dropdown .nav__arrow {
        transition: transform var(--transition-base);
    }
    
    .nav__item--dropdown.active > .nav__link .nav__arrow {
        transform: rotate(180deg);
    }

    .hero__content {
        max-width: 80%;
    }
}

/* Mobile styles (max-width: 768px) */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    .top-bar__content {
        flex-direction: column;
        text-align: center;
    }
    
    .top-bar__info {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .hero__content {
        max-width: 100%;
        text-align: center;
        padding: 0 var(--container-padding);
    }

    .services-bar__text {
        white-space: normal;
        word-break: break-word;
        line-height: 1.6;
    }

    .services__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md); /* Espacio reducido para que quepa mejor */
    }

    .stats__grid {
        grid-template-columns: 1fr;
        gap: var(--space-3xl);
    }

    .newsletter__form {
        flex-direction: column;
    }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-3xl); /* Aumentamos el espacio entre secciones del footer */
        text-align: center; /* Centramos todo el texto */
    }

    .footer__contact-item {
        justify-content: center; /* Centramos los items de contacto */
    }

    .footer__social {
        justify-content: center; /* Centramos los iconos sociales */
    }
    
    .mobile-only {
        display: flex;
    }

    .whatsapp-btn {
        right: 3rem;
        bottom: 2rem;
    }
    
    .scroll-top {
        bottom: 8rem;
        right: 3rem;
    }
}

/* Small mobile styles (max-width: 480px) */
@media (max-width: 480px) {
    :root {
        --container-padding: 1.5rem;
    }

    .hero__title {
        font-size: var(--text-2xl);
    }

    .hero__subtitle {
        font-size: var(--text-base);
    }

    .section {
        padding: var(--space-3xl) 0;
    }
}
