/* Responsive Design - Mobile First Approach */

/* Extra Small Devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding: 0 15px;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Header */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.3s ease;
        z-index: 999;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .nav-link {
        font-size: 1.2rem;
        padding: 1rem;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Hero Section */
    .hero {
        padding: 100px 0 60px;
        min-height: 90vh;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-text h2 {
        font-size: 2rem;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .image-placeholder {
        height: 200px;
        font-size: 0.9rem;
    }
    
    /* Sections */
    section {
        padding: 60px 0;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1.5rem 1rem;
    }
    
    .stat-item h4 {
        font-size: 2rem;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    /* Products Grid */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-content {
        padding: 1.5rem;
    }
    
    /* Reviews Grid */
    .reviews-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .review-card {
        padding: 1.5rem;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Newsletter */
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .form-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-group .btn {
        width: 100%;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .map-placeholder {
        height: 250px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    /* Cookie Banner */
    .cookie-content {
        text-align: center;
    }
    
    .cookie-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .cookie-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
    
    /* Cookie Modal */
    .cookie-modal {
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .cookie-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .toggle-switch {
        align-self: flex-end;
    }
    
    /* Thank You Page */
    .thank-you {
        padding: 100px 0 60px;
    }
    
    .thank-you-content h1 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }
    
    .next-steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .step {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .thank-you-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .thank-you-actions .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .thank-you-social .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .social-link {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    /* Legal Pages */
    .legal-text {
        padding: 2rem 1.5rem;
    }
    
    .cookie-table {
        font-size: 0.9rem;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* About Stats */
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* Products and Reviews */
    .products-grid,
    .reviews-grid {
        grid-template-columns: 1fr;
    }
    
    /* Newsletter */
    .newsletter-content {
        grid-template-columns: 1fr;
    }
    
    .form-group {
        flex-direction: row;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    /* Thank You */
    .next-steps {
        grid-template-columns: 1fr;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Header */
    .nav-toggle {
        display: none;
    }
    
    /* Hero */
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .hero-text h2 {
        font-size: 2.5rem;
    }
    
    /* About */
    .about-content {
        grid-template-columns: 2fr 1fr;
        gap: 3rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Products and Reviews */
    .products-grid,
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Newsletter */
    .newsletter-content {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Thank You */
    .next-steps {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Cookie Banner */
    .cookie-buttons {
        flex-direction: row;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Services */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Products and Reviews */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Services */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Reviews */
    .reviews-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Ultra Wide Screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Hero */
    .hero-text h2 {
        font-size: 3.5rem;
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Landscape Orientation on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 0 40px;
    }
    
    .thank-you {
        min-height: auto;
        padding: 100px 0 40px;
    }
    
    .nav-menu.active {
        padding-top: 60px;
        justify-content: flex-start;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .image-placeholder,
    .map-placeholder {
        border-width: 1px;
    }
    
    .nav-link::after {
        height: 1px;
    }
}

/* Touch Device Specific */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .service-card:hover,
    .product-card:hover,
    .review-card:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .service-card:active,
    .product-card:active,
    .review-card:active {
        transform: scale(0.99);
    }
}

/* Mouse/Trackpad Devices */
@media (hover: hover) and (pointer: fine) {
    .social-links a:hover,
    .social-link:hover {
        transform: translateY(-2px);
    }
}

/* Accessibility - Increased Text Size */
@media (min-width: 320px) {
    html {
        font-size: calc(16px + 6 * ((100vw - 320px) / 680));
    }
}

@media (min-width: 1000px) {
    html {
        font-size: 22px;
    }
}

/* Reduce font size on very small screens */
@media (max-width: 320px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .hero-text h2 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .thank-you-content h1 {
        font-size: 1.8rem;
    }
}

/* Print Specific Responsive */
@media print {
    .hero-content,
    .about-content,
    .newsletter-content,
    .contact-content {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .services-grid,
    .products-grid,
    .reviews-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .about-stats,
    .next-steps {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Dark Mode Support (if user prefers) */
@media (prefers-color-scheme: dark) {
    .cookie-modal .modal-content {
        background-color: #2d3748;
        color: white;
    }
    
    .modal-header {
        border-bottom-color: #4a5568;
    }
    
    .modal-header h2 {
        color: white;
    }
    
    .cookie-category {
        border-bottom-color: #4a5568;
    }
    
    .cookie-category h3 {
        color: white;
    }
    
    .cookie-category p {
        color: #a0aec0;
    }
    
    .close-btn {
        color: #a0aec0;
    }
    
    .close-btn:hover {
        background-color: #4a5568;
    }
}

/* Animation Preferences */
@media (prefers-reduced-motion: no-preference) {
    .hero-content,
    .about-content,
    .newsletter-content,
    .contact-content {
        animation: fadeInUp 0.8s ease-out;
    }
    
    .service-card,
    .product-card,
    .review-card {
        animation: fadeInUp 0.6s ease-out;
        animation-fill-mode: both;
    }
    
    .service-card:nth-child(1) { animation-delay: 0.1s; }
    .service-card:nth-child(2) { animation-delay: 0.2s; }
    .service-card:nth-child(3) { animation-delay: 0.3s; }
    .service-card:nth-child(4) { animation-delay: 0.4s; }
    .service-card:nth-child(5) { animation-delay: 0.5s; }
    .service-card:nth-child(6) { animation-delay: 0.6s; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus Management for Mobile */
@media (max-width: 767.98px) {
    .nav-menu.active .nav-link:first-child {
        margin-top: 2rem;
    }
    
    .cookie-buttons .btn:focus,
    .thank-you-actions .btn:focus {
        outline-offset: 4px;
    }
}

/* Container Queries Support (Modern Browsers) */
@supports (container-type: inline-size) {
    .service-card,
    .product-card,
    .review-card {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .service-card,
        .product-card,
        .review-card {
            padding: 1rem;
        }
        
        .service-card h3,
        .product-card h3,
        .review-card h4 {
            font-size: 1rem;
        }
    }
}
