/* ===================================
   CODIGET - RESPONSIVE DESIGN
   Media Queries y Adaptación Móvil
=================================== */

/* Extra Large Devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero h1 {
        font-size: 5rem;
    }
    
    .section-title h2 {
        font-size: 3.5rem;
    }
    
    .floating-phone {
        width: 350px;
        height: 700px;
        right: 5%;
    }
}

/* Large Devices (1200px and up) */
@media (min-width: 1200px) {
    .hero-content {
        padding-right: 2rem;
    }
    
    .service-card,
    .testimonial-card {
        padding: 3rem;
    }
    
    .contact-form {
        padding: 3rem;
    }
}

/* Medium Devices (992px and up) */
@media (min-width: 992px) {
    .navbar-nav .nav-link {
        margin: 0 1.5rem;
    }
    
    .hero .btn-group {
        justify-content: flex-start;
    }
    
    .process-step {
        margin-bottom: 2rem;
    }
}

/* Small Devices (768px and up) */
@media (min-width: 768px) {
    .section-padding {
        padding: 100px 0;
    }
    
    .section-title {
        margin-bottom: 60px;
    }
    
    .contact-info-item {
        margin-bottom: 2rem;
    }
    
    .footer {
        text-align: left;
    }
    
    .footer .row > div {
        margin-bottom: 2rem;
    }
}

/* Extra Small Devices (576px and up) */
@media (min-width: 576px) {
    .hero .btn-group {
        flex-direction: row;
    }
    
    .contact-form .row {
        margin: 0 -0.75rem;
    }
    
    .contact-form .row > div {
        padding: 0 0.75rem;
    }
}

