/* Tablet Styles */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    /* Hero Section */
    .hero {
        padding: 120px 0 80px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    /* Team Grid */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Blog Grid */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Testimonials Grid */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
        gap: 0;
    }

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

    .nav-menu li {
        width: 100%;
        margin: 0;
    }

    .nav-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 15px 0;
        border-bottom: 1px solid #f0f0f0;
        justify-content: flex-start;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-toggle {
        display: flex;
    }

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

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

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

    /* Hero Section */
    .hero {
        padding: 100px 0 60px;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-content p {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
    }

    /* Sections */
    section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 40px;
    }

    /* Grids */
    .services-grid,
    .team-grid,
    .blog-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Service Cards */
    .service-card {
        padding: 30px 20px;
    }

    /* Stats */
    .about-stats {
        gap: 20px;
    }

    .stat-item {
        padding: 20px;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    /* Contact Form */
    .contact-form {
        padding: 30px 20px;
    }

    /* Footer */
    .footer {
        padding: 40px 0 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

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

    /* Cookie Consent */
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .cookie-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Cookie Modal */
    .modal-content {
        margin: 20px;
        max-width: none;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }

    /* Legal Pages */
    .legal-content {
        padding: 40px 20px;
        margin: 20px;
    }

    /* Thanks Page */
    .thanks-content {
        padding: 40px 20px;
        margin: 20px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .thanks-actions {
        flex-direction: column;
        align-items: center;
    }

    .thanks-actions .btn {
        width: 100%;
        max-width: 250px;
    }

    /* Blog Post */
    .post-content {
        margin: 20px;
        border-radius: 10px;
        overflow: hidden;
    }

    .post-header {
        padding: 30px 20px 15px;
    }

    .post-meta {
        flex-direction: column;
        gap: 5px;
    }

    .post-body {
        padding: 30px 20px;
    }

    .post-body h2 {
        margin-top: 30px;
        margin-bottom: 15px;
    }

    .post-body h3 {
        margin-top: 25px;
        margin-bottom: 10px;
    }

    .post-footer {
        padding: 30px 20px;
    }

    .related-posts {
        padding: 30px 20px;
    }

    .related-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Tables */
    .cookies-table,
    .comparison-table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .cookies-table th,
    .cookies-table td,
    .comparison-table th,
    .comparison-table td {
        padding: 8px 10px;
        min-width: 120px;
    }

    /* Form adjustments */
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Contact info */
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .contact-icon {
        align-self: center;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    /* Typography */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* Hero */
    .hero-content h1 {
        font-size: 1.75rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Cards */
    .service-card,
    .team-member,
    .testimonial-card,
    .blog-card {
        margin: 0 5px;
    }

    /* Stats */
    .stat-number {
        font-size: 2rem;
    }

    /* Contact Form */
    .contact-form {
        padding: 20px 15px;
    }

    /* Legal Content */
    .legal-content {
        padding: 30px 15px;
    }

    /* Thanks Page */
    .thanks-content {
        padding: 30px 15px;
    }

    /* Blog Post */
    .post-header {
        padding: 20px 15px;
    }

    .post-body {
        padding: 20px 15px;
    }

    .post-footer {
        padding: 20px 15px;
    }

    .related-posts {
        padding: 20px 15px;
    }

    /* Cookie buttons */
    .cookie-buttons {
        flex-direction: column;
        width: 100%;
    }

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

    /* Share buttons */
    .share-buttons {
        justify-content: center;
    }

    /* Phone link */
    .phone-link {
        font-size: 1.25rem;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    /* Post meta */
    .post-meta {
        font-size: 0.8rem;
    }

    /* Post tags */
    .post-tags {
        text-align: center;
    }

    .tag {
        font-size: 0.75rem;
        padding: 4px 8px;
        margin: 2px;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

    /* Hero */
    .hero-content h1 {
        font-size: 3.5rem;
    }

    .hero-content p {
        font-size: 1.3rem;
    }

    /* Grids */
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }

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

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

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

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr 1.5fr;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 3fr 1fr 1fr 1fr;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize images and icons for high DPI displays */
    .service-icon img,
    .nav-icon,
    .contact-icon,
    .social-links img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .header,
    .footer,
    .cookie-consent,
    .cookie-modal,
    .nav-toggle,
    .hero-buttons,
    .contact-form,
    .social-links,
    .share-buttons {
        display: none !important;
    }

    .container {
        max-width: none !important;
        padding: 0 !important;
    }

    .legal-content,
    .post-content,
    .thanks-content {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

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

    img {
        max-width: 100% !important;
        height: auto !important;
    }

    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }

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

    .post-image {
        height: auto !important;
    }

    .blog-image {
        height: auto !important;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
}

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

    .scroll-animate {
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* This website maintains light theme for professional construction industry appearance */
    /* Add dark mode styles here if needed in the future */
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 80px 0 40px;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .nav-menu {
        top: 60px;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    section {
        padding: 40px 0;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .nav-link:hover,
    .blog-card:hover,
    .service-card:hover,
    .team-member:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.98);
    }

    /* Increase touch targets */
    .nav-link {
        padding: 15px 0;
    }

    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .social-links a {
        width: 44px;
        height: 44px;
    }

    .close-btn {
        min-width: 44px;
        min-height: 44px;
    }
}
