/* Responsive Design - Mobile First Approach */

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 767.98px) {
    /* Typography adjustments */
    :root {
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.5rem;
        --spacing-20: 3rem;
        --spacing-16: 2.5rem;
        --spacing-12: 2rem;
    }

    /* Header mobile styles */
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--white);
        border-bottom: var(--border-width) solid var(--neutral-200);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
        z-index: 999;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        padding: var(--spacing-6);
        gap: var(--spacing-4);
    }

    .nav-link {
        padding: var(--spacing-3) 0;
        font-size: var(--font-size-lg);
        border-bottom: var(--border-width) solid var(--neutral-200);
        width: 100%;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Hero section mobile */
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-8);
        text-align: center;
    }

    .hero-text {
        order: 2;
    }

    .hero-image {
        order: 1;
    }

    .hero-image svg {
        max-width: 300px;
        height: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    /* About section mobile */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-8);
        text-align: center;
    }

    .about-image {
        order: 1;
    }

    .about-text {
        order: 2;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-6);
    }

    /* Services grid mobile */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: var(--spacing-6);
    }

    /* Products grid mobile */
    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Reviews grid mobile */
    .reviews-grid {
        grid-template-columns: 1fr;
    }

    /* Contact section mobile */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-8);
    }

    .contact-info {
        order: 2;
    }

    .contact-form {
        order: 1;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Newsletter mobile */
    .newsletter-form .form-group {
        flex-direction: column;
        max-width: 100%;
    }

    .newsletter-form input {
        margin-bottom: var(--spacing-4);
    }

    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-8);
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom-content {
        text-align: center;
    }

    /* Cookie banner mobile */
    .cookie-banner {
        padding: var(--spacing-4);
    }

    .cookie-buttons {
        flex-direction: column;
        gap: var(--spacing-3);
    }

    .cookie-buttons .btn {
        width: 100%;
    }

    /* Legal pages mobile */
    .legal-header,
    .legal-content {
        padding: 0 var(--spacing-4);
    }

    .cookie-table {
        font-size: var(--font-size-sm);
    }

    .cookie-table th,
    .cookie-table td {
        padding: var(--spacing-2);
    }

    /* Thank you page mobile */
    .thank-you-icon svg {
        width: 80px;
        height: 80px;
    }

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

    .steps-list {
        text-align: center;
    }

    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--spacing-3);
    }

    .thank-you-actions {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-3);
        align-items: center;
    }

    .thank-you-actions .btn {
        width: 100%;
        max-width: 280px;
        margin: 0;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Hero section tablet */
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-12);
        text-align: center;
    }

    .hero-image svg {
        max-width: 400px;
        height: auto;
    }

    /* About section tablet */
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-12);
        text-align: center;
    }

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

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

    /* Products grid tablet */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Reviews grid tablet */
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact section tablet */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-12);
    }

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

    /* Newsletter tablet */
    .newsletter-form .form-group {
        max-width: 500px;
    }

    /* Legal pages tablet */
    .expectations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    /* Ensure proper grid layouts for large screens */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

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

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

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

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        padding: 0 var(--spacing-6);
    }

    /* Increase spacing for very large screens */
    :root {
        --spacing-20: 6rem;
        --spacing-16: 4.5rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp graphics on high DPI displays */
    .image-placeholder svg,
    .hero-image svg,
    .about-image svg,
    .product-image svg {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion preferences */
@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;
    }
}

/* Dark mode support (if system preference is dark) */
@media (prefers-color-scheme: dark) {
    /* Note: This is a basic dark mode implementation */
    /* For production, you might want a more comprehensive dark mode */
    .image-placeholder {
        background-color: var(--neutral-800);
        border-color: var(--neutral-700);
        color: var(--neutral-400);
    }
}

/* Print styles */
@media print {
    /* Hide non-essential elements when printing */
    .header,
    .nav-toggle,
    .cookie-banner,
    .cookie-modal,
    .footer,
    .btn,
    .social-links {
        display: none !important;
    }

    /* Ensure proper spacing for printed content */
    main {
        margin-top: 0;
    }

    /* Optimize colors for print */
    .hero,
    .services,
    .reviews,
    .newsletter {
        background: white !important;
        color: black !important;
    }

    /* Ensure text is readable */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
        background: white;
    }

    /* Add page breaks */
    .section {
        page-break-inside: avoid;
    }

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

    /* Show URLs for links */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}

/* Focus management for accessibility */
@media (max-width: 767.98px) {
    /* Ensure focus is visible on mobile */
    .btn:focus,
    .nav-link:focus,
    input:focus,
    textarea:focus,
    select:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }

    /* Increase touch target sizes */
    .btn,
    .nav-link,
    input,
    textarea,
    select {
        min-height: 44px;
    }

    /* Improve form spacing on mobile */
    .form-group {
        margin-bottom: var(--spacing-8);
    }
}

/* Landscape orientation adjustments */
@media (max-width: 767.98px) and (orientation: landscape) {
    /* Reduce padding in landscape mode on mobile */
    .hero,
    .about,
    .services,
    .products,
    .reviews,
    .contact {
        padding: var(--spacing-12) 0;
    }

    /* Adjust header height for landscape */
    :root {
        --header-height: 60px;
    }
}

/* Support for very small screens */
@media (max-width: 359px) {
    /* Extra small phone adjustments */
    .container {
        padding: 0 var(--spacing-3);
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .btn {
        padding: var(--spacing-3) var(--spacing-4);
        font-size: var(--font-size-sm);
    }

    .service-card,
    .product-card,
    .review-card {
        padding: var(--spacing-4);
    }
}

/* Support for very large screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    /* Prevent content from becoming too wide */
    .legal-content,
    .thank-you-content {
        max-width: 900px;
    }
}
