@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
    --ybm-bg: hsla(220, 8%, 20%, 0.95);         
    --ybm-mega-bg: #111213;                     
    --ybm-primary: hsl(152, 100%, 30%);         
    --ybm-text: hsla(210, 20%, 98%, 0.9);       
    --ybm-muted: hsl(158, 3%, 84%);             
    --ybm-border: hsla(220, 13%, 87%, 0.2);     
    --ybm-border-heavy: hsla(220, 13%, 87%, 0.3); 
}

/* Enforce Strict Box Sizing to prevent layout shifting */
.ybm-template-header *, .ybm-template-header *::before, .ybm-template-header *::after {
    box-sizing: border-box !important;
}

/* Reset WP garbage */
.ybm-template-header ul, .ybm-template-header li { list-style: none !important; margin: 0 !important; padding: 0 !important; border: none !important; text-indent: 0 !important; }
.ybm-template-header a { text-decoration: none !important; box-shadow: none !important; background: transparent !important; outline: none !important; }
.ybm-template-header ul > li::before, .ybm-template-header ul > li::after { content: none !important; display: none !important; }

/* Header Bar */
.ybm-template-header {
    position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; z-index: 9999 !important;
    background-color: var(--ybm-bg) !important; 
    backdrop-filter: blur(12px) !important; border-bottom: 1px solid var(--ybm-border) !important;
    height: 80px !important; display: flex !important; align-items: center !important; font-family: 'Inter', sans-serif !important;
}

.ybm-container { max-width: 1400px !important; margin: 0 auto !important; padding: 0 20px !important; width: 100% !important; }

/* Navbar Anchor */
.ybm-navbar { display: flex !important; justify-content: space-between !important; align-items: center !important; height: 100% !important; position: relative !important; }

/* Logo */
.ybm-brand { display: flex !important; align-items: center !important; gap: 8px !important; }
img.ybm-logo-img { height: 48px !important; width: auto !important; display: block !important; object-fit: contain !important; }

/* --- TOP LEVEL NAV & DESKTOP ACTIONS --- */
.ybm-nav-desktop, 
.ybm-navbar > .ybm-actions { display: none !important; } /* Hides both the nav and the desktop button on mobile */

@media (min-width: 1024px) { 
    .ybm-nav-desktop { display: block !important; height: 100% !important; position: static !important; }
    .ybm-navbar > .ybm-actions { display: flex !important; } /* Reveals the button only on desktop */
}

/* HOVER BUG FIX #1: Use 'align-items: stretch' to make hit-boxes span the full 80px height */
ul.ybm-menu-list { display: flex !important; align-items: stretch !important; gap: 8px !important; height: 100% !important; position: static !important; }

/* Top level list items */
ul.ybm-menu-list > li.menu-item { position: relative !important; display: flex !important; align-items: center !important; }

/* Mega Menu items MUST be static for centering */
ul.ybm-menu-list > li.is-mega-4 { position: static !important; }

/* Main Nav Links */
ul.ybm-menu-list > li.menu-item > a {
    display: flex !important; align-items: center !important; gap: 8px !important; padding: 10px 16px !important;
    color: var(--ybm-text) !important; font-family: 'Inter', sans-serif !important; font-weight: 500 !important; 
    font-size: 16px !important; transition: color 0.2s !important; cursor: pointer !important; height: 100% !important;
}
ul.ybm-menu-list > li.menu-item > a:hover { color: var(--ybm-primary) !important; }
.ybm-chevron { width: 18px !important; height: 18px !important; transition: transform 0.2s !important; opacity: 0.7 !important; }
ul.ybm-menu-list > li.menu-item:hover .ybm-chevron { transform: rotate(180deg) !important; }


/* --- GENERAL DROPDOWN WRAPPER --- */
ul.ybm-menu-list > li.menu-item > ul.sub-menu {
    position: absolute !important; 
    top: 80px !important; 
    background-color: var(--ybm-mega-bg) !important; 
    border: 1px solid var(--ybm-border-heavy) !important; border-radius: 12px !important; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    opacity: 0 !important; visibility: hidden !important; transform: translateY(10px) !important; transition: all 0.2s ease !important;
    width: 260px !important; padding: 12px !important; display: flex !important; flex-direction: column !important; gap: 4px !important;
    pointer-events: none !important; 
    z-index: 100 !important;
}

