/* ==========================================================================
   FIRST CLASS CONTRACTING - MOBILE-FIRST COMPREHENSIVE OPTIMIZATION (V2)
   High-end architectural responsiveness for Jeddah's leading luxury contractor
   ========================================================================== */

/* 1. ANTI-OVERFLOW & GLOBAL FOUNDATION */
html, body {
    max-width: 100vw !important;
    overflow-x: clip !important;
    -webkit-tap-highlight-color: transparent;
}

*, *::before, *::after {
    box-sizing: border-box;
}

img, video, svg, canvas {
    max-width: 100%;
    height: auto;
}

/* 2. MOBILE NAVIGATION DRAWER & HEADER (< 992px) */
@media (max-width: 991.98px) {
    .site-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 100000 !important;
        background: #071c11 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transform: none !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    }

    .topbar {
        display: none !important;
    }

    .nav-wrap {
        min-height: 64px !important;
        height: 64px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 1rem !important;
        position: static !important;
    }

    .brand {
        display: flex !important;
        align-items: center !important;
        z-index: 100001 !important;
    }

    .brand img {
        height: 44px !important;
        width: auto !important;
        max-width: 130px !important;
        object-fit: contain !important;
    }

    /* Menu Toggle Button */
    .menu-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 5px !important;
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        cursor: pointer !important;
        z-index: 100001 !important;
        transition: all 0.25s ease !important;
    }

    .menu-toggle:active {
        transform: scale(0.92) !important;
        background: rgba(255, 255, 255, 0.15) !important;
    }

    .menu-toggle span {
        display: block !important;
        width: 22px !important;
        height: 2px !important;
        margin: 0 !important;
        background: #ffffff !important;
        border-radius: 2px !important;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    /* Hamburger to X Animation */
    .menu-toggle[aria-expanded="true"] {
        background: rgba(246, 199, 93, 0.15) !important;
        border-color: rgba(246, 199, 93, 0.5) !important;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg) !important;
        background: #f6c75d !important;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0 !important;
        transform: scale(0) !important;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg) !important;
        background: #f6c75d !important;
    }

    /* Luxury Fullscreen Navigation Drawer - Solid High Contrast */
    .main-nav {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 999999 !important;
        padding: 1.25rem 1.25rem 2rem !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        background-color: #071f13 !important;
        background: linear-gradient(180deg, #071f13 0%, #04140b 100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(-16px) !important;
        transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7) !important;
    }

    .main-nav.open {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
    }

    body.menu-open {
        overflow: hidden !important;
        touch-action: none !important;
    }

    /* Drawer Header */
    .mobile-nav-header {
        display: flex !important;
        flex-direction: column !important;
        padding-bottom: 0.85rem !important;
        margin-bottom: 0.5rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    }

    .mobile-nav-status-badge {
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(57, 202, 98, 0.35) !important;
        padding: 0.35rem 0.85rem !important;
        border-radius: 50px !important;
        color: #a3f3be !important;
        font-size: 0.76rem !important;
        font-weight: 700 !important;
        width: fit-content !important;
    }

    .pulse-dot {
        width: 7px !important;
        height: 7px !important;
        border-radius: 50% !important;
        background: #39ca62 !important;
        box-shadow: 0 0 8px #39ca62 !important;
    }

    .mobile-nav-close-btn {
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        color: #ffffff !important;
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.1rem !important;
        cursor: pointer !important;
    }

    /* Links inside Drawer */
    .mobile-nav-links {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
        margin-bottom: 1.25rem !important;
    }

    .main-nav a,
    .mobile-nav-links a {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        padding: 0.75rem 0.5rem !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: rgba(255, 255, 255, 0.94) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
    }

    .main-nav a i,
    .mobile-nav-links a i {
        display: inline-flex !important;
        align-items: center !important;
        color: rgba(246, 199, 93, 0.75) !important;
        font-size: 0.95rem !important;
        transition: transform 0.2s ease !important;
    }

    .main-nav a:hover,
    .main-nav a.active,
    .mobile-nav-links a:hover,
    .mobile-nav-links a.active {
        color: var(--gold) !important;
        padding-right: 0.75rem !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 8px !important;
    }

    .main-nav a:hover i,
    .main-nav a.active i,
    .mobile-nav-links a:hover i,
    .mobile-nav-links a.active i {
        color: var(--gold) !important;
        transform: scale(1.15) !important;
    }

    /* Quick Action CTAs at bottom of Drawer */
    .mobile-nav-quick-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.65rem !important;
        padding-top: 1rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    }
}

