/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Tablets y pantallas medianas (max-width: 1024px) */
@media (max-width: 1024px) {
    :root {
        --font-size-h1: 2rem;
        --font-size-h2: 1.75rem;
        --font-size-h3: 1.25rem;
    }

    .services-grid {
        /* Flexbox handles wrapping */
    }

    .service-item {
        flex: 0 1 calc(50% - var(--spacing-lg));
        /* 2 columns on tablet */
    }

    .slide-title {
        font-size: 2.5rem;
    }

    .slide-subtitle {
        font-size: 1.25rem;
    }
}

/* Tablets pequeñas (max-width: 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .section {
        padding: var(--spacing-lg) 0;
    }

    /* Header */
    .main-nav {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(170, 215, 210, 0.98);
        /* Cyan background matching navbar */
        flex-direction: column;
        justify-content: flex-start;
        padding: var(--spacing-md);
        transition: var(--transition-normal);
        box-shadow: var(--shadow-md);
        backdrop-filter: blur(10px);
    }

    .main-nav.active {
        left: 0;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-link {
        width: 100%;
        padding: var(--spacing-sm);
        border-bottom: 1px solid rgba(255, 255, 255, 0.5);
        color: var(--color-text-primary);
        /* Ensure dark text */
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Hero Slider */
    .hero-slider {
        height: 70vh;
        min-height: 500px;
    }

    .slide-title {
        font-size: 2rem;
    }

    .slide-subtitle {
        font-size: 1rem;
    }

    .slider-control {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    /* Grids */
    .section-grid,
    .confort-grid,
    .decision-content,
    .contacto-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .section-content {
        padding-right: 0;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--spacing-sm);
    }

    /* Confort */
    .confort-image {
        order: -1;
    }
}

/* Móviles (max-width: 480px) */
@media (max-width: 480px) {
    :root {
        --font-size-h1: 1.75rem;
        --font-size-h2: 1.5rem;
        --font-size-h3: 1.125rem;
        --spacing-xl: 2.5rem;
        --spacing-lg: 2rem;
    }

    .logo img {
        height: 50px;
    }

    .slide-title {
        font-size: 1.5rem;
    }

    .slide-subtitle {
        font-size: 0.875rem;
    }

    .services-grid {
        /* Flexbox handles this, but we ensure full width */
        gap: var(--spacing-md);
    }

    .service-item {
        flex: 0 1 100%;
        /* Full width on mobile */
    }

    .service-icon {
        width: 80px;
        height: 80px;
    }

    .service-icon img {
        width: 50px;
        height: 50px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .slider-control.prev {
        left: 10px;
    }

    .slider-control.next {
        right: 10px;
    }

    .scroll-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
        font-size: 1.25rem;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

/* Pantallas muy pequeñas (max-width: 360px) */
@media (max-width: 360px) {
    .container {
        padding: 0 var(--spacing-xs);
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.875rem;
    }
}

/* Landscape móvil */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slider {
        height: 100vh;
        min-height: auto;
    }

    .slide-content {
        top: 45%;
    }
}

/* Impresión */
@media print {

    .header,
    .mobile-menu-toggle,
    .slider-control,
    .slider-indicators,
    .scroll-top,
    .lightbox {
        display: none !important;
    }

    .section {
        page-break-inside: avoid;
    }
}