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

/* ==================== MOBILE (< 640px) ==================== */

@media (max-width: 639px) {
    /* Tipografía */
    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 28px;
    }

    h3 {
        font-size: 24px;
    }

    h4 {
        font-size: 20px;
    }

    /* Hero */
    .hero-section {
        min-height: 80vh;
        padding: var(--spacing-2xl) var(--spacing-md);
    }

    .hero-headline {
        font-size: 32px;
    }

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

    .hero-ctas {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    /* Navbar */
    .navbar {
        padding: var(--spacing-md);
    }

    .nav-menu-desktop {
        display: none;
    }

    .logo {
        font-size: var(--text-xl);
        gap: 6px;
    }

    .logo-circle {
        width: 18px;
        height: 18px;
    }

    .btn-primary-header {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--text-xs);
    }

    /* Menú Desplegable */
    .services-dropdown-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        padding: var(--spacing-lg);
    }

    .service-category {
        padding: var(--spacing-md) 0;
        border-bottom: 1px solid var(--color-medium-gray);
    }

    .service-category:last-child {
        border-bottom: none;
    }

    /* Secciones */
    .value-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Formularios */
    .cta-form-quick {
        flex-direction: column;
    }

    .form-input {
        width: 100%;
    }

    /* Botones */
    .cta-buttons {
        flex-direction: column;
    }

    .btn-primary-white,
    .btn-secondary-white {
        width: 100%;
    }

    /* Espaciado */
    .container-custom {
        padding: 0 var(--spacing-md);
    }

    /* Secciones */
    .value-proposition,
    .services-categories,
    .achievements,
    .testimonials,
    .blog-featured,
    .cta-primary,
    .footer {
        padding: var(--spacing-2xl) var(--spacing-md);
    }

    /* Cards */
    .card {
        padding: var(--spacing-lg);
    }

    /* Modales */
    .modal {
        width: 95%;
    }
}

/* ==================== TABLET (640px - 1023px) ==================== */

@media (min-width: 640px) and (max-width: 1023px) {
    /* Tipografía */
    h1 {
        font-size: 48px;
    }

    h2 {
        font-size: 40px;
    }

    h3 {
        font-size: 32px;
    }

    /* Hero */
    .hero-headline {
        font-size: 48px;
    }

    .hero-subheadline {
        font-size: var(--text-lg);
    }

    /* Navbar */
    .navbar {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    .nav-menu-desktop {
        display: none;
    }

    /* Menú Desplegable */
    .services-dropdown-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
        padding: var(--spacing-xl);
    }

    /* Grids */
    .value-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Botones */
    .cta-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    /* Espaciado */
    .container-custom {
        padding: 0 var(--spacing-lg);
    }

    /* Secciones */
    .value-proposition,
    .services-categories,
    .achievements,
    .testimonials,
    .blog-featured,
    .cta-primary,
    .footer {
        padding: var(--spacing-2xl) var(--spacing-lg);
    }

    /* Modales */
    .modal {
        width: 90%;
        max-width: 600px;
    }
}

/* ==================== DESKTOP (1024px+) ==================== */

@media (min-width: 1024px) {
    /* Navbar */
    .nav-menu-desktop {
        display: flex;
    }

    .mobile-menu-btn {
        display: none;
    }

    /* Menú Desplegable */
    .services-dropdown-content {
        grid-template-columns: repeat(6, 1fr);
        gap: var(--spacing-2xl);
        padding: var(--spacing-2xl);
    }

    /* Grids */
    .value-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Espaciado */
    .container-custom {
        padding: 0 var(--spacing-2xl);
    }

    /* Secciones */
    .value-proposition,
    .services-categories,
    .achievements,
    .testimonials,
    .blog-featured,
    .cta-primary,
    .footer {
        padding: var(--spacing-3xl) var(--spacing-2xl);
    }

    /* Modales */
    .modal {
        width: 90%;
        max-width: 600px;
    }
}

/* ==================== LARGE DESKTOP (1440px+) ==================== */

@media (min-width: 1440px) {
    .container-custom {
        max-width: 1400px;
    }

    /* Tipografía */
    h1 {
        font-size: 72px;
    }

    h2 {
        font-size: 56px;
    }

    /* Hero */
    .hero-headline {
        font-size: 72px;
    }

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

    /* Espaciado */
    .value-proposition,
    .services-categories,
    .achievements,
    .testimonials,
    .blog-featured,
    .cta-primary,
    .footer {
        padding: var(--spacing-3xl) 0;
    }
}

