/* HEADER AND HERO FIX - Prevents overlap and ensures responsive design */

/* Fix header positioning - ensure it doesn't overlap hero content */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background-color: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* ============================================
   HEADER ALIGNMENT FIX - Logo left, hamburger right
   ============================================ */

/* Navbar container - always flex with space-between */
.navbar .container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
}

/* Logo always on the left */
.navbar-brand {
    flex-shrink: 0 !important;
    margin-right: auto !important;
    display: flex !important;
    align-items: center !important;
}

/* Hamburger always on the right */
.hamburger,
.navbar-toggle,
#menuOpen {
    flex-shrink: 0 !important;
    margin-left: auto !important;
    order: 99 !important;
}

/* Desktop menu in the middle/right */
.navbar-collapse {
    flex-grow: 1 !important;
    justify-content: flex-end !important;
}

/* Mobile-specific header alignment */
@media (max-width: 991px) {
    .navbar .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Hide desktop menu, show hamburger */
    .navbar-collapse {
        display: none !important;
    }

    /* Ensure logo stays left */
    .navbar-brand {
        flex: 0 0 auto !important;
        max-width: 70% !important;
    }

    /* Ensure hamburger stays right */
    .hamburger,
    .navbar-toggle,
    #menuOpen {
        flex: 0 0 auto !important;
        margin-left: auto !important;
    }
}

/* Add padding to body to account for fixed header */
body {
    padding-top: 0 !important;
}

/* All hero sections need top padding to clear fixed header */
.hero-section,
.hero-section-advanced,
.service-hero-habitability,
.service-hero-ada,
.service-hero-kitchen,
.service-hero-commercial,
.service-hero-multifamily,
.service-hero-interior,
.service-hero-exterior,
.service-hero-underground,
.service-hero-boiler,
.service-hero-code,
.service-hero-permit,
.service-hero-ground,
.service-hero-specialty,
.service-hero-engineering,
.service-hero-maintenance,
.service-hero-3d,
[class*="service-hero-"] {
    padding-top: 180px !important; /* Account for fixed header height */
    min-height: 100vh;
}

/* Responsive header height adjustments */
@media (max-width: 991px) {
    .navbar {
        padding: 20px 0 !important;
    }
    
    .navbar-brand .logo-img {
        height: 70px !important;
        max-width: 350px !important;
    }
    
    .hero-section,
    .hero-section-advanced,
    [class*="service-hero-"] {
        padding-top: 140px !important;
        min-height: auto;
    }
}

@media (max-width: 767px) {
    .navbar {
        padding: 15px 0 !important;
    }
    
    .navbar-brand .logo-img {
        height: 60px !important;
        max-width: 300px !important;
    }
    
    .hero-section,
    .hero-section-advanced,
    [class*="service-hero-"] {
        padding-top: 110px !important;
        min-height: 70vh;
    }
    
    /* Make hero content more compact on mobile */
    .hero-content {
        padding: 20px 0 !important;
    }
    
    .hero-subtitle,
    .hero-subtitle-habitability {
        font-size: 0.75rem !important;
        margin-bottom: 15px !important;
    }
    
    .hero-title,
    .hero-title-habitability {
        font-size: 1.8rem !important;
        margin-bottom: 20px !important;
    }
    
    .hero-description,
    .hero-description-habitability {
        font-size: 0.95rem !important;
        margin-bottom: 25px !important;
    }
}

@media (max-width: 575px) {
    .navbar {
        padding: 12px 0 !important;
    }
    
    .navbar-brand .logo-img {
        height: 50px !important;
        max-width: 250px !important;
    }
    
    .hero-section,
    .hero-section-advanced,
    [class*="service-hero-"] {
        padding-top: 95px !important;
    }
}

/* Ensure all links are clickable - fix z-index issues */
a, .nav-link, .btn, .btn-default, button {
    position: relative;
    z-index: 1;
    pointer-events: auto !important;
}

/* Make sure mobile menu links are fully clickable */
.drawer__nav a,
.drawer__nav button {
    display: block;
    width: 100%;
    text-align: left;
    pointer-events: auto !important;
    touch-action: manipulation;
}

/* Fix hamburger menu positioning */
.navbar-toggle,
.hamburger {
    position: relative;
    z-index: 10001;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Ensure CTA buttons are clickable */
.hero-cta-buttons-habitability .btn-default,
.hero-buttons .btn-default {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    touch-action: manipulation;
}

/* Fix sticky call button */
.sticky-call-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    pointer-events: auto !important;
    touch-action: manipulation;
}

