/* --- Updated FOUC Prevention: Instant Reveal --- */
.above-menu-block {
    visibility: hidden; /* Hide without animation */
}

/* Targets the telephone link inside the dropdown menu specifically */
.dropdown-menu a[href^="tel"] {
    color: #ffffff !important;
}

/* Note: The 'loaded' class is no longer strictly required for the reveal 
   because the PHP inline script handles it faster, but we keep the logic 
   here for CSS consistency.
*/
.above-menu-block.loaded {
    visibility: visible !important; 
}
/* --- End FOUC Prevention --- */


/* Style for the active menu item link */
a.current-page-link {
    text-decoration: underline !important;
    color: var(--color-primary) !important;
}

/* Modern CSS solution for scrollbar shift */
html {
    scrollbar-gutter: stable;
}

/* Styles for the new header row layout and home icon */
.menu-header-flex-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    gap: 10px;
}
.menu-header-flex-container .menu-header-link {
    margin: 0;
}
/* MODIFICATION START: Nudge icon up on desktop */
.menu-header-flex-container .home-icon-link {
    position: relative;
    top: -2px;
}
/* MODIFICATION END */
.menu-header-flex-container .home-icon-link i {
    font-size: 1.3rem;
    color: var(--color-secondary);
    transition: color 0.2s ease;
    margin-left:5px;
}
.menu-header-flex-container .home-icon-link:hover i {
    color: var(--color-primary);
}


/* --- Button/Dropdown Colour Control --- */
.button-color-black .dropdown-button,
.button-color-black .dropdown-menu {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
}
.button-color-gold .dropdown-button,
.button-color-gold .dropdown-menu {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.burger-color-black .burger-toggle svg,
.burger-color-black .menu-display-name {
    color: var(--color-secondary);
}
.burger-color-gold .burger-toggle svg,
.burger-color-gold .menu-display-name {
    color: var(--color-primary);
}
.menu-header-link{
    margin-bottom:0px !important;
    margin-top:0px !important;
    font-size:0.9em !important;
}
.submenu-toggle {
    color: #474747;
}
.dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.15); /* Subtle highlight on hover */
}
.menu-subchild a {
    padding-left: 10px;
    margin-top:-5px;
    margin-left:15px;
    line-height:normal;
    margin-bottom:5px;
    font-size:0.85em;
}
.sub-level {
    margin-left:0px;
}
.mega-menu-wrapper {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}
.above-menu-block {
    background: #fff;
    padding: 0px 0;
    width: 100%;
}
.above-menu-inner {
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    position: relative;
    min-height:70px;
}

/* NEW: Container for Burger and Menu Name */
.menu-toggle-and-name {
    display: flex;
    align-items: center;
}

/* NEW: Menu Name Styling */
.menu-display-name {
    /* Base styles to apply on desktop */
    font-family: var(--font-secondary, 'Georgia, serif');
    font-weight: normal;
    font-size: 0.85em;
    text-transform: uppercase;
    margin-left: 10px; /* 10px margin to the left of the burger menu */
    line-height: 1; /* Match the vertical centering of the burger icon */
}

.logo-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 145px;
    width:145px;
    text-align: center;
    z-index: 1;
}
.svg-logo img {
    width: 100%;
    height: auto;
    display: inline-block;
}
.burger-toggle {
    padding-left: 10px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2;
    align-self: center !important;
    margin-bottom:-6px !important;
}
.burger-toggle .icon {
    width: 32px;
    height: 32px;
    display: none;
}
.burger-toggle:not(.open) .icon-burger,
.burger-toggle.open .icon-close {
    display: inline-block;
}
.burger-toggle svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}
.phone-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-secondary);
    color: var(--color-secondary);
}
.phone-wrap i {
    font-size: 15px;
}
.phone-wrap a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    margin-right:20px;
    font-size:0.8em;
}
.dropdown-container {
    position: relative;
    z-index: 10001;
    margin-left:5px;
}
.dropdown-button {
    background-color: var(--color-primary);
    border-radius: 25px;
    padding: 15px 35px;
    font-family: var(--font-secondary);
    color: var(--color-tertiary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
}
.dropdown-container.dropdown-open .dropdown-button {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.dropdown-chevron {
    transition: transform 0.2s ease;
}
.dropdown-open .dropdown-chevron {
    transform: rotate(180deg);
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-primary);
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    min-width: 100%;
    border-radius: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s ease-out, background-color 0.3s ease;
}
.dropdown-open .dropdown-menu {
    max-height: 500px;
    opacity: 1;
    visibility: visible;
}
.dropdown-menu a {
    padding: 10px;
    font-family: var(--font-secondary);
    color: var(--color-tertiary);
    text-decoration: none;
    border-top: 1px solid var(--color-tertiary);
    font-size: 0.9em;
}
.dropdown-menu a:first-child {
    margin-top: -10px;
}
.dropdown-menu a:last-child {
    margin-bottom: -10px;
    border-bottom: none;
}
.mega-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: #f3f4f1;
    padding-top:40px;
    padding-bottom:40px;
    padding-left:30px;
    padding-right:30px;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    display: block; 
    box-sizing: border-box;
    height: auto; /* Desktop: only as tall as the links */
    max-height: calc(100vh - 70px); 
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.6s ease, opacity 0.6s ease, visibility 0.6s ease;
}