/* ==================== ORIENTACIÓN ==================== */

@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: 100vh;
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .hero-headline {
        font-size: 40px;
    }

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

    .scroll-hint {
        display: none;
    }
}

/* ==================== PANTALLAS PEQUEÑAS ==================== */

@media (max-width: 360px) {
    /* Tipografía */
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 20px;
    }

    /* Espaciado */
    .container-custom {
        padding: 0 var(--spacing-sm);
    }

    /* Secciones */
    .value-proposition,
    .services-categories,
    .achievements,
    .testimonials,
    .blog-featured,
    .cta-primary,
    .footer {
        padding: var(--spacing-xl) var(--spacing-sm);
    }

    /* Cards */
    .card {
        padding: var(--spacing-md);
    }

    /* Botones */
    .btn-primary,
    .btn-secondary,
    .btn-primary-header {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--text-xs);
    }

    /* Formularios */
    .form-input,
    .form-textarea,
    .form-select {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 16px; /* Previene zoom en iOS */
    }

    /* Logo */
    .logo {
        font-size: var(--text-lg);
    }

    .logo-circle {
        width: 16px;
        height: 16px;
    }
}

/* ==================== PANTALLAS GRANDES (4K) ==================== */

@media (min-width: 2560px) {
    .container-custom {
        max-width: 2000px;
    }

    /* Tipografía */
    h1 {
        font-size: 96px;
    }

    h2 {
        font-size: 72px;
    }

    h3 {
        font-size: 56px;
    }

    body {
        font-size: 18px;
    }

    /* Espaciado */
    .value-proposition,
    .services-categories,
    .achievements,
    .testimonials,
    .blog-featured,
    .cta-primary,
    .footer {
        padding: var(--spacing-3xl) var(--spacing-3xl);
    }

    /* Cards */
    .card {
        padding: var(--spacing-3xl);
    }
}

/* ==================== PRINT ==================== */

@media print {
    body {
        background-color: var(--color-white);
        color: var(--color-black);
    }

    .header-sticky,
    .footer,
    .scroll-hint,
    .btn-primary,
    .btn-secondary,
    .cta-buttons {
        display: none;
    }

    .container-custom {
        max-width: 100%;
    }

    a {
        text-decoration: underline;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    p {
        orphans: 3;
        widows: 3;
    }
}

/* ==================== PREFERENCIAS DE USUARIO ==================== */

/* Modo oscuro (si se implementa) */
@media (prefers-color-scheme: dark) {
    /* Los estilos aquí se aplicarían en modo oscuro */
    /* Por ahora mantenemos el tema claro */
}

/* Movimiento reducido */
@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;
    }
}

/* Alto contraste */
@media (prefers-contrast: more) {
    :root {
        --color-medium-gray: #999999;
        --color-dark-gray: #333333;
    }

    a {
        text-decoration: underline;
    }
}

/* Modo de alto contraste */
@media (prefers-contrast: less) {
    :root {
        --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.04);
        --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.08);
    }
}

/* ==================== BREAKPOINTS PERSONALIZADOS ==================== */

/* Extra pequeño */
@media (max-width: 480px) {
    .hero-section {
        min-height: 70vh;
    }

    .services-dropdown {
        max-height: 400px;
    }
}

/* Pequeño */
@media (min-width: 481px) and (max-width: 640px) {
    .hero-section {
        min-height: 75vh;
    }
}

/* Mediano */
@media (min-width: 641px) and (max-width: 1024px) {
    .services-dropdown {
        max-height: 450px;
    }
}

/* Grande */
@media (min-width: 1025px) and (max-width: 1440px) {
    .services-dropdown {
        max-height: 500px;
    }
}

/* Extra grande */
@media (min-width: 1441px) {
    .services-dropdown {
        max-height: 550px;
    }
}

/* ==================== DISPOSITIVOS ESPECÍFICOS ==================== */

/* iPhone */
@media (max-width: 480px) and (orientation: portrait) {
    .navbar {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .btn-primary-header {
        display: none;
    }
}

/* iPad */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* iPad Landscape */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
