/* Mobile-first responsive design */

/* Extra small devices (phones, 575px and down) */
@media (max-width: 575.98px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    /* Navigation */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        gap: 1rem;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-toggle {
        display: block;
    }
    
    /* Hero Section */
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-cta .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-image {
        order: -1;
    }
    
    /* Reviews */
    .reviews-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    /* Newsletter */
    .newsletter-form .form-group {
        flex-direction: column;
    }
    
    .newsletter-form .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Cookie Banner */
    .cookie-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cookie-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-buttons .btn {
        width: 100%;
    }
    
    /* FAQ */
    .faq-question h3 {
        font-size: 1rem;
        padding-right: 1rem;
    }
    
    /* Thank You Page */
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .thank-you-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .thank-you-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Contact */
    .contact-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Benefits Grid */
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Navigation - show toggle on tablets */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        gap: 1rem;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-toggle {
        display: block;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Reviews */
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Newsletter */
    .newsletter-form .form-group {
        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);
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .contact-info {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    /* Hero */
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .contact-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Reviews */
    .reviews-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .hero {
        min-height: 80vh;
        padding-top: 80px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    section {
        padding: 3rem 0;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure images and icons look crisp on high DPI displays */
    .service-icon img,
    .logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    .header,
    .cookie-banner,
    .cookie-modal,
    .scroll-to-top {
        display: none !important;
    }
    
    .hero {
        background: none !important;
        color: #333 !important;
        min-height: auto !important;
        padding: 2rem 0 !important;
    }
    
    .hero h1,
    .hero-subtitle {
        color: #333 !important;
    }
    
    section {
        padding: 1rem 0 !important;
        page-break-inside: avoid;
    }
    
    .service-card,
    .review-card,
    .contact-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .footer {
        background: none !important;
        color: #333 !important;
    }
    
    .social-links a {
        background: none !important;
        color: #333 !important;
        border: 1px solid #ddd !important;
    }
    
    a {
        color: #333 !important;
        text-decoration: underline !important;
    }
    
    .btn {
        background: none !important;
        color: #333 !important;
        border: 1px solid #333 !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Note: This is optional and can be implemented if needed */
    /* For now, we'll keep the light theme as default */
}

/* Focus indicators for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
    a:focus,
    button:focus,
    input:focus,
    textarea:focus {
        outline: 2px solid #3498db;
        outline-offset: 2px;
    }
}

/* Container queries for modern browsers */
@supports (container-type: inline-size) {
    .service-card {
        container-type: inline-size;
    }
    
    @container (max-width: 250px) {
        .service-card {
            padding: 1rem;
        }
        
        .service-icon img {
            width: 60px;
            height: 60px;
        }
    }
}

/* Hover effects only for devices that support hover */
@media (hover: hover) {
    .service-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }
    
    .btn:hover {
        transform: translateY(-1px);
    }
    
    .nav-link:hover {
        color: #3498db;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .btn {
        padding: 1rem 1.5rem;
        min-height: 44px;
    }
    
    .nav-link {
        padding: 0.75rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .faq-question {
        min-height: 60px;
    }
    
    .cookie-buttons .btn {
        min-height: 44px;
    }
}

/* Specific fixes for iOS Safari */
@supports (-webkit-appearance: none) {
    .hero {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    input[type="email"],
    input[type="text"] {
        -webkit-appearance: none;
        border-radius: 5px;
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .service-card {
        /* Firefox-specific styles if needed */
    }
}

/* Edge/IE specific fixes */
@supports (-ms-ime-align: auto) {
    .services-grid {
        display: -ms-grid;
    }
}