/* DESKTOP RESET (>= 992px) */
@media (min-width: 992px) {
    .mobile-nav-header,
    .mobile-nav-quick-actions {
        display: none !important;
    }
    .mobile-nav-links {
        display: contents !important;
    }
}

/* 3. HERO SECTION MOBILE REFINEMENTS (< 768px) */
@media (max-width: 767.98px) {
    .home-hero {
        min-height: auto !important;
        padding: 82px 0 32px !important;
        overflow-x: clip !important;
    }

    .home-hero-grid {
        grid-template-columns: 1fr !important;
        gap: 1.4rem !important;
    }

    .home-label {
        font-size: 0.78rem !important;
        margin-bottom: 0.35rem !important;
    }

    .home-hero h1 {
        font-size: clamp(2.2rem, 7.8vw, 3.1rem) !important;
        line-height: 1.15 !important;
        letter-spacing: -0.03em !important;
        margin: 0.35rem 0 0.45rem !important;
    }

    .hero-tagline-badge {
        font-size: 0.78rem !important;
        padding: 0.38rem 0.85rem !important;
        margin: 0.35rem 0 0.8rem !important;
        line-height: 1.4 !important;
        border-radius: 30px !important;
        text-align: right !important;
        display: inline-block !important;
    }

    .home-hero-text {
        font-size: 0.94rem !important;
        line-height: 1.7 !important;
        color: rgba(255, 255, 255, 0.86) !important;
        margin-bottom: 1.2rem !important;
    }

    .home-hero-actions {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.75rem !important;
        margin-top: 1.15rem !important;
    }

    .btn-gold-luxury,
    .btn-outline-luxury {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.95rem 1.4rem !important;
        font-size: 1rem !important;
        text-align: center !important;
    }

    /* Trust Strip 2x2 Grid */
    .hero-trust-strip {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.7rem 0.8rem !important;
        margin-top: 1.2rem !important;
        padding-top: 1.1rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    }

    .hero-trust-item {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
    }

    .hero-trust-item i {
        font-size: 0.88rem !important;
    }

    /* Luxury Villa Visual Container */
    .home-hero-visual {
        min-height: 340px !important;
        max-height: 380px !important;
        height: 360px !important;
        border-radius: 20px !important;
        margin-top: 0.5rem !important;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4) !important;
    }

    .hero-glass-badge-top {
        top: 12px !important;
        right: 12px !important;
        font-size: 0.7rem !important;
        padding: 0.38rem 0.75rem !important;
    }

    .hero-live-pill {
        top: 12px !important;
        left: 12px !important;
        font-size: 0.68rem !important;
        padding: 0.35rem 0.65rem !important;
    }

    .hero-glass-stat-card {
        right: 12px !important;
        bottom: 12px !important;
        padding: 0.55rem 0.85rem !important;
        border-radius: 14px !important;
        gap: 0.6rem !important;
    }

    .hero-glass-stat-card strong {
        font-size: 1.65rem !important;
    }

    .hero-glass-stat-card span {
        font-size: 0.68rem !important;
        line-height: 1.35 !important;
    }

    .hero-glass-warranty-badge {
        display: none !important;
    }

    .home-scroll {
        display: none !important;
    }
}

