/* =======================================================
   MOBILE HEADER BAR (Widget Native Layout)
   ======================================================= */
.box-mobile-header-wrapper {
    width: 100%;
    font-family: var(--e-global-typography-primary-font-family), "AeonikPro", Sans-serif;
}

.box-mobile-header-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
   
}

/* Left: Hamburger */
.mobile-menu-trigger {
    grid-column: 1;
    justify-self: start;
    background: transparent;
    border: none;
    padding: 10px 0;
    cursor: pointer;
}
.header-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 25px;
    height: 25px; /* Match X button height */
}
.header-hamburger span {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: #000;
    transition: background-color 0.3s;
}
/* Center: Logo & Placeholder Fix */
.mobile-header-logo {
    grid-column: 2;
    justify-self: center;
    display: block;
    text-decoration: none;
    text-align: center;
    width: 100%;
}
.mobile-header-logo img {
    height: 22px !important; /* Strict height prevents SVGs from collapsing */
    width: auto !important;
    max-width: 170px; 
    margin: 0 80px 0 0; /* 0 auto Ensures perfect centering */
    display: block;
    object-fit: contain;
}

/* Right: Cart */
.mobile-cart-trigger {
    grid-column: 3;
    justify-self: end;
    background: transparent;
    border: none;
    padding: 10px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    color: #000;
    display: flex;
    align-items: center;
   
}

body.box-header-white .header-hamburger span { background-color: #fff; }
body.box-header-white .mobile-header-logo img { filter: invert(1) brightness(2); }
body.box-header-white .mobile-cart-trigger { color: #fff; }

/* After scrolling past hero: restore mobile elements to black */
body.box-header-white [data-elementor-type="header"]:has(.is-scrolled) .mobile-header-logo img { filter: none !important; }
body.box-header-white [data-elementor-type="header"]:has(.is-scrolled) .header-hamburger span { background-color: #000 !important; }
body.box-header-white [data-elementor-type="header"]:has(.is-scrolled) .mobile-cart-trigger { color: #000 !important; }


/* =======================================================
   FULL SCREEN OVERLAY MENU
   ======================================================= */
.mobile-mega-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    /* 1. Fallback for older browsers */
    height: 100vh; 
    /* 2. Modern Fix: Dynamic Viewport Height accounts for URL bars */
    height: 100dvh; 
    background-color: #F7F7F7; 
    z-index: 999999;
    display: flex;
    flex-direction: column;
    color: #000;
}
/* 3. iOS Safari Specific Override */
@supports (-webkit-touch-callout: none) {
    .mobile-mega-menu-overlay {
        height: -webkit-fill-available;
    }
}
/* X Button - Top Left */
.mobile-menu-header-bar {
    position: absolute;
    top: 25px;
    left: 20px; 
    z-index: 10;
}

.mobile-fs-close {
    background: transparent;
    border: none;
    width: 25px; 
    height: 25px;
    position: relative;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-fs-close span {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: #000;
    position: absolute;
    top: 50%;
    left: 0;
    margin-top: -0.75px; /* Perfect pixel offset */
}
.mobile-fs-close span:nth-child(1) { transform: rotate(45deg); }
.mobile-fs-close span:nth-child(2) { transform: rotate(-45deg); }


/* --- 2-Column Grid Inside Overlay --- */
.mobile-mega-menu-container {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    overflow: hidden;
    padding-top: 75px; /* Align content perfectly below the X */
}
/* Strict Typography Reset to prevent bloating */
.mobile-mega-menu-container a {
    text-transform: uppercase;
    text-decoration: none;
    color: #000;
    line-height: 1; 
    transition: opacity 0.2s;
    font-family: var(--e-global-typography-primary-font-family), "AeonikPro", Sans-serif;
    display: block;
}
.mobile-mega-menu-container a:hover { text-decoration:underline; }

/* Left Column (Main Nav) */
.mobile-fs-sidebar {
    width: 45%; 
    max-width: 150px;
    padding: 10px 10px calc(20px + env(safe-area-inset-bottom)) 20px;
    display: flex;
    flex-direction: column;
    height: 100%; 
    overflow-y: auto;
    border-right: none; 
}

/* Tight Navigation Groups */
.mobile-fs-sidebar .fs-main-nav,
.mobile-fs-sidebar .fs-utility-nav,
.mobile-fs-sidebar .fs-secondary-nav {
    display: flex;
    flex-direction: column;
    gap: 14px; /* Exact match to mockup gap */
    margin: 0;
    padding: 0;
}

/* Specific Block Spacing */
.mobile-fs-sidebar .fs-main-nav {
    margin-bottom: 40px; /* Space between Projects and Search */
}
.mobile-fs-sidebar .fs-secondary-nav {
    margin-top: auto; /* Forces this block to the absolute bottom */
}

/* Left Typography Matches */
.mobile-fs-sidebar .fs-main-link { 
    font-size: 16px; 
    font-weight: 400;
}
.mobile-fs-sidebar .fs-sec-link, 
.mobile-fs-sidebar .fs-util-link { 
    font-size: 14px; 
    font-weight: 400; 
}


/* Right Column (Categories) */
.mobile-fs-content {
    width: 75%;
    padding: 13px 20px 20px 15px;
    overflow-y: auto;
}

/* Ensure left and right columns start at the exact same horizontal line */
.mobile-fs-content > .mobile-category-grid,
.mobile-fs-sidebar > .fs-main-nav {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.mobile-cat-group {
    margin-bottom: 30px; /* Space between different parent categories */
    display: flex;
    flex-direction: column;
    gap: 12px; /* Very tight gap for child items */
	overflow:hidden;
}

/* Right Typography Matches */
.mobile-cat-title { 
    font-size: 18px; 
    font-weight: 500; 
    text-transform: uppercase; 
    margin-bottom: 4px; /* Small break before children list starts */
}
.mobile-cat-link { 
    font-size: 14px; 
    font-weight: 400;
}

body.mobile-menu-open { overflow: hidden; }

