/* ===================================
   RESPONSIVE STYLES
   AL DIERA CONSTRUCTIONS LLC
   =================================== */

/* Prevent horizontal scroll on all devices */
html, body {
    overflow-x: hidden;
    width: 100%;
}

* {
    box-sizing: border-box;
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 20px;
        max-width: 100%;
    }
    
    /* Top Bar */
    .top-bar {
        padding: 8px 0;
    }
    
    .top-bar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .top-bar-left, .top-bar-right {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }
    
    /* Header */
    .header-top {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        width: 100%;
        justify-content: center;
    }

    .logo img {
        height: 50px;
    }

    .logo-text h1 {
        font-size: 16px;
    }

    .header-contact {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }

    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: rgba(0, 0, 0, 0.95);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 80px 20px 20px;
        gap: 0;
        z-index: 999;
        justify-content: flex-start;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

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

    .nav-menu a {
        display: block;
        padding: 18px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--white);
        font-size: 18px;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 1000;
        position: relative;
    }
    
    .hamburger span {
        width: 25px;
        height: 3px;
        background-color: var(--primary-color);
        transition: all 0.3s ease;
        display: block;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
        background-color: var(--white);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
        background-color: var(--white);
    }

    /* Hero Slider */
    .hero-slider {
        height: 400px;
    }

    .slide-content {
        bottom: 40px;
        left: 20px;
        right: 20px;
        max-width: 100%;
    }

    .slide-content h2 {
        font-size: 32px;
    }

    .slide-content p {
        font-size: 14px;
    }
    
    /* Statistics */
    .stats-section {
        padding: 40px 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Filter Buttons */
    .filter-buttons {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 13px;
    }

    /* Projects Grid */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .project-item {
        height: 220px;
    }

    /* CTA Section */
    .cta-section {
        padding: 50px 20px;
    }

    .cta-section h2 {
        font-size: 24px;
    }

    .cta-section p {
        font-size: 16px;
    }

    .cta-button {
        padding: 12px 30px;
        font-size: 14px;
    }

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

    .footer-section {
        text-align: left;
    }

    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        font-size: 20px;
        bottom: 20px;
        right: 20px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    /* General */
    .container {
        padding: 0 15px;
        width: 100%;
    }
    
    /* Top Bar */
    .top-bar {
        font-size: 11px;
        padding: 6px 0;
    }
    
    .top-bar-link {
        font-size: 11px;
        gap: 5px;
    }
    
    .social-links {
        gap: 8px;
    }
    
    .social-links a {
        font-size: 14px;
    }

    /* Header */
    .logo img {
        height: 45px;
    }
    
    .logo-text h1 {
        font-size: 14px;
    }

    .logo-text p {
        font-size: 10px;
    }

    .phone {
        font-size: 12px;
    }

    /* Hero Slider */
    .hero-slider {
        height: 300px;
    }

    .slide-content {
        bottom: 25px;
        left: 15px;
        right: 15px;
    }

    .slide-content h2 {
        font-size: 22px;
        line-height: 1.2;
    }

    .slide-content p {
        font-size: 13px;
        margin: 8px 0 12px;
    }

    .slider-btn {
        padding: 10px 15px;
        font-size: 18px;
        width: 35px;
        height: 35px;
    }
    
    .slider-indicators {
        bottom: 10px;
        gap: 6px;
    }
    
    .indicator {
        width: 8px;
        height: 8px;
    }
    
    /* Statistics */
    .stats-section {
        padding: 30px 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-item {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 12px;
    }

    /* Sections */
    .services-section,
    .featured-works,
    .what-we-do {
        padding: 40px 0;
    }

    .services-section h2,
    .featured-works h2,
    .what-we-do h2 {
        font-size: 24px;
        margin-bottom: 25px;
    }

    /* Service Cards */
    .service-card img {
        height: 180px;
        object-fit: cover;
    }

    .service-card h3 {
        font-size: 16px;
        padding: 15px 15px 8px;
    }

    .service-card p {
        font-size: 13px;
        padding: 0 15px;
        line-height: 1.5;
    }

    .read-more {
        padding: 10px 15px;
        margin: 12px 15px;
        font-size: 13px;
    }

    /* Filter Buttons */
    .filter-buttons {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    /* Projects Grid */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .project-item {
        height: 250px;
    }

    /* Services List */
    .services-list {
        font-size: 14px;
        line-height: 1.8;
    }

    .services-list li {
        padding-left: 25px;
    }

    /* CTA Section */
    .cta-section {
        padding: 40px 15px;
    }

    .cta-section h2 {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .cta-section p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 13px;
    }

    /* Footer */
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .footer-section p,
    .footer-section a {
        font-size: 13px;
    }

    .footer-section ul li {
        margin-bottom: 8px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        font-size: 12px;
        padding-top: 20px;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
    }

    .footer-links a {
        margin: 0;
    }

    /* Back to Top */
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 18px;
        bottom: 15px;
        right: 15px;
    }
}

/* Extra Small (360px and below) */
@media (max-width: 360px) {
    .slide-content h2 {
        font-size: 20px;
    }

    .services-section h2,
    .featured-works h2,
    .what-we-do h2 {
        font-size: 22px;
    }

    .cta-section h2 {
        font-size: 20px;
    }
}

/* Landscape Mode */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slider {
        height: 250px;
    }

    .slide-content h2 {
        font-size: 20px;
    }

    .slide-content p {
        font-size: 12px;
        margin: 5px 0 10px;
    }

    .services-section,
    .featured-works,
    .what-we-do {
        padding: 30px 0;
    }
    
    .nav-menu {
        padding-top: 60px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-menu a,
    .filter-btn,
    .cta-button,
    .read-more {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Tap highlight */
    * {
        -webkit-tap-highlight-color: rgba(45, 134, 89, 0.2);
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .back-to-top,
    .slider-btn,
    .hamburger,
    .top-bar {
        display: none !important;
    }

    body {
        background-color: white;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    a {
        color: var(--primary-color);
    }
}