/* Responsive improvements for all screen sizes */

/* iPad / Tablet landscape (1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-section,
    .hero-section-advanced,
    [class*="service-hero-"] {
        padding-top: 150px !important;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
    
    .navbar-brand .logo-img {
        height: 80px !important;
    }
}

/* iPad / Tablet portrait (768px) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-section,
    .hero-section-advanced,
    [class*="service-hero-"] {
        padding-top: 140px !important;
    }
}

/* Small phones (320px - 480px) */
@media (max-width: 480px) {
    .navbar-brand .logo-img {
        height: 45px !important;
        max-width: 220px !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .hero-description {
        font-size: 0.9rem !important;
    }
}

/* Foldable devices (Samsung Z Fold, etc.) */
@media (min-width: 280px) and (max-width: 653px) {
    .hero-section,
    .hero-section-advanced,
    [class*="service-hero-"] {
        padding-top: 100px !important;
    }
}

/* Large screens / Desktop (1440px+) */
@media (min-width: 1440px) {
    .navbar-brand .logo-img {
        height: 120px !important;
        max-width: 700px !important;
    }

    .hero-section,
    .hero-section-advanced,
    [class*="service-hero-"] {
        padding-top: 200px !important;
    }
}

/* ============================================
   CALL BUTTONS - Responsive sizing for mobile/tablet
   ============================================ */

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    /* All call/CTA buttons */
    .btn-default,
    .btn-nav,
    .hero-buttons .btn-default,
    .hero-cta-buttons .btn-default,
    .hero-cta-buttons-habitability .btn-default,
    a[href^="tel:"].btn-default {
        padding: 12px 20px !important;
        font-size: 0.95rem !important;
        min-width: auto !important;
        white-space: nowrap !important;
    }

    /* Sticky call button */
    .sticky-call-button {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
        bottom: 15px !important;
        right: 15px !important;
    }

    .sticky-call-button .call-label {
        font-size: 0.85rem !important;
    }

    /* Mobile drawer call button */
    .menu-cta > a {
        padding: 1rem 1.2rem !important;
        font-size: 1rem !important;
        margin: 1rem 1rem 0.5rem !important;
    }
}

/* Phone (max 767px) */
@media (max-width: 767px) {
    /* All call/CTA buttons - smaller */
    .btn-default,
    .btn-nav,
    .hero-buttons .btn-default,
    .hero-cta-buttons .btn-default,
    .hero-cta-buttons-habitability .btn-default,
    a[href^="tel:"].btn-default {
        padding: 10px 16px !important;
        font-size: 0.875rem !important;
        border-radius: 8px !important;
    }

    /* Hero buttons side by side */
    .hero-buttons,
    .hero-cta-buttons,
    .hero-cta-buttons-habitability {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }

    .hero-buttons .btn-default,
    .hero-cta-buttons .btn-default,
    .hero-cta-buttons-habitability .btn-default {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }

    /* Sticky call button - compact */
    .sticky-call-button {
        padding: 8px 14px !important;
        font-size: 0.85rem !important;
        bottom: 12px !important;
        right: 12px !important;
        border-radius: 25px !important;
    }

    .sticky-call-button i {
        font-size: 1rem !important;
    }

    .sticky-call-button .call-label {
        font-size: 0.8rem !important;
    }

    /* Mobile drawer call button */
    .menu-cta > a {
        padding: 0.85rem 1rem !important;
        font-size: 0.95rem !important;
        margin: 0.8rem 0.8rem 0.4rem !important;
        border-radius: 10px !important;
    }
}

/* Small phones (max 480px) */
@media (max-width: 480px) {
    /* Extra compact buttons */
    .btn-default,
    .btn-nav,
    a[href^="tel:"].btn-default {
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
    }

    /* Sticky call - icon only option or very compact */
    .sticky-call-button {
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
        bottom: 10px !important;
        right: 10px !important;
    }

    .sticky-call-button .call-label {
        display: none !important; /* Hide text, show only icon */
    }

    .sticky-call-button i {
        margin-right: 0 !important;
        font-size: 1.1rem !important;
    }

    /* Mobile drawer call button */
    .menu-cta > a {
        padding: 0.75rem 0.9rem !important;
        font-size: 0.9rem !important;
        margin: 0.6rem 0.6rem 0.3rem !important;
    }
}