/* 4. 7-STAGE CONSTRUCTION JOURNEY ON MOBILE (< 768px) */
@media (max-width: 767.98px) {
    .build-story {
        padding: 40px 0 34px !important;
        overflow-x: clip !important;
    }

    .home-heading h2 {
        font-size: clamp(1.65rem, 6vw, 2.2rem) !important;
        line-height: 1.28 !important;
    }

    .section-desc {
        font-size: 0.92rem !important;
        line-height: 1.65 !important;
    }

    .journey-nav-controls {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        margin-top: 0.85rem !important;
    }

    .journey-nav-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 0.9rem !important;
    }

    .journey-nav-pill {
        font-size: 0.78rem !important;
        padding: 0.35rem 0.8rem !important;
    }

    .journey-timeline-bar {
        display: none !important;
    }

    .journey-track-wrapper {
        margin: 1.2rem 0 0 !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    /* Single Card Snap Carousel on Mobile */
    .journey-cards-track {
        display: flex !important;
        gap: 16px !important;
        padding: 8px 1rem 20px !important;
        scroll-padding: 0 1rem !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        overflow-x: auto !important;
    }

    .journey-stage-card {
        width: calc(100vw - 3.2rem) !important;
        min-width: 280px !important;
        max-width: 340px !important;
        flex-shrink: 0 !important;
        scroll-snap-align: center !important;
        border-radius: 20px !important;
        box-shadow: 0 10px 30px rgba(10, 39, 25, 0.08) !important;
    }

    .stage-card-media {
        height: 195px !important;
    }

    .stage-card-body {
        padding: 18px 16px !important;
    }

    .stage-card-title {
        font-size: 1.15rem !important;
        line-height: 1.35 !important;
        margin-bottom: 8px !important;
    }

    .stage-card-desc {
        font-size: 0.88rem !important;
        line-height: 1.65 !important;
        margin-bottom: 12px !important;
    }
}

/* 5. PROJECTS SHOWCASE ON MOBILE (< 768px) */
@media (max-width: 767.98px) {
    .home-projects {
        padding: 40px 0 !important;
        overflow-x: clip !important;
    }

    .home-project-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .home-project-card {
        border-radius: 20px !important;
        overflow: hidden !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08) !important;
    }

    .home-project-image {
        aspect-ratio: 16 / 10 !important;
        height: auto !important;
        max-height: 230px !important;
    }

    .home-project-body {
        padding: 1.15rem 1.25rem !important;
    }

    .home-project-title {
        font-size: 1.28rem !important;
    }

    .home-project-area {
        font-size: 1.1rem !important;
        font-weight: 800 !important;
    }
}

/* 6. STATS & HIGHLIGHTS GRID ON MOBILE (< 768px) */
@media (max-width: 767.98px) {
    .home-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1px !important;
        background: rgba(255, 255, 255, 0.12) !important;
    }

    .home-stats article {
        min-height: 120px !important;
        padding: 1.2rem 0.85rem !important;
        text-align: center !important;
    }

    .home-stats article strong {
        font-size: 2.1rem !important;
        line-height: 1.1 !important;
    }

    .home-stats article span {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
    }
}

/* 7. HEADQUARTERS & CONTACT CARD ON MOBILE (< 768px) */
@media (max-width: 767.98px) {
    .location-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .location-visual {
        min-height: 260px !important;
        max-height: 320px !important;
        height: 280px !important;
        border-radius: 18px !important;
        position: relative !important;
    }

    .location-visual a {
        font-size: 0.74rem !important;
        padding: 0.6rem 0.95rem !important;
        bottom: 0.75rem !important;
        right: 0.75rem !important;
    }

    .location-copy h2 {
        font-size: 1.85rem !important;
        margin-bottom: 0.85rem !important;
    }

    .location-copy ul {
        margin-bottom: 1.2rem !important;
    }

    .location-copy li {
        padding: 0.6rem 0 !important;
    }

    .location-copy div {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.65rem !important;
        width: 100% !important;
    }

    .location-copy div .btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 0.85rem !important;
    }
}

/* 8. FLOATING WHATSAPP & BACK-TO-TOP BUTTONS ON MOBILE */
@media (max-width: 767.98px) {
    .wa-float,
    .whatsapp-float,
    .floating-whatsapp {
        bottom: 18px !important;
        left: 16px !important;
        width: 52px !important;
        height: 52px !important;
        font-size: 27px !important;
        z-index: 9995 !important;
        box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4) !important;
    }

    .back-to-top {
        bottom: 18px !important;
        right: 16px !important;
        width: 44px !important;
        height: 44px !important;
        z-index: 9995 !important;
        background: rgba(10, 39, 25, 0.9) !important;
        backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
    }
}