/* HOVER BUG FIX #2: The Invisible Bridge. This projects 30px upwards to catch the mouse perfectly. */
ul.ybm-menu-list > li.menu-item > ul.sub-menu::before {
    content: '' !important;
    position: absolute !important;
    top: -30px !important; 
    left: 0 !important;
    right: 0 !important;
    height: 30px !important;
    background: transparent !important;
    display: block !important;
}

ul.ybm-menu-list > li.menu-item:hover > ul.sub-menu { 
    opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; 
    pointer-events: auto !important; 
}


/* --- CAPABILITIES: 4-COLUMN MEGA MENU --- */
ul.ybm-menu-list > li.is-mega-4 > ul.sub-menu {
    width: 1050px !important; 
    left: 50% !important; transform: translateX(-50%) translateY(10px) !important;
    display: grid !important; 
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important; 
    gap: 32px !important; 
    padding: 32px !important; 
    margin: 0 !important;
}
ul.ybm-menu-list > li.is-mega-4:hover > ul.sub-menu { transform: translateX(-50%) translateY(0) !important; }

/* Reset WP margins for first items */
ul.ybm-menu-list > li.is-mega-4 > ul.sub-menu > li.menu-item,
ul.ybm-menu-list > li.is-mega-2 > ul.sub-menu > li.menu-item { 
    border: none !important; padding: 0 !important; margin: 0 !important; transform: none !important; 
}


/* --- SOLUTIONS: 1-COLUMN STACKED (FIXED ALIGNMENT) --- */
ul.ybm-menu-list > li.is-mega-2 > ul.sub-menu {
    width: 360px !important; 
    left: 0 !important;
    transform: translateY(10px) !important;
    padding: 0 !important; display: flex !important; flex-direction: column !important; gap: 0 !important;
}
ul.ybm-menu-list > li.is-mega-2:hover > ul.sub-menu { transform: translateY(0) !important; }
ul.ybm-menu-list > li.is-mega-2 > ul.sub-menu > li.menu-item { padding: 24px !important; border-top: 1px solid var(--ybm-border) !important; margin: 0 !important; }
ul.ybm-menu-list > li.is-mega-2 > ul.sub-menu > li.menu-item:first-child { border-top: none !important; }


/* --- SIMPLE DROPDOWNS (Resources / About) --- */
ul.ybm-menu-list > li:not(.is-mega-4):not(.is-mega-2) > ul.sub-menu {
    left: 0 !important; 
}


/* --- LEVEL 2 HEADERS (Column Titles) --- */
ul.ybm-menu-list > li.is-mega-4 > ul.sub-menu > li.menu-item > a,
ul.ybm-menu-list > li.is-mega-2 > ul.sub-menu > li.menu-item > a {
    color: var(--ybm-muted) !important; 
    font-size: 13px !important; 
    text-transform: uppercase !important;
    font-family: 'JetBrains Mono', monospace !important; font-weight: 500 !important;
    letter-spacing: 0.08em !important; 
    margin: 0 0 20px 0 !important; 
    padding: 0 !important;
    display: flex !important; align-items: center !important; justify-content: flex-start !important; gap: 10px !important;
    pointer-events: none !important; background: transparent !important; width: 100% !important;
}


/* --- LEVEL 3 LINKS (The actual pages) --- */
ul.ybm-menu-list .sub-menu .sub-menu {
    position: static !important; padding: 0 !important; background: transparent !important; 
    transform: none !important; display: flex !important; flex-direction: column !important; gap: 6px !important; 
    border: none !important; width: 100% !important; box-shadow: none !important; margin: 0 !important;
    pointer-events: auto !important;
}

ul.ybm-menu-list .sub-menu .sub-menu > li.menu-item > a {
    color: var(--ybm-text) !important; 
    font-size: 15px !important; 
    font-family: 'Inter', sans-serif !important; font-weight: 400 !important; 
    padding: 8px 0 !important; margin: 0 !important;
    display: flex !important; align-items: center !important; gap: 12px !important; 
    width: 100% !important; text-transform: none !important; transition: color 0.2s !important; 
    border-radius: 0 !important; background: transparent !important;
}
ul.ybm-menu-list .sub-menu .sub-menu > li.menu-item > a:hover { color: var(--ybm-primary) !important; }


