/* Responsive Design - Electric Loom */

/* Mobile First Approach */

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 768px) {
    
    /* Typography adjustments */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Container adjustments */
    .container {
        padding: 0 1rem;
    }
    
    /* Header - Mobile Navigation */
    .nav-container {
        position: relative;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: var(--spacing-xl);
        transition: left var(--transition-normal);
        box-shadow: var(--shadow-lg);
        gap: var(--spacing-lg);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* Hero Section */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-xl);
    }
    
    .hero-text h1 {
        font-size: 2.2rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn-primary,
    .hero-buttons .btn-secondary {
        width: 100%;
        max-width: 280px;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .service-card {
        padding: var(--spacing-lg);
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* Sustainability Grid */
    .sustainability-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Technology Section */
    .tech-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .tech-content .tech-image {
        order: -1;
    }
    
    /* Reviews Grid */
    .reviews-grid {
        grid-template-columns: 1fr;
    }
    
    /* Newsletter */
    .newsletter-form .form-group {
        flex-direction: column;
    }
    
    .newsletter-form input[type="email"] {
        margin-bottom: var(--spacing-sm);
    }
    
    /* Contact Section */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Cookie Banner */
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    .cookie-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cookie-buttons button {
        flex: 1;
        min-width: 120px;
    }
    
    /* Cookie Modal */
    .cookie-modal-content {
        width: 95%;
        padding: var(--spacing-lg);
        margin: var(--spacing-sm);
    }
    
    .cookie-modal-buttons {
        flex-direction: column;
    }
    
    /* Thank You Page */
    .thank-you-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .thank-you-actions .btn-primary,
    .thank-you-actions .btn-secondary {
        width: 100%;
        max-width: 280px;
    }
    
    /* Legal Content */
    .cookie-table {
        font-size: 0.8rem;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: var(--spacing-xs);
    }
    
    /* Hide table on very small screens, show as cards */
    .cookie-details {
        overflow-x: auto;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 992px) {
    
    /* Hero adjustments */
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* About Section */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Sustainability Grid */
    .sustainability-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Reviews Grid */
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1200px) {
    
    /* Fine-tune layouts for large screens */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .sustainability-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .reviews-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    
    /* Optimize for very large screens */
    .hero-text h1 {
        font-size: 3.5rem;
    }
    
    .container {
        max-width: 1400px;
    }
    
    /* Increase spacing on large screens */
    .hero {
        padding: calc(var(--spacing-2xl) * 1.5) 0;
    }
    
    .services,
    .about,
    .sustainability,
    .technology,
    .reviews,
    .newsletter,
    .contact {
        padding: calc(var(--spacing-2xl) * 1.2) 0;
    }
}

/* Height-based media queries for better mobile experience */
@media (max-height: 600px) and (orientation: landscape) {
    
    .hero {
        min-height: 100vh;
        padding: var(--spacing-lg) 0;
    }
    
    .nav-menu {
        height: calc(100vh - 60px);
        padding-top: var(--spacing-lg);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    
    /* Optimize for retina displays */
    .service-icon img,
    .tech-image img,
    .hero-image img,
    .about-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    
    .header,
    .cookie-banner,
    .cookie-modal,
    .newsletter,
    .footer {
        display: none;
    }
    
    .hero,
    .services,
    .about,
    .sustainability,
    .technology,
    .reviews,
    .contact,
    .legal-content {
        page-break-inside: avoid;
        background: white !important;
        color: black !important;
    }
    
    a {
        text-decoration: underline;
        color: black !important;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid black;
        background: white;
        color: black;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .service-card:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* Dark mode preferences */
@media (prefers-color-scheme: dark) {
    
    /* Note: This is optional since the site has a light theme */
    /* Users who prefer dark mode will still see the branded light theme */
    /* But we could add subtle adjustments for better accessibility */
    
    .cookie-banner {
        background-color: #1e293b;
    }
    
    .cookie-modal-content {
        background-color: #334155;
        color: white;
    }
}

/* Focus states for better accessibility */
@media (any-hover: none) {
    
    /* Touch devices - improve touch targets */
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: var(--spacing-sm);
    }
    
    .social-links a {
        width: 48px;
        height: 48px;
    }
    
    .cookie-buttons button {
        min-height: 44px;
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    
    .hero {
        min-height: auto;
        padding: var(--spacing-xl) 0;
    }
    
    .hero-content {
        gap: var(--spacing-lg);
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .services,
    .about,
    .sustainability,
    .technology,
    .reviews,
    .contact {
        padding: var(--spacing-xl) 0;
    }
}

/* Fix for iOS Safari viewport issues */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
}
