/* ============================================
   Creative Wealth - Mobile CSS Override
   Loaded last — highest priority
   ============================================ */

@media screen and (max-width: 1200px) {

    /* ---- Show hamburger icon ---- */
    .mobile-toggle {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        cursor: pointer !important;
        padding: 8px !important;
        z-index: 9999 !important;
        position: relative !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
    }

    .mobile-toggle span {
        display: block !important;
        width: 26px !important;
        height: 3px !important;
        background: #0f172a !important;
        border-radius: 3px !important;
        transition: all 0.3s ease !important;
    }

    /* Animate hamburger to X when open */
    .mobile-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg) !important;
    }
    .mobile-toggle.active span:nth-child(2) {
        opacity: 0 !important;
        transform: scaleX(0) !important;
    }
    .mobile-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg) !important;
    }

    /* ---- Header container must be above overlay ---- */
    .header-main {
        z-index: 9000 !important;
    }

    /* ---- Side drawer menu (slides from right) ---- */
    .nav-menu {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        width: 75vw !important;
        max-width: 300px !important;
        height: 100vh !important;
        background: #ffffff !important;
        padding: 70px 25px 40px !important;
        z-index: 9500 !important;   /* inside header-main stacking context */
        box-shadow: -4px 0 25px rgba(0, 0, 0, 0.25) !important;
        overflow-y: auto !important;
        gap: 0 !important;
        align-items: stretch !important;
        transform: translateX(110%) !important;
        transition: transform 0.35s ease !important;
        pointer-events: none !important;
    }

    .nav-menu.active {
        transform: translateX(0) !important;
        pointer-events: all !important;
    }

    /* ---- Menu list items ---- */
    .nav-menu > li {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        position: static !important;
    }

    .nav-menu > li > a {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding: 15px 0 !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        color: #0f172a !important;
        border-bottom: 1px solid #e2e8f0 !important;
        background: transparent !important;
    }

    .nav-menu > li > a:hover {
        color: #10b981 !important;
    }

    /* ---- Dropdown sub-menus ---- */
    .nav-menu .dropdown-menu {
        position: static !important;
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 5px 0 5px 15px !important;
        background: transparent !important;
        width: 100% !important;
        border-radius: 0 !important;
    }

    .nav-menu .dropdown.active > .dropdown-menu {
        display: block !important;
    }

    .nav-menu .dropdown-menu li {
        margin: 0 !important;
    }

    .nav-menu .dropdown-menu a {
        display: block !important;
        padding: 9px 0 !important;
        font-size: 0.85rem !important;
        font-weight: 500 !important;
        color: #64748b !important;
        border-bottom: 1px solid #f1f5f9 !important;
        background: transparent !important;
    }

    /* ---- Header bar heights ---- */
    .nav-master {
        height: 65px !important;
    }

    .nav-spacer {
        height: 110px !important;
    }

    .nav-inner {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 5px !important;
    }

    /* ---- Hide phone/email in ticker ---- */
    .ticker-contact {
        display: none !important;
    }
}

/* ---- Overlay: MUST be below header-main z-index (9000) ---- */
.nav-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 8500;           /* below header-main: 9000 */
    pointer-events: none;
}

.nav-overlay.active {
    display: block !important;
    pointer-events: all !important;
}

/* ---- Small phone tweaks ---- */
@media screen and (max-width: 480px) {
    .logo-wealth,
    .logo-records {
        font-size: 1.05rem !important;
    }
    .logo-domain {
        font-size: 0.65rem !important;
    }
    .nav-master {
        height: 60px !important;
    }
    .nav-spacer {
        height: 105px !important;
    }
}

/* ---- General Mobile Overrides (<768px) ---- */
@media screen and (max-width: 768px) {
    /* Spacing & Fluid Padding */
    .section,
    .calculator-section,
    #home-cta {
        padding: 40px 0 !important;
    }

    .container {
        padding: 0 20px !important;
    }

    /* Clutter Reduction: Hide Sticky Contact vertical tab */
    .sticky-contact-btn {
        display: none !important;
    }

    /* Subdue Floating Buttons & Overlapping Elements */
    .whatsapp-fab {
        bottom: 20px !important;
        left: 20px !important;
        padding: 10px 18px !important;
        font-size: 0.85rem !important;
        box-shadow: 0 6px 18px rgba(37,211,102,0.2) !important;
    }

    .whatsapp-fab span {
        font-size: 0.85rem !important;
    }

    .chatbot-trigger {
        bottom: 20px !important;
        right: 20px !important;
        width: 50px !important;
        height: 50px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
    }

    .chatbot-trigger i {
        font-size: 1.2rem !important;
        margin: 0 !important;
    }

    .chatbot-container {
        bottom: 85px !important;
        right: 20px !important;
        left: 20px !important;
        width: auto !important;
        max-width: none !important;
        height: calc(100vh - 170px) !important;
        border-radius: 20px !important;
    }

    /* Fluid Typography Scaling */
    h1, .hero h1, .hero-content-left h1, .page-hero h1 {
        font-size: 2.1rem !important;
        line-height: 1.2 !important;
        letter-spacing: -0.5px !important;
    }

    h2, .section-header h2 {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
        letter-spacing: -0.5px !important;
    }

    h3 {
        font-size: 1.35rem !important;
    }

    .hero p, .page-hero p, .hero-content-left p {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }

    /* Process steps stack vertically */
    .process-steps-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .process-step {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Hide large icons/illustrations from CTA on mobile to save space */
    .cta-grid div:last-child {
        display: none !important;
    }
    
    .cta-grid {
        grid-template-columns: 1fr !important;
        text-align: center !important;
    }

    .cta-grid h2 {
        font-size: 2.1rem !important;
        line-height: 1.2 !important;
    }

    /* Form styling and buttons on mobile */
    .btn {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 0.95rem !important;
    }

    .cta-grid div style, .hero-buttons {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }
}