/* Hover Line (Animated green bar) */
.hover-line {
    display: block !important; width: 0 !important; height: 2px !important; 
    background-color: var(--ybm-primary) !important; transition: all 0.2s ease !important; margin-right: 0 !important; flex-shrink: 0 !important;
}
ul.ybm-menu-list .sub-menu .sub-menu > li.menu-item > a:hover .hover-line,
ul.ybm-menu-list > li:not(.is-mega-4):not(.is-mega-2) > ul.sub-menu > li.menu-item > a:hover .hover-line { 
    width: 10px !important; margin-right: 6px !important; 
}


/* Link Icons */
.link-icon { width: 18px !important; height: 18px !important; color: var(--ybm-muted) !important; transition: color 0.2s !important; flex-shrink: 0 !important; }
ul.ybm-menu-list .sub-menu .sub-menu > li.menu-item > a:hover .link-icon,
ul.ybm-menu-list > li:not(.is-mega-4):not(.is-mega-2) > ul.sub-menu > li.menu-item > a:hover .link-icon { color: var(--ybm-primary) !important; }


/* Simple Dropdown Links (Resources/About) */
ul.ybm-menu-list > li:not(.is-mega-4):not(.is-mega-2) > ul.sub-menu > li.menu-item > a {
    color: var(--ybm-text) !important; font-size: 15px !important; padding: 12px 16px !important; font-family: 'Inter', sans-serif !important; font-weight: 400 !important;
    display: flex !important; align-items: center !important; gap: 10px !important; transition: all 0.2s !important; border-radius: 8px !important; background: transparent !important;
    width: 100% !important; margin: 0 !important;
}
ul.ybm-menu-list > li:not(.is-mega-4):not(.is-mega-2) > ul.sub-menu > li.menu-item > a:hover {
    color: var(--ybm-primary) !important; background-color: hsla(220, 8%, 20%, 0.5) !important;
}

/* --- NUCLEAR LOVABLE BUTTON OVERRIDE (WITH GRADIENT HOVER) --- */
.ybm-template-header .ybm-actions a.ybm-btn-primary { 
    position: relative !important; /* Required for the gradient overlay */
    z-index: 1 !important;
    overflow: hidden !important; /* Keeps the gradient inside the rounded corners */
    background-color: #009952 !important; /* Base solid color */
    color: #ffffff !important; 
    height: 44px !important; 
    padding: 0 24px !important; 
    border-radius: 8px !important; 
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important;
    gap: 8px !important; 
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important; 
    font-weight: 600 !important; 
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    line-height: 1 !important;
}

/* 1. The Hidden Gradient Layer */
.ybm-template-header .ybm-actions a.ybm-btn-primary::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    /* The Lovable Hover Gradient (adjust angles/colors if needed) */
    background: linear-gradient(135deg, #00c853 0%, #00963e 100%) !important; 
    z-index: -1 !important; /* Places it behind the text */
    opacity: 0 !important; /* Hidden by default */
    transition: opacity 0.3s ease !important; /* Smooth fade-in */
}

/* 2. The Hover Reveal & Lift */
.ybm-template-header .ybm-actions a.ybm-btn-primary:hover::before { 
    opacity: 1 !important; /* Reveals gradient */
}

.ybm-template-header .ybm-actions a.ybm-btn-primary:hover { 
    transform: translateY(-2px) !important; /* More pronounced premium lift */
    box-shadow: 0 6px 16px rgba(0, 200, 83, 0.35) !important; /* Soft green glowing shadow */
}

/* Force the text inside the button to behave */
.ybm-template-header .ybm-actions a.ybm-btn-primary span {
    color: #ffffff !important;
    font-weight: 600 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}