.mega-menu.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}
.mega-menu-inner {
    max-width: var(--site-container-width);
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom:50px; 
}
.menu-header-row {
    flex: 1 0 100%;
}
.menu-header-link a {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-secondary);
    color: var(--color-secondary);
    text-decoration: none;
}
.menu-arrow {
    margin-right: 8px;
    font-size: 1.2rem;
}
.menu-col {
    flex: 0 0 calc((100% - 60px) / 4);
    padding-right:30px;
}
.menu-col ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
    font-size:0.9em;
}
.menu-col h2 {
    font-size: 2.1rem;
    margin-bottom: 0;
}
.menu-col h2 a {
    text-decoration: none;
    color: inherit;
}
.menu-col ul li a {
    display: block;
    padding: 4px 0;
    font-family: var(--font-secondary);
    color: var(--color-secondary);
    text-decoration: none;
}
.menu-col.special h2 a {
    font-family: var(--font-primary);
}
.submenu-toggle {
    display: none;
}

@media (max-width: 768px) {
    /* --- FIX: Strictly hide the menu name on mobile --- */
    .menu-display-name {
        display: none !important; /* Forces hiding on small screens */
    }
    /* --- END FIX --- */

    /* Fix for mobile icon alignment */
    .menu-header-flex-container {
        justify-content: left;
        margin-bottom:10px !important;
    }
    .menu-header-flex-container .menu-header-link {
        margin-bottom: 0px !important;
    }
    .menu-header-flex-container .home-icon-link {
        position: relative;
        top: -2px;
    }

    .menu-header-link{
        margin-bottom:10px !important; 
    }
    .mega-menu {
        top: 70px;
        padding-top:40px;
        padding-bottom:40px;
        /* Use 100dvh (dynamic viewport height) if browser supports it, fallback to 100vh */
        height: 100vh;
        height: calc(100dvh - 70px); 
    }
    .phone-wrap {
        flex-grow: 1;
        justify-content: flex-end !important;
    }
    .phone-wrap a {
        margin-right: 0;
        font: size 0.5em !important;
    }
    .menu-buttons{
        gap:5px !important;
    }
    .menu-header-link{
        margin-top:0px !important;
    }
    .menu-header-link a{
        margin-bottom:0px !important;
        margin-top:0px !important;
        padding:0px !important;
    }
    .menu-col h2 { cursor: pointer; }
    .menu-col ul { display: none; margin: 10px 0 0 0px; }
    .menu-col.active ul { display: block; }
    .mega-menu-inner { 
        flex-direction: column !important; 
        padding-bottom: 60px !important; /* Forces scroll space so iPhone bar doesn't cover links */
    }
    .logo-center {
        position: static;
        transform: none;
        max-width: 115px;
        width:115px;
        margin-top: -8px;
        margin-left:15px;
    }
    .above-menu-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0px;
        padding: 0 15px;
    }
    .above-menu-inner:has(.phone-wrap:only-child) {
        justify-content: center;
    }
    .above-menu-inner:has(.phone-wrap:only-child) .logo-center {
        position: static;
        transform: none;
        margin: 0;
    }
    .above-menu-inner:has(.phone-wrap:only-child) .burger-toggle,
    .above-menu-inner:has(.phone-wrap:only-child) .menu-buttons {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }
    .above-menu-inner:has(.phone-wrap:only-child) .burger-toggle {
        left: 15px;
    }
    .above-menu-inner:has(.phone-wrap:only-child) .menu-buttons {
        right: 15px;
    }
    .above-menu-inner:has(.phone-wrap:only-child) .phone-wrap {
        margin-right: 0;
    }
    .mega-menu {
        flex-direction: column !important;
        align-items: stretch;
    }
    .mega-menu-inner {
        display: flex;
        flex-direction: column !important;
        gap: 0;
    }
    .menu-header-row {
        order: -1;
        width: 100%;
        text-align: left;
        margin-bottom: 0px;
    }
    .menu-col {
        width: 100% !important;
        flex: 1 0 100% !important;
        border-bottom: 1px solid #D9D9D9;
        padding: 10px 0;
    }
    .menu-col:last-of-type {
        border-bottom: none;
        padding-bottom: 0;
    }
    .menu-col h2,
    .menu-col h2 a,
    .menu-col.special h2 a {
        font-family: var(--font-secondary) !important;
        font-size: 1em;
        margin-bottom: 0rem;
        margin-top: 0rem;
        line-height: 1.2;
    }
    .menu-col ul {
        padding-left: 47px;
    }
    .menu-col ul li a {
        font-size: 0.85em;
        padding: 6px 0;
    }
    .submenu-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 15px;
        background: none;
        border: none;
        font-size: 1.1em;
        color: var(--color-primary);
        cursor: pointer;
        padding: 5px;
    }
    .menu-col h2.menu-heading-flex:not(:has(.submenu-toggle)) {
        padding-left: 47px;
    }
    .dropdown-button {
        padding: 10px 16px;
        font-size: 0.7em !important;
        border-radius: 20px;
        gap: 8px;
    }
    .dropdown-menu a {
        display: block;
        color: var(--color-tertiary);
        text-decoration: none;
        font-family: var(--font-secondary);
        font-size: 1.1rem;
        border-top: 1px solid var(--color-tertiary);
        line-height:14px;
        padding-left:16px;
        padding-top:10px;
        padding-bottom:12px;
    }
    .dropdown-menu a:hover {
        background-color: rgba(255, 255, 255, 0.15); /* Subtle highlight on hover */
    }

    .brxe-custom-footer .col-4-content ul, .brxe-custom-footer .col-4-content ul li {
    margin-left:5px !important;
    margin-right:5px !important;
    margin-bottom:5px !important;
    }

    .brxe-custom-footer .bottom-footer-row ul li {
        margin-right: 0px !important;
    }
}
.dropdown-button {
    font-size: 1.5rem;
    line-height: 1;
}