/* Mobile First - Extra Small Devices (less than 576px) */
@media (max-width: 575.98px) {
    /* Typography */
    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 1.5rem;
        letter-spacing: -0.03em;
    }
    
    .section-title h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
        letter-spacing: -0.02em;
    }
    
    .section-title p {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    /* Spacing */
    .section-padding {
        padding: 60px 0;
    }
    
    .section-title {
        margin-bottom: 40px;
    }
    
    /* Navigation */
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    .navbar-nav {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        margin-top: 1rem;
        padding: 1rem;
        border-radius: var(--border-radius-lg);
    }
    
    .navbar-nav .nav-link {
        margin: 0.5rem 0;
        padding: 0.5rem 0;
        text-align: center;
    }
    
    /* Hero Section */
    .hero {
        padding: 100px 0 60px;
        text-align: center;
    }
    
    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero .btn-group {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .btn-primary-custom,
    .btn-outline-custom {
        width: 100%;
        max-width: 280px;
        padding: 15px 20px;
    }
    
    .floating-phone {
        display: none;
    }
    
    /* Cards */
    .service-card,
    .testimonial-card {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
        border-radius: var(--border-radius-2xl);
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
        border-radius: var(--border-radius-xl);
    }
    
    .service-card h4 {
        font-size: 1.5rem;
        font-weight: 800;
        margin-bottom: 1rem;
    }
    
    .service-card p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Portfolio */
    .portfolio-item {
        margin-bottom: 2rem;
    }
    
    .portfolio-item img {
        height: 250px;
    }
    
    .portfolio-overlay {
        padding: 2rem;
    }
    
    .portfolio-overlay h5 {
        font-size: 1.25rem;
    }
    
    /* Process */
    .process-step {
        margin-bottom: 3rem;
        padding: 2rem 1.5rem;
        border-radius: var(--border-radius-2xl);
    }
    
    .process-number {
        width: 80px;
        height: 80px;
        font-size: 2rem;
        margin-bottom: 1.5rem;
        border-radius: var(--border-radius-full);
    }
    
    .process-step h5 {
        font-size: 1.25rem;
        font-weight: 800;
        margin-bottom: 1rem;
    }
    
    .process-step p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Contact */
    .contact {
        padding: 60px 0;
    }
    
    .contact h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .contact-info-item {
        margin-bottom: 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .contact-info-item .icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
        width: auto;
    }
    
    .contact-form {
        padding: 2rem 1.5rem;
        margin-top: 2rem;
    }
    
    .contact-form h4 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .form-control {
        padding: 12px;
        margin-bottom: 1rem;
    }
    
    /* Footer */
    .footer {
        padding: 40px 0 20px;
        text-align: center;
    }
    
    .footer .row > div {
        margin-bottom: 2rem;
    }
    
    .footer-brand {
        font-size: 1.25rem;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .footer-bottom {
        margin-top: 2rem;
        padding-top: 1rem;
        text-align: center;
    }
    
    .footer-bottom .footer-links {
        margin-top: 1rem;
    }
    
    .footer-bottom .footer-links a {
        display: inline;
        margin-right: 1rem;
    }
}

/* Small Mobile Devices (less than 480px) */
@media (max-width: 479.98px) {
    /* Container */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Typography */
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    /* Hero */
    .hero p {
        font-size: 1rem;
    }
    
    /* Cards */
    .service-card,
    .testimonial-card {
        padding: 1.5rem 1rem;
    }
    
    .service-card h4 {
        font-size: 1.125rem;
    }
    
    /* Portfolio */
    .portfolio-overlay {
        padding: 1.5rem;
    }
    
    /* Contact */
    .contact-form {
        padding: 1.5rem 1rem;
    }
    
    .btn-primary-custom {
        padding: 12px 20px;
        font-size: 0.875rem;
    }
}

/* Landscape Mobile Devices */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 0 40px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .section-padding {
        padding: 60px 0;
    }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .service-icon,
    .process-number,
    .testimonial-avatar {
        background-size: contain;
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .service-card:hover,
    .testimonial-card:hover,
    .portfolio-item:hover {
        transform: none;
    }
    
    .navbar-nav .nav-link:hover::after {
        width: 0;
    }
    
    /* Make touch targets larger */
    .navbar-nav .nav-link {
        padding: 1rem 0;
    }
    
    .btn-primary-custom,
    .btn-outline-custom {
        min-height: 48px;
    }
    
    .social-links a {
        width: 48px;
        height: 48px;
    }
    
    /* Always show portfolio overlays on touch */
    .portfolio-overlay {
        opacity: 1;
        background: rgba(99, 102, 241, 0.8);
        position: static;
        padding: 1.5rem;
    }
    
    .portfolio-item img {
        height: 200px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-phone {
        animation: none;
    }
    
    .hero::before {
        animation: none;
    }
    
    .fade-in,
    .slide-in-left,
    .slide-in-right {
        opacity: 1;
        transform: none;
    }
}

/* Print Styles */
@media print {
    @page {
        margin: 1in;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .hero,
    .navbar,
    .footer,
    .contact,
    .floating-phone {
        display: none !important;
    }
    
    .section-padding {
        padding: 20pt 0;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000;
        page-break-after: avoid;
    }
    
    .service-card,
    .testimonial-card {
        border: 1pt solid #ccc;
        page-break-inside: avoid;
        margin-bottom: 10pt;
    }
    
    .portfolio-item {
        page-break-inside: avoid;
        margin-bottom: 10pt;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .btn-primary-custom,
    .btn-outline-custom {
        border: 1pt solid #000;
        background: none;
        color: #000;
        padding: 5pt 10pt;
        display: inline-block;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f9fafb;
        --text-light: #d1d5db;
        --bg-light: #1f2937;
        --bg-dark: #111827;
    }
    
    .navbar {
        background: rgba(31, 41, 55, 0.95);
    }
    
    .service-card,
    .testimonial-card {
        background: #374151;
        color: var(--text-dark);
    }
    
    .contact-form {
        background: rgba(0, 0, 0, 0.3);
    }
}

/* Container Queries (Future-proofing) */
@supports (container-type: inline-size) {
    .service-container {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .service-card {
            padding: 1rem;
        }
        
        .service-icon {
            width: 50px;
            height: 50px;
            font-size: 1.25rem;
        }
    }
}