/* assets/css/custom-header.css */

/* =========================================
   ASTRA HEADER GLOW-UP - AGGRESSIVE OVERRIDES
   ========================================= */

/* --- 1. FIXED HEADER & EXTREME HEIGHT REDUCTION --- */
header#masthead,
.site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

/* FIX TOP PAGE SPACING: Push the main site content down */
.site-content, 
#content {
    padding-top: 80px !important; 
}

body.admin-bar header#masthead,
body.admin-bar .site-header {
    top: 32px !important;
}
@media screen and (max-width: 782px) {
    body.admin-bar header#masthead,
    body.admin-bar .site-header {
        top: 46px !important;
    }
}

header#masthead .ast-main-header-wrap,
header#masthead .ast-primary-header-bar,
header#masthead .ast-builder-grid-row,
header#masthead .site-primary-header-wrap {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    min-height: 55px !important;
    height: 55px !important;
}

header#masthead .ast-builder-grid-row {
    align-items: center !important;
}

/* --- 2. LOGO & SITE TITLE SPACING (USER ADJUSTED) --- */
.ast-site-identity {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important; /* User requested gap */
    padding: 0 !important;
    margin: 0 !important;
}

/* Strip any margin Astra adds to the logo wrapper */
.site-logo-img,
.custom-logo-link {
    margin-right: 0 !important;
    padding-right: 0 !important;
    display: flex;
}

.site-logo-img img {
    max-width: 32px !important; 
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.3s ease !important; 
}

/* Logo Hover Movement */
.site-logo-img img:hover {
    transform: scale(1.08) rotate(-2deg) !important; 
}

.site-title {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.site-title a {
    font-family: 'Montserrat', system-ui, sans-serif !important;
    font-size: 18px !important; 
    font-weight: 700 !important;
    color: #333 !important;
    letter-spacing: -0.5px !important;
    text-decoration: none !important;
    line-height: 1 !important;
    transition: color 0.2s ease !important;
}

.site-title a:hover {
    color: #ed4e34 !important; 
}

/* --- 3A. MENU DROPDOWN GLOW-UP (RESTORED & FIXED) --- */

/* --- 3A. MENU DROPDOWN GLOW-UP (RESTORED & FIXED) --- */
@media (min-width: 959px) { 
    .main-navigation ul.sub-menu {
        background-color: #ffffff;
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
        border: 1px solid #f0f0f0;
        padding: 8px 0;
        min-width: 200px;
        margin-top: 0 !important; /* CRITICAL: Remove margin */
        top: calc(100% + 15px) !important; /* Push down visually instead */
        position: absolute;
    }
    
    /* Remove the old broken bridge */
    .main-navigation ul.sub-menu::before {
        display: none !important;
    }

    /* THE NEW BRIDGE: Invisible hover area attached to the parent LI */
    .main-navigation ul > li.menu-item-has-children {
        position: relative !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    .main-navigation ul > li.menu-item-has-children::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 15px; /* Matches the exact gap to the sub-menu */
        background: transparent;
    }

    .main-navigation ul > li.menu-item-has-children:hover > ul.sub-menu {
        transform: none !important;
    }

    .main-navigation ul.sub-menu li a {
        padding: 8px 20px;
        color: #555;
        font-size: 13px;
        font-weight: 500;
        transition: all 0.2s ease !important; 
        border-bottom: none;
    }

    /* The sliding hover effect */
    .main-navigation ul.sub-menu li a:hover {
        background-color: #fdf1ef !important; 
        color: #ed4e34 !important; 
        padding-left: 25px !important; 
    }
}

/* --- 3B. MOBILE HAMBURGER MENU GLOW-UP --- */
@media (max-width: 958px) { /* User requested breakpoint */
    
    /* Shrink the Hamburger Icon */
    .ast-button-wrap .menu-toggle .ast-icon svg,
    .ast-mobile-popup-header .menu-toggle-close .ast-icon svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    /* Fix the container cutoff on the right side */
    #ast-mobile-popup,
    .ast-mobile-header-wrap .main-header-bar-navigation {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* Style the main floating mobile menu card */
    .ast-builder-menu-mobile .main-navigation {
        background-color: #ffffff !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
        margin: 10px !important; 
        width: calc(100% - 20px) !important;
        box-sizing: border-box !important;
        padding: 5px 10px !important; /* REDUCED from 10px to save space */
        border: none !important; 
    }

    /* Clean up the individual menu links */
    .ast-builder-menu-mobile .main-navigation ul li a {
        padding: 8px 20px !important; /* REDUCED top & bottom padding from 12px */
        border-bottom: 1px solid #f0f0f0 !important; 
        color: #444 !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 1.3 !important; /* Tighter line height */
        transition: all 0.2s ease !important;
    }

    /* Fix the mobile sub-menu arrow dropdown button */
    .ast-builder-menu-mobile .main-navigation ul li .ast-menu-toggle,
    .ast-builder-menu-mobile .main-navigation ul li button.ast-menu-toggle {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        outline: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 40px !important;
        height: 34px !important; /* Matches the exact height of your menu links */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: absolute !important;
        right: 10px !important;
        top: 0px !important; /* <--- NUDGE THIS: try -5px or -10px if it needs to go higher! */
    }
    
    /* Ensure the list item is positioned relatively so the absolute button aligns correctly */
    .ast-builder-menu-mobile .main-navigation ul li.menu-item-has-children {
        position: relative !important;
    }

    /* Remove border on the last item to keep it clean */
    .ast-builder-menu-mobile .main-navigation ul li:last-child > a {
        border-bottom: none !important;
    }

    /* Sub-menu container styling */
    .ast-builder-menu-mobile .main-navigation ul.sub-menu {
        background-color: #fafafa !important; 
        border-top: none !important;
        margin-bottom: 0 !important;
    }
    
    /* Sub-menu link styling (indented) */
    .ast-builder-menu-mobile .main-navigation ul.sub-menu li a {
        padding-left: 30px !important;
        font-size: 13px !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }

    /* Hover sliding animation */
    .ast-builder-menu-mobile .main-navigation ul li a:hover {
        color: #ed4e34 !important;
        background-color: #fdf1ef !important;
        padding-left: 25px !important; 
    }
    
    /* Ensure sub-menus slide even further right on hover so they look nested */
    .ast-builder-menu-mobile .main-navigation ul.sub-menu li a:hover {
        padding-left: 35px !important;
    }
}