/* --- Search Feature Styles --- */

/* Toggling Body Class for Scroll Lock */
body.search-panel-open {
    overflow: hidden;
}

/* Search Toggle Icon Button */
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--color-secondary);
    font-size: 16px;
    line-height: 1;
    margin-right: 0px; /* Spacing to the right of the icon */
    color: #7d7c7c; 
    margin-top:0px
}

.phone-wrap .search-toggle {
      margin-top:0px !important;
}

.phone-wrap .search-toggle i {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--color-secondary);
    font-size: 16px !important;
    line-height: 1;
    margin-right: 5px; /* Spacing to the right of the icon */
    color: #7d7c7c; 
}

/* Search Panel (The slide-out container) */
.search-panel {
    position: fixed;
    top: 70px; /* Adjust to match your header height */
    left: 0;
    width: 100%;
    background: #f3f4f1; /* Same as mega-menu */
    padding: 30px 0px;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    z-index: 1001; /* Higher than mega-menu */
    box-sizing: border-box;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    transition: transform 0.6s ease, opacity 0.6s ease, visibility 0.6s ease;
}

.search-panel.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

/* Inner container for alignment */
.search-panel-inner {
    max-width: var(--site-container-width);
    margin: 0 auto;
    width: 100%;
}

/* Search Form Styling */
.search-form {
    display: flex;
    width: 100%;
}

.search-field {
    flex-grow: 1;
    font-size: 0.9em;
    outline: none;
    -webkit-appearance: none;
    border-width: 1px;
    border-color: var(--bricks-color-bjfsak);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    padding-top:0px;
    padding-bottom:0px;
color:#000000;
height:45px;
}

.search-field::placeholder {
  color: #000; /* Change this hex code to your desired color */
  opacity: 0.5; /* Ensures full color opacity in some browsers like Firefox */
}



.search-submit {
    background: var(--color-primary);
    color: var(--color-tertiary);
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-size: 15px;
  border-color: var(--bricks-color-bjfsak);
  border-top-right-radius: 15px;
  border-bottom-right-radius: 15px;
  height: 45px;
}

.search-submit:hover {
    opacity: 0.9;
}

/* Screen reader text should not be visible */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-panel {
        top: 70px; /* Match mobile header height */
        max-height: calc(100vh - 70px);
    }

      .search-panel.open {
        padding-left: 10px;
        padding-right: 10px;
    }

/*
 * FINAL MOBILE LAYOUT:
 * Logo is 20px from burger and vertically centered.
 */

/* 1. Align items to the left and center them vertically. */
.above-menu-inner {
    justify-content: flex-start;
    align-items: center; 
}

/* 2. Ensure burger and buttons stay in the normal layout flow. */
.burger-toggle,
.menu-buttons {
    position: static !important;
    transform: none !important;
}

/* 3. Push the buttons/phone container to the far right. */
.menu-buttons {
    margin-left: auto;
}

/* 4. Position the logo:
     - Set top/bottom margin to 0 for perfect vertical centering.
     - Set left margin to 20px for the required spacing. */
.logo-center {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 15px !important;
}

.burger-toggle {
    padding-left: 3px !important;

    
}

.search-field {
        font-size: 16px !important; 
    }

    .search-panel-inner {
       padding-left:10px;
       padding-right:10px;
    }

}

/* Hide the chevron if there is no dropdown menu sibling */
.dropdown-container:not(:has(.dropdown-menu)) .dropdown-chevron {
    display: none;
}

/* Ensure the 'Join' button doesn't look like it's 'opening' on click */
.dropdown-container:not(:has(.dropdown-menu)).dropdown-open .dropdown-button {
    border-radius: 25px !important; /* Maintain original shape */
}