/* 9. ULTRA COMPACT PHONES (< 360px) */
@media (max-width: 359.98px) {
    .home-hero h1 {
        font-size: 2.1rem !important;
    }

    .hero-trust-strip {
        grid-template-columns: 1fr !important;
    }

    .journey-stage-card {
        width: calc(100vw - 2.5rem) !important;
        min-width: 250px !important;
    }
}

/* 10. LUXURY ENGINEERING TEAM ON MOBILE */
@media (max-width: 767.98px) {
    .home-team {
        padding: 55px 0 !important;
    }

    .home-team .home-heading {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1.2rem !important;
        margin-bottom: 1.8rem !important;
    }

    .home-team .home-heading h2 {
        font-size: 1.85rem !important;
        line-height: 1.3 !important;
    }

    .team-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }

    .home-team-grid-v2 {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        gap: 1rem !important;
        padding: 0.5rem 0.5rem 2.2rem !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        margin: 0 -0.5rem !important;
    }

    .home-team-grid-v2::-webkit-scrollbar {
        display: none !important;
    }

    .home-team-card-v2 {
        flex: 0 0 78vw !important;
        max-width: 290px !important;
        scroll-snap-align: center !important;
        box-shadow: 0 10px 28px rgba(13, 61, 37, 0.08) !important;
    }

    .team-image-box {
        aspect-ratio: 0.82 !important;
    }

    .team-image-hover-overlay {
        opacity: 0 !important;
    }

    .team-mobile-swipe-hint {
        display: flex !important;
    }
}

/* ==========================================================================
   MOBILE OPTIMIZATIONS FOR FIELD VIDEO & LIGHTBOX
   ========================================================================== */
@media (max-width: 991.98px) {
    .hero-video-badge {
        top: 14px !important;
        right: 14px !important;
        bottom: auto !important;
        left: auto !important;
        padding: 6px 12px 6px 8px !important;
        gap: 8px !important;
    }

    .hero-play-pulse {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }

    .hero-video-badge-text strong {
        font-size: 0.76rem !important;
    }

    .hero-video-badge-text small {
        font-size: 0.65rem !important;
    }

    .btn-hero-video {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.88rem !important;
    }

    .field-video-showcase-section {
        padding: 50px 0 !important;
    }

    .field-video-card {
        padding: 28px 18px !important;
        border-radius: 20px !important;
    }

    .field-video-copy h2 {
        font-size: 1.5rem !important;
        line-height: 1.35 !important;
    }

    .field-video-copy p {
        font-size: 0.9rem !important;
        line-height: 1.65 !important;
    }

    .field-video-btns {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.75rem !important;
    }

    .field-video-btns .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.85rem 1.2rem !important;
        font-size: 0.92rem !important;
    }

    .play-trigger-circle {
        width: 66px !important;
        height: 66px !important;
    }

    .play-icon-box {
        width: 58px !important;
        height: 58px !important;
        font-size: 1.3rem !important;
    }

    .video-modal-overlay {
        padding: 10px !important;
    }

    .video-modal-box {
        border-radius: 16px !important;
        max-height: 94vh !important;
    }

    .video-modal-header {
        padding: 12px 16px !important;
    }

    .video-modal-title {
        font-size: 0.88rem !important;
        line-height: 1.3 !important;
    }

    .video-modal-subtitle {
        font-size: 0.72rem !important;
    }

    .video-modal-footer {
        padding: 12px 16px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .video-modal-prompt {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
    }

    .video-modal-actions {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
    }

    .video-modal-actions .btn {
        flex: 1 !important;
        text-align: center !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .hero-video-badge {
        max-width: 145px !important;
    }

    .hero-video-badge-text small {
        display: none !important;
    }

    .hero-video-badge-text strong {
        font-size: 0.72rem !important;
    }
}


