/* ================================
   RESPONSIVE BREAKPOINTS
   ================================ */

/* Tablet y móvil: menú hamburguesa */
@media (max-width: 992px) {
    /* Overlay oscuro al abrir el menú (debajo del header) */
    .nav-menu-overlay {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .nav-menu-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
    body.nav-menu-open {
        overflow: hidden;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: min(320px, 85vw);
        max-width: 100%;
        height: calc(100vh - 70px);
        height: calc(100dvh - 70px);
        background: var(--bg-primary);
        flex-direction: column;
        padding: 1.5rem 1.25rem;
        padding-top: calc(70px + 1rem);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        align-items: stretch;
        overflow-y: auto;
        z-index: 1001;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }

    /* Menú móvil: ítems con buen touch target y separación */
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-menu li:last-child {
        border-bottom: none;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 2px solid var(--border-color);
    }
    .nav-menu a {
        display: block;
        color: var(--text-primary) !important;
        padding: 1rem 1rem !important;
        min-height: 48px;
        height: auto;
        line-height: 1.4;
        border-radius: 8px;
        font-size: 1rem;
    }
    .nav-menu a:hover,
    .nav-menu a.active {
        color: var(--primary) !important;
        background: rgba(13, 148, 136, 0.08) !important;
    }
    .nav-menu a.btn-primary,
    .nav-menu a.nav-link-contacto,
    .header .nav-menu a.btn-primary,
    .header .nav-menu a.nav-link-contacto,
    .header.scrolled .nav-menu a.btn-primary,
    .header.scrolled .nav-menu a.nav-link-contacto {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 1rem 1.25rem !important;
        margin: 0;
        background: var(--primary) !important;
        color: #ffffff !important;
        font-weight: 700 !important;
    }
    .nav-menu a.btn-primary:hover,
    .nav-menu a.nav-link-contacto:hover,
    .header .nav-menu a.btn-primary:hover,
    .header .nav-menu a.nav-link-contacto:hover,
    .header.scrolled .nav-menu a.btn-primary:hover,
    .header.scrolled .nav-menu a.nav-link-contacto:hover {
        background: var(--primary-dark) !important;
        color: #ffffff !important;
        font-weight: 700 !important;
    }
    
    .mobile-menu-toggle {
        display: flex;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero {
        min-height: 70vh;
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    
    .section-title {
        font-size: var(--font-size-3xl);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .hero {
        min-height: 65vh;
        padding: var(--spacing-2xl) 0;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .cta-box {
        padding: var(--spacing-2xl);
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-cta .btn-primary,
    .hero-cta .btn-outline {
        width: 100%;
        text-align: center;
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .section-subtitle {
        font-size: var(--font-size-base);
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .modal-content {
        width: 95%;
    }
    
    .subscribe-form {
        flex-direction: column;
    }
    
    .subscribe-form input,
    .subscribe-form button {
        width: 100%;
    }

    /* Banner legal: apilar texto y botón en móvil */
    .legal-banner-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .legal-banner-text {
        min-width: 0;
    }
    .legal-banner-links {
        justify-content: center;
    }
    .legal-banner-actions {
        justify-content: center;
    }
    .legal-banner-actions .btn-legal-accept {
        width: 100%;
    }
}

/* Footer móvil: centrado, sin border-right, border-bottom entre secciones */
@media (max-width: 767px) {
    .footer .row.footer-cols {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer .footer-col {
        width: 100%;
        max-width: 100%;
        border-right: none !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    .footer .footer-col:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .footer .footer-col .footer-logo {
        margin-left: auto;
        margin-right: auto;
    }
    .footer .footer-col .contact-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer .footer-col .contact-info li {
        justify-content: center;
    }
    .footer .footer-col .subscribe-form {
        justify-content: center;
    }
    .footer .footer-col .subscribe-form.d-flex {
        flex-wrap: wrap;
        justify-content: center;
    }
    .footer .footer-col #footer-subscribe-form-wrap,
    .footer .footer-col #footer-subscribe-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .footer .footer-col .form-check-inline {
        justify-content: center;
    }
    .footer .footer-col .row:not(.footer-cols) {
        justify-content: center;
    }
    .footer .footer-col .row .col-md-6 {
        text-align: center;
    }
    .footer .footer-col .social-links {
        justify-content: center;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .logo img {
        height: 30px;
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
    }
}

/* Desktop Large */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}