/* --- START Custom Mobile Header Layout --- */

/* 1. HIDE THE CUSTOM HEADER ON DESKTOP & TABLET */
@media (min-width: 922px) {
    #sketchbooks-mobile-masthead {
        display: none !important;
    }
}

/* 2. MOBILE LAYOUT (Applies to screens 921px and smaller) */
@media (max-width: 921px) {
    
    /* Ensure Astra's default header is hidden for all edge cases */
    #ast-mobile-header {
        display: none !important;
    }
    #sketchbooks-menu-toggle{
        background-color: #ffffff;
        color: #333;
    }
    /* Make sure our custom header is visible and styled */
    #sketchbooks-mobile-masthead {
          display: block !important;
        width: 100%;
      background: #ffffff;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
        position: relative;
        z-index: 99;

    }
    
    /* Apply Flexbox to the bar container for L-C-R layout */
    .sketchbooks-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0 20px;
    }
    
    /* L-C-R Ordering */
    .sketchbooks-mobile-bar .mobile-left { order: 1; flex-grow: 0; flex-shrink: 0; }
    .sketchbooks-mobile-bar .mobile-center { order: 2; flex-grow: 1; text-align: center; padding: 0 10px; }
    .sketchbooks-mobile-bar .mobile-right { order: 3; flex-grow: 0; flex-shrink: 0; }
    
    .mobile-center .site-title a{
        font-family: Helvetica, sans-serif;
        text-transform: uppercase;
        font-size: .9rem;
    }
    /* Basic styling for the menu button */
    .menu-toggle {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 24px;
        line-height: 1;
        padding: 5px;
        color: #333;
    }

    /* Account Icon Styling */
    .mobile-right .account-icon {
        width: 24px;
        height: 24px;
        fill: #333;
    }
    
    /* --- HAMBURGER ICON STYLES (Simple Visibility) --- */
    
    /* 1. Sizing for the Toggle Container (Fixes squishing) */
    .mobile-menu-toggle-icon {
        display: block;
        position: relative; 
        width: 24px;  
        height: 20px; 
    }
    .mobile-menu-toggle-icon .ahfb-svg-iconset {
        position: absolute; 
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0; 
    }
    
    /* 2. FORCE VISIBILITY: Hide the Close (X) icon permanently */
    .ast-close-svg {
        display: none !important;
    }

    /* 3. FORCE VISIBILITY: Ensure the Hamburger icon is always visible */
    .ast-menu2-svg {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important; 
    }
    
    /* --- MENU DROPDOWN CONTAINER --- */
    
    /* CRITICAL: This is the primary menu wrapper. It starts hidden for JS slideToggle. */
    #sketchbooks-primary-menu-wrap {
        display: none; /* Menu must start hidden! */
        width: 100%;
        background-color: #f7f7f7;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    /* 1. Base Menu List Styling */
    #sketchbooks-primary-menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    /* 2. Style all List Items (LIs) */
    #sketchbooks-primary-menu li {
        border-bottom: 1px solid #ddd;
        position: relative; /* Needed for positioning the dropdown toggle */
    }

    /* 2.5 ADD HOVER EFFECT HERE */
    #sketchbooks-primary-menu li:hover {
        background-color: #dbdbdb; /* Light gray color for hover */
    }
    /* 2.7. Style for the Active Menu Item Indicator (Red Bar on Left) */
    #sketchbooks-primary-menu li.current-menu-item {
        /* Set the background on the LI (optional, but can look nice) */
        /* background-color: #f7f7f7; */
    }

    /* Use a pseudo-element on the active link to create the vertical bar */
    #sketchbooks-primary-menu li.current-menu-item > a:before,
    #sketchbooks-primary-menu li.current-menu-item > a {
        position: relative; /* Ensure position for the pseudo-element to work */
    }

    #sketchbooks-primary-menu li.current-menu-item > a:before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        /* --- Your Desired Color and Thickness --- */
        width: 5px; /* Adjust thickness of the bar */
        height: 100%;
        background-color: #E91E63; /* Use a red/pink color (adjust as needed) */
        z-index: 100;
    }
    /* 3. Style Menu Links (A) */
    #sketchbooks-primary-menu li a {
        display: block;
        padding: 12px 40px;
        text-decoration: none;
        color: #333;
        font-weight: 500;
    }

   /* --- SUB-MENU ACCORDION STYLES (New simplified targets) --- */

/* 4. Sub-menu UL styling (Initial Hide for Accordion) */
#sketchbooks-primary-menu .sub-menu {
    list-style: none;
    padding: 0 0 0 40px; /* Indent sub-menus */
    margin: 0;
    background-color: #f0f0f0; /* Lighter background for children */
}

/* 5. Style the Sub-menu Links */
#sketchbooks-primary-menu .sub-menu li a {
    padding: 8px 10px; 
    font-size: 0.95em;
    font-weight: normal;
    border: none;
}

/* 6. Style the Dropdown Toggle Icon (the chevron) */
/* Targets the anchor tag inside a LI that has children */
#sketchbooks-primary-menu .menu-item-has-children > a {
    /* position: relative;  */
}

/* 7. Add the chevron icon using a pseudo-element on the parent link */
#sketchbooks-primary-menu .menu-item-has-children > a:after {
    /* content: "\2304";
    position: absolute; */

/* *** CHANGE 1: Move from right: 20px to left: 20px *** */
    /* left: 20px;
    right: auto;  */
    /* Ensure it doesn't conflict with any residual right setting */
    
    top: 0;
    line-height: 44px; /* Matches link height for vertical alignment */
    font-size: 20px;
    color: #555;
    transition: transform 0.3s ease;
    cursor: pointer;
}

/* 8. Rotate the chevron when the parent LI has the 'menu-open' class */
/* We will add this class via JavaScript */
#sketchbooks-primary-menu .menu-item-has-children.menu-open > a:after {
    transform: rotate(180deg); 
}
}
/* --- END Custom Mobile Header Layout --- */