/* Force the Send Icon to be perfectly sized */
.ybm-template-header .ybm-actions a.ybm-btn-primary svg,
.ybm-template-header .ybm-actions a.ybm-btn-primary i { 
    color: #ffffff !important; 
    width: 18px !important; 
    height: 18px !important; 
    stroke-width: 2.5 !important; 
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* Mobile */
.ybm-mobile-toggle { display: block !important; background: transparent !important; border: none !important; color: white !important; cursor: pointer !important; padding: 8px !important;}
@media (min-width: 1024px) { .ybm-mobile-toggle { display: none !important; } }
.ybm-mobile-overlay { position: fixed !important; top: 80px !important; left: 0 !important; right: 0 !important; bottom: 0 !important; background-color: var(--ybm-mega-bg) !important; transform: translateX(100%) !important; transition: transform 0.3s ease !important; padding: 20px !important; overflow-y: auto !important; z-index: 9998 !important; }
.ybm-mobile-overlay.active { transform: translateX(0) !important; }

/* =========================================
   MOBILE MENU (ISOLATED FROM OCEANWP)
   ========================================= */

/* Ensure the overlay takes up the full screen and stays dark */
.ybm-mobile-overlay {
    background-color: var(--ybm-mega-bg) !important; 
    height: calc(100vh - 80px) !important;
}

ul.ybm-mobile-nav {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding: 0 0 40px 0 !important;
    margin: 0 !important;
}

ul.ybm-mobile-nav li {
    width: 100% !important;
    position: relative !important;
}

/* Top-level Links */
ul.ybm-mobile-nav > li > a {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 0 !important;
    border-bottom: 1px solid var(--ybm-border-heavy) !important;
    color: var(--ybm-text) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    background: transparent !important;
}

ul.ybm-mobile-nav > li > a i:first-child {
    margin-right: 12px !important;
}

.ybm-mobile-nav .ybm-chevron {
    margin-left: auto !important;
    transition: transform 0.3s ease !important;
}
.ybm-mobile-nav .rotate-180 {
    transform: rotate(180deg) !important;
}

/* Sub-menus Container (The Dropdown) */
.mob-sub-menu {
    display: none; /* Let jQuery handle the sliding */
    flex-direction: column !important;
    padding: 0 0 16px 16px !important;
    margin: 0 !important;
    background: transparent !important; /* No more white blocks! */
    box-shadow: none !important;
    border: none !important;
}

/* Level 2 Headers (e.g., "Engineering Services") */
ul.ybm-mobile-nav li.is-mega-4 > .mob-sub-menu > li > a,
ul.ybm-mobile-nav li.is-mega-2 > .mob-sub-menu > li > a {
    color: var(--ybm-muted) !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    font-family: 'JetBrains Mono', monospace !important;
    letter-spacing: 0.08em !important;
    padding: 24px 0 8px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    pointer-events: none !important;
    background: transparent !important;
}

/* Level 3 Nested Links (The actual pages) */
.mob-sub-menu .mob-sub-menu {
    display: flex !important; /* Always show links under the headers */
    flex-direction: column !important;
    gap: 12px !important;
    padding: 8px 0 16px 16px !important;
    border-left: 1px solid var(--ybm-border-heavy) !important;
    margin-left: 8px !important;
}

.mob-sub-menu .mob-sub-menu > li > a,
ul.ybm-mobile-nav > li:not(.is-mega-4):not(.is-mega-2) > .mob-sub-menu > li > a {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    color: var(--ybm-text) !important;
    font-size: 14.5px !important;
    opacity: 0.8 !important;
    padding: 6px 0 !important;
    background: transparent !important;
}

/* Hide desktop-only visual elements */
ul.ybm-mobile-nav .hover-line,
ul.ybm-mobile-nav .mob-sub-menu::before {
    display: none !important;
}
@media (min-width: 1024px) {
    #ybm-mobile-overlay,
    .ybm-mobile-overlay {
        display: none !important;
        visibility: hidden !important;
    }
}
/* =========================================
   MOBILE "START PROJECT" BUTTON STYLES
   ========================================= */

/* Add space above the button and align it */
.ybm-mobile-actions {
    margin-top: 32px !important;
    padding-bottom: 40px !important;
    display: flex !important;
    width: 100% !important;
}

/* Force the mobile button to span 100% width */
.ybm-mobile-canvas .ybm-actions a.ybm-btn-primary {
    width: 100% !important;
    justify-content: center !important;
    display: flex !important;
}

/* Ensure the send icon is visible and spaced correctly inside the mobile button */
.ybm-mobile-canvas .ybm-actions a.ybm-btn-primary i {
    margin-right: 8px !important;
}