/* ===================================
   COMPREHENSIVE RESPONSIVE FIXES
   Making the site fully responsive across all dimensions
   =================================== */

/* Base responsive utilities */
* {
    box-sizing: border-box;
}

img, video, canvas, svg {
    max-width: 100%;
    display: block;
}

/* Allow hero images to maintain full height */
.hero-image img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
}

/* Prevent horizontal overflow */
body, html {
    max-width: 100vw;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ===================================
   EXTRA SMALL DEVICES (320px - 374px)
   =================================== */
@media (max-width: 374px) {
    /* Header adjustments */
    .header-pill {
        margin: 6px auto 0;
        padding: 0 6px;
        width: calc(100% - 12px);
    }
    
    .header-inner {
        height: 56px;
        padding: 0 8px;
        gap: 8px;
    }
    
    .brand {
        font-size: 15px;
        padding: 8px 10px;
    }
    
    .brand-text-secondary {
        font-size: 13px;
    }
    
    .facebook-nav-btn,
    .theme-toggle,
    .menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    /* Hero section */
    #hero h1 {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
        padding: 0 0.75rem;
    }
    
    /* Services section */
    #our-services h2 {
        font-size: 2rem !important;
    }
    
    .service-card h3 {
        font-size: 1.125rem;
    }
    
    .service-card p {
        font-size: 0.875rem;
    }
    
    /* Contact section */
    .contact-card {
        padding: 1.25rem !important;
    }
    
    .contact-card .text-5xl {
        font-size: 2rem !important;
    }
    
    .contact-card .text-xl {
        font-size: 1rem !important;
    }
    
    /* Footer */
    footer img {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    footer p,
    footer .text-sm {
        font-size: 0.7rem !important;
    }
}

/* ===================================
   SMALL MOBILE (375px - 479px)
   =================================== */
@media (min-width: 375px) and (max-width: 479px) {
    .header-pill {
        width: calc(100% - 16px);
    }
    
    #hero h1 {
        font-size: 2rem !important;
        line-height: 1.25 !important;
    }
    
    #our-services h2 {
        font-size: 2.25rem !important;
    }
}

/* ===================================
   MEDIUM MOBILE (480px - 599px)
   =================================== */
@media (min-width: 480px) and (max-width: 599px) {
    .header-inner {
        height: 62px;
    }
    
    #hero h1 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }
    
    #our-services h2 {
        font-size: 2.5rem !important;
    }
    
    .service-card {
        max-width: 400px;
        margin: 0 auto;
    }
}

/* ===================================
   LARGE MOBILE (600px - 767px)
   =================================== */
@media (min-width: 600px) and (max-width: 767px) {
    #hero h1 {
        font-size: 3rem !important;
    }
    
    #our-services h2 {
        font-size: 3rem !important;
    }
    
    .service-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem;
    }
    
    .contact-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ===================================
   TABLET PORTRAIT (768px - 899px)
   =================================== */
@media (min-width: 768px) and (max-width: 899px) {
    .header-pill {
        width: calc(100% - 32px);
    }
    
    .header-inner {
        height: 64px;
        padding: 0 20px;
    }
    
    #hero h1 {
        font-size: 3.5rem !important;
    }
    
    #our-services h2 {
        font-size: 3.5rem !important;
    }
    
    .service-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem;
    }
    
    .about-us-section {
        flex-direction: row !important;
    }
    
    .left-panel,
    .right-panel {
        width: 50% !important;
    }
}

/* ===================================
   TABLET LANDSCAPE (900px - 1023px)
   =================================== */
@media (min-width: 900px) and (max-width: 1023px) {
    .header-inner {
        grid-template-columns: auto 1fr auto;
    }
    
    .nav {
        display: flex !important;
        gap: 12px;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    #hero h1 {
        font-size: 4rem !important;
    }
    
    .service-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ===================================
   SMALL DESKTOP (1024px - 1279px)
   =================================== */
@media (min-width: 1024px) and (max-width: 1279px) {
    .container {
        max-width: 960px;
        padding: 0 2rem;
    }
    
    .header-pill {
        width: min(1200px, calc(100% - 32px));
    }
    
    #hero h1 {
        font-size: 4.5rem !important;
    }
    
    .service-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem;
    }
}

/* ===================================
   MEDIUM DESKTOP (1280px - 1439px)
   =================================== */
@media (min-width: 1280px) and (max-width: 1439px) {
    .container {
        max-width: 1200px;
    }
    
    #hero h1 {
        font-size: 5rem !important;
    }
}

/* ===================================
   LARGE DESKTOP (1440px - 1919px)
   =================================== */
@media (min-width: 1440px) and (max-width: 1919px) {
    .container {
        max-width: 1320px;
    }
    
    .header-pill {
        width: min(1400px, calc(100% - 48px));
    }
    
    #hero h1 {
        font-size: 5.5rem !important;
    }
}

/* ===================================
   ULTRA-WIDE (1920px+)
   =================================== */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .header-pill {
        max-width: 1600px;
    }
    
    #hero h1 {
        font-size: 6.5rem !important;
    }
    
    .service-grid {
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* ===================================
   HEIGHT-BASED RESPONSIVE FIXES
   =================================== */

/* Short screens (landscape phones) */
@media (max-height: 600px) {
    #hero {
        min-height: 100vh;
        height: auto;
    }
    
    #hero h1 {
        font-size: 2rem !important;
        padding: 1rem;
    }
    
    .header-pill {
        margin: 8px auto 0;
    }
    
    .header-inner {
        height: 52px;
    }
}

/* Very short screens */
@media (max-height: 500px) {
    .header-inner {
        height: 48px;
    }
    
    .brand {
        font-size: 14px;
    }
    
    #hero h1 {
        font-size: 1.5rem !important;
    }
}

/* ===================================
   SPECIFIC SECTION FIXES
   =================================== */

/* Services section - ensure proper grid behavior */
@media (max-width: 767px) {
    .service-grid {
        display: flex !important;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .service-card {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
}

/* Gallery section - mobile fallback */
@media (max-width: 768px) {
    .mobile-gallery-grid {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .mobile-gallery-grid img {
        width: 100%;
        height: auto;
        border-radius: 12px;
    }
}

/* Contact section - responsive grid */
@media (max-width: 767px) {
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .contact-map {
        height: 300px !important;
        min-height: 300px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .contact-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* About section - ensure proper stacking */
@media (max-width: 767px) {
    .about-us-section {
        flex-direction: column !important;
    }
    
    .left-panel,
    .right-panel {
        width: 100% !important;
        min-height: auto !important;
    }
    
    .left-panel {
        padding: 3rem 1.5rem !important;
    }
    
    .right-panel {
        padding: 2rem 1.5rem !important;
    }
}

/* ===================================
   TOUCH DEVICE OPTIMIZATIONS
   =================================== */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .nav-link,
    .btn-contact,
    .facebook-nav-btn,
    .theme-toggle,
    .menu-toggle {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .service-card .rounded-2xl:hover {
        transform: none;
    }
    
    /* Simplify animations for better performance */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .header-pill,
    .mobile-menu,
    .global-particles,
    .scroll-mouse {
        display: none !important;
    }
    
    #hero,
    section {
        page-break-inside: avoid;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}
