/**
 * Header Styles
 */

/* ===== TOP BAR ===== */
.site-topbar {
    background-color: var(--topbar-bg-color, #1f2937);
    color: var(--topbar-text-color, #ffffff);
    height: var(--topbar-height, 40px);
    font-size: 0.875rem;
    line-height: 1;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 1rem;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-left {
    justify-content: flex-start;
}

.topbar-right {
    justify-content: flex-end;
}

.topbar-widget {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.topbar-widget p {
    margin: 0;
}

.topbar-widget a {
    color: var(--topbar-text-color, #ffffff);
    text-decoration: none;
    transition: opacity var(--transition-speed, 0.3s) ease;
}

.topbar-widget a:hover {
    opacity: 0.8;
}

/* ===== MAIN HEADER - STANDARD LAYOUT ===== */
.site-header {
    background-color: var(--header-bg-color, #ffffff);
    color: var(--header-text-color, #1f2937);
    border-bottom: 1px solid var(--color-border);
    padding: 0;
    position: relative;
    z-index: 1000;
}

.has-sticky-header .site-header {
    position: sticky;
    top: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Sticky header with top bar - account for topbar height */
.has-sticky-header.has-topbar .site-topbar {
    position: sticky;
    top: 0;
    z-index: 1001;
}

.has-sticky-header.has-topbar .site-header {
    top: var(--topbar-height, 40px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--main-header-height, var(--header-height, 80px));
}

/* Logo / Branding */
.site-branding {
    display: flex;
    align-items: center;
}

.custom-logo-link {
    display: block;
    line-height: 0;
}

.custom-logo {
    max-height: calc(var(--main-header-height, var(--header-height, 80px)) - 30px);
    max-width: var(--logo-width-desktop, 150px);
    width: auto;
    height: auto;
    transition: opacity var(--transition-speed) ease;
}

.custom-logo-link:hover .custom-logo {
    opacity: 0.8;
}

.custom-logo-link:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--header-text-color, var(--color-text));
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.site-title:hover {
    color: var(--color-primary);
}

.site-title:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}

/* Navigation */
.main-navigation {
    display: flex;
    align-items: center;
}

.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.primary-menu li {
    margin: 0;
    position: relative;
}

.primary-menu a {
    font-family: var(--font-nav);
    font-size: 1rem;
    font-weight: 500;
    color: var(--header-text-color, var(--color-text));
    text-decoration: none;
    padding: 0.5rem 0;
    display: block;
    transition: color var(--transition-speed) ease;
    position: relative;
}

.primary-menu a:hover,
.primary-menu a:focus {
    color: var(--color-primary);
}

.primary-menu a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Active/Current menu item */
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
    color: var(--color-primary);
}

/* Use ::before for the underline to avoid conflict with dropdown arrow ::after */
.primary-menu .current-menu-item > a::before,
.primary-menu .current_page_item > a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-primary);
}

/* Dropdown menus - Level 1 (drops down) */
.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--dropdown-bg-color, #ffffff);
    border: 1px solid #e5e7eb;
    min-width: 220px;
    padding: 0.5rem 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--transition-speed, 0.3s) ease,
                transform var(--transition-speed, 0.3s) ease,
                visibility var(--transition-speed, 0.3s) ease;
    z-index: 1000;
}

/* Level 2+ dropdowns (slide out to the side) */
.primary-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    transform: translateX(-10px);
    margin-left: 0;
}

/* Show dropdown on hover/focus */
.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Level 2+ show on hover (slide in from side) */
.primary-menu .sub-menu li:hover > .sub-menu,
.primary-menu .sub-menu li:focus-within > .sub-menu {
    transform: translateX(0);
}

.primary-menu .sub-menu li {
    margin: 0;
    position: relative;
}

.primary-menu .sub-menu a {
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
    display: block;
    color: var(--dropdown-text-color, #1f2937);
}

.primary-menu .sub-menu a:hover,
.primary-menu .sub-menu a:focus {
    background-color: var(--dropdown-hover-bg-color, #f3f4f6);
}

/* Dropdown indicator arrows */
.primary-menu li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.2s ease;
}

.primary-menu li.menu-item-has-children:hover > a::after,
.primary-menu li.menu-item-has-children:focus-within > a::after {
    transform: rotate(180deg);
}

.primary-menu .sub-menu li.menu-item-has-children > a::after {
    border-left: 4px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: none;
    margin-left: auto;
    float: right;
    margin-top: 0.35rem;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: -0.5rem;
    z-index: 1001;
    /* WCAG 2.2 - Minimum touch target size */
    min-width: 44px;
    min-height: 44px;
}

.menu-toggle:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

.menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    height: 24px;
    justify-content: center;
}

.menu-toggle-icon .bar {
    width: 100%;
    height: 3px;
    background-color: var(--header-text-color, var(--color-text));
    border-radius: 2px;
    transition: transform var(--transition-speed) ease,
                opacity var(--transition-speed) ease,
                background-color var(--transition-speed) ease;
}

.menu-toggle:hover .menu-toggle-icon .bar {
    background-color: var(--color-primary);
}

/* Mobile menu open state */
.menu-open .menu-toggle-icon .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-open .menu-toggle-icon .bar:nth-child(2) {
    opacity: 0;
}

.menu-open .menu-toggle-icon .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===== CENTERED HEADER LAYOUT ===== */
.header-centered {
    border-bottom: none;
}

.header-centered .header-logo-area {
    background-color: var(--header-bg-color, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--main-header-height, 80px);
}

.header-centered .site-branding-centered {
    justify-content: center;
    text-align: center;
}

.header-centered .header-navbar {
    background-color: var(--navbar-bg-color, #f9fafb);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.header-centered .main-navigation-centered {
    display: flex;
    justify-content: center;
    height: var(--navbar-height, 50px);
}

.header-centered .primary-menu-centered {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.header-centered .primary-menu-centered a {
    color: var(--navbar-text-color, #1f2937);
}

.header-centered .primary-menu-centered a:hover,
.header-centered .primary-menu-centered a:focus {
    color: var(--color-primary);
}

/* Centered layout - hide toggle on desktop, show nav items centered */
.header-centered .menu-toggle {
    display: none;
}

/* ===== RESPONSIVE STYLES ===== */

/* Top bar responsive */
@media (max-width: 768px) {
    .site-topbar {
        height: auto;
        min-height: var(--topbar-height, 40px);
        padding: 0.5rem 0;
    }

    .topbar-inner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .topbar-left,
    .topbar-right {
        justify-content: center;
        width: 100%;
    }
}

/* Main responsive */
@media (max-width: 768px) {
    /* Mobile logo size */
    .custom-logo {
        max-width: var(--logo-width-mobile, 120px);
    }

    .menu-toggle {
        display: block;
    }

    .primary-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 80vw;
        height: 100vh;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: calc(var(--main-header-height, var(--header-height, 80px)) + 20px) 0 2rem;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        transition: right var(--transition-speed) ease;
        z-index: 999;
    }

    .menu-open .primary-menu {
        right: 0;
    }

    .primary-menu li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }

    .primary-menu a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        color: var(--color-text);
    }

    .primary-menu .current-menu-item > a::before,
    .primary-menu .current_page_item > a::before {
        display: none;
    }

    .primary-menu .current-menu-item > a,
    .primary-menu .current_page_item > a {
        background-color: rgba(37, 99, 235, 0.05);
    }

    /* Mobile dropdown */
    .primary-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.02);
        display: none;
        padding: 0;
    }

    .primary-menu li.menu-item-has-children > a::after {
        content: '';
        width: 10px;
        height: 10px;
        border-left: none;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        border-top: none;
        margin-left: auto;
        transform: rotate(45deg);
        transition: transform var(--transition-speed) ease;
    }

    .primary-menu li.menu-item-has-children.open > a::after {
        transform: rotate(-135deg);
    }

    .primary-menu li.menu-item-has-children.open > .sub-menu {
        display: block;
    }

    .primary-menu .sub-menu a {
        padding: 0.75rem 1.5rem 0.75rem 2.5rem;
        font-size: 0.938rem;
    }

    /* Mobile menu overlay */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        animation: fadeIn var(--transition-speed) ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }

    /* Centered layout mobile adjustments */
    .header-centered .header-navbar {
        position: relative;
    }

    .header-centered .main-navigation-centered {
        justify-content: flex-end;
        padding-right: 1rem;
    }

    .header-centered .menu-toggle {
        display: block;
    }

    .header-centered .primary-menu-centered {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 80vw;
        height: 100vh;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: calc(var(--main-header-height, 80px) + var(--navbar-height, 50px) + 20px) 0 2rem;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        transition: right var(--transition-speed) ease;
        z-index: 999;
        justify-content: flex-start;
    }

    .menu-open .primary-menu-centered {
        right: 0;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.25rem;
    }

    .primary-menu {
        width: 280px;
    }
}

/* ===== MOBILE MENU STYLE VARIATIONS ===== */

/* Minimalist Style - Clean, no borders or effects */
@media (max-width: 768px) {
    .mobile-menu-minimalist .primary-menu {
        box-shadow: none;
        border-left: 1px solid #e5e7eb;
        padding: 1.5rem 0 2rem;
    }

    .mobile-menu-minimalist .primary-menu li {
        border-bottom: none;
    }

    .mobile-menu-minimalist .primary-menu a {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .mobile-menu-minimalist .primary-menu a:hover,
    .mobile-menu-minimalist .primary-menu a:focus {
        background-color: transparent;
        color: var(--color-primary);
    }

    .mobile-menu-minimalist .primary-menu a:focus {
        outline: none;
    }

    .mobile-menu-minimalist .primary-menu .current-menu-item > a,
    .mobile-menu-minimalist .primary-menu .current_page_item > a {
        background-color: transparent;
        color: var(--color-primary);
        font-weight: 500;
    }

    .mobile-menu-minimalist .primary-menu .sub-menu {
        background: transparent;
        margin-top: 0;
        padding: 0;
    }

    .mobile-menu-minimalist .primary-menu .sub-menu a {
        padding: 0.625rem 1.5rem 0.625rem 2.25rem;
        font-size: 0.938rem;
        color: #6b7280;
    }

    .mobile-menu-minimalist .primary-menu .sub-menu a:hover,
    .mobile-menu-minimalist .primary-menu .sub-menu a:focus {
        color: var(--color-primary);
        background-color: transparent;
    }
}

/* Dark Style - Dark background with light text */
@media (max-width: 768px) {
    .mobile-menu-dark .primary-menu {
        background: #1f2937;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
        padding: 1.5rem 0 2rem;
    }

    .mobile-menu-dark .primary-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .mobile-menu-dark .primary-menu a {
        color: #f9fafb;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .mobile-menu-dark .primary-menu a:hover,
    .mobile-menu-dark .primary-menu a:focus {
        color: #60a5fa;
        background-color: rgba(255, 255, 255, 0.03);
    }

    .mobile-menu-dark .primary-menu a:focus {
        outline: none;
    }

    .mobile-menu-dark .primary-menu .current-menu-item > a,
    .mobile-menu-dark .primary-menu .current_page_item > a {
        background-color: rgba(96, 165, 250, 0.1);
        color: #60a5fa;
    }

    .mobile-menu-dark .primary-menu .sub-menu {
        background: rgba(0, 0, 0, 0.2);
    }

    .mobile-menu-dark .primary-menu .sub-menu a {
        color: #d1d5db;
        padding: 0.625rem 1.5rem 0.625rem 2.25rem;
        font-size: 0.938rem;
    }

    .mobile-menu-dark .primary-menu .sub-menu a:hover,
    .mobile-menu-dark .primary-menu .sub-menu a:focus {
        background-color: rgba(255, 255, 255, 0.05);
        color: #60a5fa;
    }

    .mobile-menu-dark .primary-menu li.menu-item-has-children > a::after {
        color: #9ca3af;
    }

    /* Update menu toggle icon color when menu is dark */
    .mobile-menu-dark.menu-open .menu-toggle-icon .bar {
        background-color: #f9fafb;
    }
}

/* ===== TRANSPARENT HEADER LAYOUT ===== */
.header-transparent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: transparent;
    border-bottom: none;
    z-index: 1000;
    transition: background-color var(--transition-speed, 0.3s) ease,
                box-shadow var(--transition-speed, 0.3s) ease;
}

.header-transparent .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--main-header-height, 80px);
}

/* Full width transparent header */
.header-transparent.transparent-full-width .transparent-header-inner {
    width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Transparent header colors - Light mode (white text for dark backgrounds) */
.header-transparent.header-mode-light .site-title,
.header-transparent.header-mode-light .custom-logo-link {
    color: var(--transparent-light-color, #ffffff);
}

.header-transparent.header-mode-light .menu-toggle-icon .bar {
    background-color: var(--transparent-light-color, #ffffff);
}

/* Transparent header colors - Dark mode (dark text for light backgrounds) */
.header-transparent.header-mode-dark .site-title,
.header-transparent.header-mode-dark .custom-logo-link {
    color: var(--transparent-dark-color, #1f2937);
}

.header-transparent.header-mode-dark .menu-toggle-icon .bar {
    background-color: var(--transparent-dark-color, #1f2937);
}

/* Transparent header hamburger toggle - always visible */
.header-transparent .transparent-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    z-index: 999;
    position: relative;
    font-family: var(--font-nav);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all var(--transition-speed, 0.3s) ease;
}

/* Light mode toggle color */
.header-transparent.header-mode-light .transparent-menu-toggle {
    color: var(--transparent-light-color, #ffffff);
}

/* Dark mode toggle color */
.header-transparent.header-mode-dark .transparent-menu-toggle {
    color: var(--transparent-dark-color, #1f2937);
}

/* Hide menu toggle when menu is open */
.header-transparent.menu-open .transparent-menu-toggle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Hover style for transparent menu toggle - Light mode */
.header-transparent.header-mode-light .transparent-menu-toggle:hover .menu-toggle-icon .bar {
    opacity: 0.6;
}

.header-transparent.header-mode-light .transparent-menu-toggle:hover {
    opacity: 0.6;
}

/* Hover style for transparent menu toggle - Dark mode */
.header-transparent.header-mode-dark .transparent-menu-toggle:hover .menu-toggle-icon .bar {
    opacity: 0.6;
}

.header-transparent.header-mode-dark .transparent-menu-toggle:hover {
    opacity: 0.6;
}

/* Scrolled state hover */
.header-transparent.is-scrolled .transparent-menu-toggle:hover .menu-toggle-icon .bar {
    opacity: 0.6;
}

/* Menu text with border style - Light mode */
.header-transparent.header-mode-light.has-menu-text .transparent-menu-toggle {
    border: 1px solid var(--transparent-light-color, #ffffff);
    padding: 0.625rem 1rem;
    border-radius: 0;
}

/* Menu text with border style - Dark mode */
.header-transparent.header-mode-dark.has-menu-text .transparent-menu-toggle {
    border: 1px solid var(--transparent-dark-color, #1f2937);
    padding: 0.625rem 1rem;
    border-radius: 0;
}

/* Hover for menu with text - use opacity instead of color change */
.header-transparent.has-menu-text .transparent-menu-toggle:hover {
    opacity: 0.6;
}

/* Scrolled state for menu toggle with text */
.header-transparent.has-menu-text.is-scrolled .transparent-menu-toggle {
    border-color: var(--transparent-sticky-text-color, #1f2937);
    color: var(--transparent-sticky-text-color, #1f2937);
}

.header-transparent.has-menu-text.is-scrolled .transparent-menu-toggle:hover {
    opacity: 0.6;
}

.header-transparent .transparent-menu-toggle .menu-text {
    display: inline-block;
}

.header-transparent .transparent-menu-toggle:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

.header-transparent .transparent-menu-toggle .menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
    height: 18px;
    justify-content: center;
}

/* Light mode bar color */
.header-transparent.header-mode-light .transparent-menu-toggle .menu-toggle-icon .bar {
    width: 100%;
    height: 2px;
    background-color: var(--transparent-light-color, #ffffff);
    border-radius: 1px;
    transition: transform var(--transition-speed, 0.3s) ease,
                opacity var(--transition-speed, 0.3s) ease,
                background-color var(--transition-speed, 0.3s) ease;
}

/* Dark mode bar color */
.header-transparent.header-mode-dark .transparent-menu-toggle .menu-toggle-icon .bar {
    width: 100%;
    height: 2px;
    background-color: var(--transparent-dark-color, #1f2937);
    border-radius: 1px;
    transition: transform var(--transition-speed, 0.3s) ease,
                opacity var(--transition-speed, 0.3s) ease,
                background-color var(--transition-speed, 0.3s) ease;
}

/* Sticky state for transparent header when scrolling */
.header-transparent.transparent-sticky-enabled.is-scrolled {
    position: fixed;
    background-color: var(--transparent-sticky-bg-color, #ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-transparent.transparent-sticky-enabled.is-scrolled .site-title {
    color: var(--transparent-sticky-text-color, #1f2937);
}

.header-transparent.transparent-sticky-enabled.is-scrolled .transparent-menu-toggle {
    color: var(--transparent-sticky-text-color, #1f2937);
}

.header-transparent.transparent-sticky-enabled.is-scrolled .transparent-menu-toggle .menu-toggle-icon .bar {
    background-color: var(--transparent-sticky-text-color, #1f2937);
}

/* ===== TRANSPARENT MENU PANEL ===== */
.transparent-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed, 0.3s) ease,
                visibility var(--transition-speed, 0.3s) ease;
}

.header-transparent.menu-open .transparent-menu-panel {
    opacity: 1;
    visibility: visible;
}

/* Global reset for transparent menu links - remove all borders/outlines */
.transparent-menu a,
.transparent-menu a:link,
.transparent-menu a:visited,
.transparent-menu a:hover,
.transparent-menu a:focus,
.transparent-menu a:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    text-decoration: none;
}

.transparent-menu li {
    outline: none;
    border: none;
    box-shadow: none;
}

/* Close button */
.transparent-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed, 0.3s) ease;
}

.transparent-menu-close:hover {
    border-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.transparent-menu-close:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}

.transparent-menu-close .close-icon {
    position: relative;
    width: 20px;
    height: 20px;
}

.transparent-menu-close .close-icon::before,
.transparent-menu-close .close-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: background-color var(--transition-speed, 0.3s) ease;
}

.transparent-menu-close .close-icon::before {
    transform: rotate(45deg);
}

.transparent-menu-close .close-icon::after {
    transform: rotate(-45deg);
}

/* ===== OVERLAY MENU STYLE ===== */
.header-transparent.menu-style-overlay .transparent-menu-panel {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-transparent.menu-style-overlay .transparent-menu-inner {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
}

.header-transparent.menu-style-overlay .transparent-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-transparent.menu-style-overlay .transparent-menu > li {
    margin-bottom: 0.25rem;
    overflow: hidden;
}

.header-transparent.menu-style-overlay .transparent-menu > li > a {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    display: inline-block;
    padding: 0.5rem 0;
    position: relative;
    transition: color var(--transition-speed, 0.3s) ease,
                transform var(--transition-speed, 0.3s) ease;
}

.header-transparent.menu-style-overlay .transparent-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0.25rem;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ffffff;
    transition: width var(--transition-speed, 0.3s) ease;
}

.header-transparent.menu-style-overlay .transparent-menu > li > a:hover,
.header-transparent.menu-style-overlay .transparent-menu > li > a:focus {
    color: rgba(255, 255, 255, 0.7);
}

.header-transparent.menu-style-overlay .transparent-menu > li > a:hover::after {
    width: 100%;
}

/* Current page styling - only for top-level items */
.header-transparent.menu-style-overlay .transparent-menu > li.current-menu-item > a,
.header-transparent.menu-style-overlay .transparent-menu > li.current_page_item > a {
    color: #ffffff;
}

.header-transparent.menu-style-overlay .transparent-menu > li.current-menu-item > a::after,
.header-transparent.menu-style-overlay .transparent-menu > li.current_page_item > a::after {
    width: 100%;
}

/* Remove focus outline for cleaner look, use color change instead */
.header-transparent.menu-style-overlay .transparent-menu a:focus {
    outline: none;
}

/* Ensure no borders on open menu items */
.header-transparent.menu-style-overlay .transparent-menu > li.open > a {
    border: none;
    outline: none;
}

/* For items with children, remove the underline effect and use chevron only */
.header-transparent.menu-style-overlay .transparent-menu > li.menu-item-has-children > a::after {
    display: none;
}

/* Overlay submenu */
.header-transparent.menu-style-overlay .transparent-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

.header-transparent.menu-style-overlay .transparent-menu .menu-item-has-children.open > .sub-menu {
    max-height: 500px;
    padding: 0.75rem 0 0.5rem 0;
}

.header-transparent.menu-style-overlay .transparent-menu .sub-menu li {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.header-transparent.menu-style-overlay .transparent-menu .menu-item-has-children.open > .sub-menu li {
    opacity: 1;
    transform: translateY(0);
}

.header-transparent.menu-style-overlay .transparent-menu .menu-item-has-children.open > .sub-menu li:nth-child(1) { transition-delay: 0.05s; }
.header-transparent.menu-style-overlay .transparent-menu .menu-item-has-children.open > .sub-menu li:nth-child(2) { transition-delay: 0.1s; }
.header-transparent.menu-style-overlay .transparent-menu .menu-item-has-children.open > .sub-menu li:nth-child(3) { transition-delay: 0.15s; }
.header-transparent.menu-style-overlay .transparent-menu .menu-item-has-children.open > .sub-menu li:nth-child(4) { transition-delay: 0.2s; }
.header-transparent.menu-style-overlay .transparent-menu .menu-item-has-children.open > .sub-menu li:nth-child(5) { transition-delay: 0.25s; }
.header-transparent.menu-style-overlay .transparent-menu .menu-item-has-children.open > .sub-menu li:nth-child(6) { transition-delay: 0.3s; }
.header-transparent.menu-style-overlay .transparent-menu .menu-item-has-children.open > .sub-menu li:nth-child(7) { transition-delay: 0.35s; }
.header-transparent.menu-style-overlay .transparent-menu .menu-item-has-children.open > .sub-menu li:nth-child(8) { transition-delay: 0.4s; }

.header-transparent.menu-style-overlay .transparent-menu .sub-menu a {
    font-family: var(--font-nav);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 0;
    display: inline-block;
    position: relative;
    transition: color var(--transition-speed, 0.3s) ease;
}

.header-transparent.menu-style-overlay .transparent-menu .sub-menu a:hover {
    color: #ffffff;
}

.header-transparent.menu-style-overlay .transparent-menu .sub-menu .current-menu-item > a,
.header-transparent.menu-style-overlay .transparent-menu .sub-menu .current_page_item > a {
    color: #ffffff;
}

/* Chevron indicator for overlay menu items with children - use ::before to not conflict with underline */
.header-transparent.menu-style-overlay .transparent-menu > li.menu-item-has-children > a {
    padding-right: 2rem;
}

.header-transparent.menu-style-overlay .transparent-menu > li.menu-item-has-children > a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    opacity: 0.5;
    transition: transform var(--transition-speed, 0.3s) ease, opacity var(--transition-speed, 0.3s) ease;
}

.header-transparent.menu-style-overlay .transparent-menu > li.menu-item-has-children.open > a::before {
    transform: translateY(-30%) rotate(-135deg);
    opacity: 1;
}

/* ===== SLIDEOUT MENU STYLE ===== */
.header-transparent.menu-style-slideout .transparent-menu-panel {
    width: 400px;
    max-width: 90vw;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    transform: translateX(100%);
    transition: transform var(--transition-speed, 0.3s) ease,
                opacity var(--transition-speed, 0.3s) ease,
                visibility var(--transition-speed, 0.3s) ease;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

.header-transparent.menu-style-slideout.menu-open .transparent-menu-panel {
    transform: translateX(0);
}

/* Slideout overlay backdrop */
.header-transparent.menu-style-slideout .transparent-menu-panel::before {
    content: '';
    position: fixed;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity var(--transition-speed, 0.3s) ease;
    pointer-events: none;
}

.header-transparent.menu-style-slideout.menu-open .transparent-menu-panel::before {
    opacity: 1;
    pointer-events: auto;
}

.header-transparent.menu-style-slideout .transparent-menu-inner {
    padding: 6rem 2rem 2rem;
    height: 100%;
    overflow-y: auto;
}

.header-transparent.menu-style-slideout .transparent-menu-close {
    top: 1.5rem;
    right: 1.5rem;
}

.header-transparent.menu-style-slideout .transparent-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-transparent.menu-style-slideout .transparent-menu > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-transparent.menu-style-slideout .transparent-menu > li:last-child {
    border-bottom: none;
}

.header-transparent.menu-style-slideout .transparent-menu > li > a {
    font-family: var(--font-nav);
    font-size: 1.125rem;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    display: block;
    padding: 1rem 0;
    transition: color var(--transition-speed, 0.3s) ease,
                padding-left var(--transition-speed, 0.3s) ease;
}

.header-transparent.menu-style-slideout .transparent-menu > li > a:hover {
    color: var(--color-primary);
    padding-left: 0.5rem;
}

.header-transparent.menu-style-slideout .transparent-menu .current-menu-item > a,
.header-transparent.menu-style-slideout .transparent-menu .current_page_item > a {
    color: var(--color-primary);
}

/* Ensure parent/ancestor items don't get special styling */
.header-transparent.menu-style-slideout .transparent-menu .current-menu-ancestor > a,
.header-transparent.menu-style-slideout .transparent-menu .current-menu-parent > a,
.header-transparent.menu-style-slideout .transparent-menu .current_page_ancestor > a,
.header-transparent.menu-style-slideout .transparent-menu .current_page_parent > a {
    color: #ffffff;
}

/* Slideout submenu */
.header-transparent.menu-style-slideout .transparent-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed, 0.3s) ease;
}

.header-transparent.menu-style-slideout .transparent-menu .menu-item-has-children.open > .sub-menu {
    max-height: 500px;
    padding: 0.5rem 0 0.5rem 1rem;
}

.header-transparent.menu-style-slideout .transparent-menu .sub-menu a {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 0;
    display: block;
    text-decoration: none;
}

.header-transparent.menu-style-slideout .transparent-menu .sub-menu a:hover {
    color: var(--color-primary);
}

/* Remove focus outline and borders on slideout menu items */
.header-transparent.menu-style-slideout .transparent-menu a,
.header-transparent.menu-style-slideout .transparent-menu a:focus,
.header-transparent.menu-style-slideout .transparent-menu a:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.header-transparent.menu-style-slideout .transparent-menu li,
.header-transparent.menu-style-slideout .transparent-menu > li.open,
.header-transparent.menu-style-slideout .transparent-menu > li.menu-item-has-children {
    border: none;
    outline: none;
    box-shadow: none;
}

/* Dropdown indicator for slideout menu (overlay has its own chevron style) */
.header-transparent.menu-style-slideout .transparent-menu .menu-item-has-children > a {
    position: relative;
    padding-right: 1.5rem;
}

.header-transparent.menu-style-slideout .transparent-menu .menu-item-has-children > a::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    font-weight: 300;
    opacity: 0.5;
    transition: transform var(--transition-speed, 0.3s) ease,
                opacity var(--transition-speed, 0.3s) ease;
}

.header-transparent.menu-style-slideout .transparent-menu .menu-item-has-children.open > a::after {
    transform: translateY(-50%) rotate(45deg);
    opacity: 1;
}

/* Body class to prevent scroll when transparent menu is open */
body.transparent-menu-open {
    overflow: hidden;
}

/* Ensure content flows under transparent header */
.header-layout-transparent .site-main {
    margin-top: 0;
}

/* Responsive adjustments for transparent header */
@media (max-width: 768px) {
    .header-transparent .header-inner {
        height: var(--main-header-height, 70px);
    }

    .header-transparent.transparent-full-width .transparent-header-inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .header-transparent.has-menu-text .transparent-menu-toggle {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .header-transparent.menu-style-overlay .transparent-menu > li > a {
        font-size: 1.5rem;
    }

    .header-transparent.menu-style-slideout .transparent-menu-panel {
        width: 100%;
        max-width: 100%;
    }

    .transparent-menu-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .header-transparent.menu-style-overlay .transparent-menu > li > a {
        font-size: 1.25rem;
    }

    .header-transparent.menu-style-slideout .transparent-menu > li > a {
        font-size: 1rem;
    }
}

/* ===== WORDPRESS ADMIN BAR OFFSET ===== */
/* When admin bar is present, offset the transparent menu panel */
body.admin-bar .transparent-menu-panel {
    top: 32px;
}

body.admin-bar .header-transparent {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .transparent-menu-panel {
        top: 46px;
    }

    body.admin-bar .header-transparent {
        top: 46px;
    }
}

/* ===== STANDARD HEADER WITH WIDGET AREA ===== */
.header-standard .header-inner {
    gap: 1.5rem;
}

.header-standard .header-widgets {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-standard .header-widgets .widget {
    margin: 0;
}

/* ===== CENTERED-LEFT HEADER LAYOUT ===== */
.header-centered-left {
    border-bottom: none;
}

.header-centered-left .header-top-bar {
    background-color: var(--header-bg-color, #ffffff);
    height: var(--main-header-height, 80px);
    display: flex;
    align-items: center;
}

.header-centered-left .header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.header-centered-left .header-top-widgets {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-centered-left .header-top-widgets .widget {
    margin: 0;
}

.header-centered-left .header-navbar {
    background-color: var(--navbar-bg-color, #f9fafb);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.header-centered-left .header-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-height, 50px);
}

.header-centered-left .main-navigation-centered {
    display: flex;
    align-items: center;
}

.header-centered-left .primary-menu-centered {
    display: flex;
    gap: 2rem;
}

.header-centered-left .primary-menu-centered a {
    color: var(--navbar-text-color, #1f2937);
}

.header-centered-left .primary-menu-centered a:hover,
.header-centered-left .primary-menu-centered a:focus {
    color: var(--color-primary);
}

.header-centered-left .header-nav-widgets {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-centered-left .header-nav-widgets .widget {
    margin: 0;
}

/* Centered-left layout mobile adjustments */
@media (max-width: 768px) {
    .header-centered-left .header-top-inner {
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
        gap: 1rem;
    }

    .header-centered-left .header-top-bar {
        height: auto;
    }

    .header-centered-left .header-top-widgets {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-centered-left .header-navbar-inner {
        justify-content: flex-end;
    }

    .header-centered-left .menu-toggle {
        display: block;
    }

    .header-centered-left .header-nav-widgets {
        display: none;
    }

    .header-centered-left .primary-menu-centered {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 80vw;
        height: 100vh;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 5rem 0 2rem;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        transition: right var(--transition-speed) ease;
        z-index: 999;
    }

    .menu-open .header-centered-left .primary-menu-centered {
        right: 0;
    }
}

/* ===== FLEXIBLE HEADER LAYOUT ===== */
.header-flexible {
    border-bottom: 1px solid var(--color-border);
}

.header-flexible .header-flexible-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
    height: var(--main-header-height, 80px);
}

.header-flexible .header-zone {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-flexible .header-zone-left {
    justify-content: flex-start;
}

.header-flexible .header-zone-center {
    justify-content: center;
}

.header-flexible .header-zone-right {
    justify-content: flex-end;
}

.header-flexible .header-zone .widget {
    margin: 0;
}

/* Flexible layout mobile adjustments */
@media (max-width: 1024px) {
    .header-flexible .header-flexible-inner {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .header-flexible .header-zone-left {
        order: 1;
    }

    .header-flexible .header-zone-right {
        order: 2;
    }

    .header-flexible .header-zone-center {
        order: 3;
        grid-column: 1 / -1;
        justify-content: center;
        padding-bottom: 0.5rem;
    }
}

@media (max-width: 768px) {
    .header-flexible .header-flexible-inner {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
        gap: 1rem;
    }

    .header-flexible .header-zone {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .header-flexible .header-zone-left,
    .header-flexible .header-zone-right {
        justify-content: center;
    }
}

/* ===== TRANSPARENT HEADER SEARCH TOGGLE ===== */
.header-transparent .header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.transparent-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    transition: opacity var(--transition-speed, 0.3s) ease;
}

.header-transparent.header-mode-light .transparent-search-toggle {
    color: var(--transparent-light-color, #ffffff);
}

.header-transparent.header-mode-dark .transparent-search-toggle {
    color: var(--transparent-dark-color, #1f2937);
}

.transparent-search-toggle:hover {
    opacity: 0.6;
}

.transparent-search-toggle:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Scrolled state for search toggle */
.header-transparent.is-scrolled .transparent-search-toggle {
    color: var(--transparent-sticky-text-color, #1f2937);
}

/* ===== SEARCH TOGGLE FOR ALL HEADER LAYOUTS ===== */
/* Standard Header */
.header-standard .header-desktop .header-inner {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.5rem;
}

.header-standard .header-desktop .site-branding {
    flex-shrink: 0;
}

.header-standard .header-desktop .main-navigation {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.header-standard .header-desktop .header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Centered Header */
.header-centered .header-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
}

.header-centered .header-actions {
    display: flex;
    align-items: center;
    position: absolute;
    right: 0;
}

/* Centered Left Header */
.header-centered-left .header-navbar-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.header-centered-left .header-navbar-inner .main-navigation {
    flex: 1;
}

.header-centered-left .header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

/* Search Toggle Button Styles (All Layouts) */
.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--header-text-color, #1f2937);
    transition: opacity var(--transition-speed, 0.3s) ease;
}

.search-toggle:hover {
    opacity: 0.6;
}

.search-toggle:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

.search-toggle svg {
    width: 20px;
    height: 20px;
}

/* Mobile - Hide on desktop, show inline with other mobile items */
@media (max-width: 768px) {
    .header-desktop .search-toggle {
        display: none;
    }
}

/* ===== HEADER WIDGET STYLES ===== */
/* Site Logo Widget */
.zonkey-site-logo-widget .site-logo-widget-inner {
    display: flex;
    line-height: 0;
}

.zonkey-site-logo-widget .widget-logo {
    max-height: calc(var(--main-header-height, 80px) - 30px);
    width: auto;
}

/* Navigation Widget */
.zonkey-navigation-widget .widget-navigation {
    display: flex;
    align-items: center;
}

.zonkey-navigation-widget .widget-navigation.nav-align-left {
    justify-content: flex-start;
}

.zonkey-navigation-widget .widget-navigation.nav-align-center {
    justify-content: center;
}

.zonkey-navigation-widget .widget-navigation.nav-align-right {
    justify-content: flex-end;
}

.zonkey-navigation-widget .widget-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.zonkey-navigation-widget .widget-menu-toggle {
    display: none;
}

.zonkey-navigation-widget .widget-nav-menu {
    display: block;
}

/* Header widget generic styles */
.header-widget {
    display: inline-flex;
    align-items: center;
}

.header-widget p {
    margin: 0;
}

/* ===== FLEXIBLE HEADER - MOBILE/DESKTOP VISIBILITY ===== */
.header-flexible .header-desktop {
    display: flex;
}

.header-flexible .header-mobile {
    display: none;
}

@media (max-width: 768px) {
    .header-flexible .header-desktop {
        display: none;
    }

    .header-flexible .header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .header-flexible .header-zone-mobile {
        flex: 1;
    }
}

/* ===== NEW MOBILE MENU PANEL ===== */
/* Premium slide-out mobile menu like parish council example */

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: var(--mobile-menu-bg, #4a5d94);
    color: var(--mobile-menu-text, #ffffff);
    z-index: 10000;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}

.mobile-menu-panel.is-open {
    right: 0;
}

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-title {
    display: none;
}

.mobile-menu-close {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--mobile-menu-close-bg, rgba(255, 255, 255, 0.15));
    border: none;
    color: var(--mobile-menu-text, #ffffff);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    min-height: 44px;
}

.mobile-menu-close:hover,
.mobile-menu-close:focus {
    background: rgba(255, 255, 255, 0.25);
}

.mobile-menu-close:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.mobile-menu-close .close-icon {
    display: block;
    width: 18px;
    height: 18px;
    position: relative;
}

.mobile-menu-close .close-icon::before,
.mobile-menu-close .close-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: currentColor;
    top: 50%;
    left: 0;
}

.mobile-menu-close .close-icon::before {
    transform: rotate(45deg);
}

.mobile-menu-close .close-icon::after {
    transform: rotate(-45deg);
}

/* Mobile Menu Content */
.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

/* Mobile Nav Menu Styles */
.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-menu li:first-child {
    border-top: none;
}

.mobile-nav-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    color: var(--mobile-menu-text, #ffffff);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s ease;
    min-height: 48px;
}

.mobile-nav-menu > li > a:hover,
.mobile-nav-menu > li > a:focus {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-menu > li > a:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
}

/* Current Menu Item */
.mobile-nav-menu .current-menu-item > a,
.mobile-nav-menu .current_page_item > a {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
}

/* Mobile Dropdown Arrow - Premium Style */
.mobile-nav-menu .menu-item-has-children > a {
    position: relative;
}

.mobile-nav-menu .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.mobile-nav-menu .menu-item-has-children.open > a::after {
    transform: rotate(-135deg);
}

/* Mobile Submenus */
.mobile-nav-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.15);
    display: none;
}

.mobile-nav-menu .menu-item-has-children.open > .sub-menu {
    display: block;
}

.mobile-nav-menu .sub-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav-menu .sub-menu li:last-child {
    border-bottom: none;
}

.mobile-nav-menu .sub-menu a {
    display: block;
    padding: 0.875rem 1.25rem 0.875rem 2rem;
    color: var(--mobile-menu-text, #ffffff);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 400;
    opacity: 0.9;
    transition: background 0.2s ease, opacity 0.2s ease;
    min-height: 44px;
}

.mobile-nav-menu .sub-menu a:hover,
.mobile-nav-menu .sub-menu a:focus {
    background: rgba(255, 255, 255, 0.05);
    opacity: 1;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ===== DESKTOP/MOBILE HEADER VISIBILITY ===== */
/* Desktop header shown by default, mobile header hidden */
.header-desktop {
    /* Display set by child elements, not overridden here */
}

.header-mobile {
    display: none;
}

/* Mobile menu toggle is hidden on desktop */
.mobile-menu-toggle {
    display: none;
}

@media (max-width: 768px) {
    /* Hide desktop header, show mobile header */
    .header-desktop {
        display: none !important;
    }

    .header-mobile {
        display: block;
    }

    .header-mobile .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 0;
        gap: 1rem;
    }

    /* Mobile header left zone - typically logo */
    .header-mobile .header-zone-mobile-left {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }

    /* Mobile header right zone - icons before hamburger */
    .header-mobile .header-zone-mobile-right {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.75rem;
    }

    /* Widgets in mobile header zones */
    .header-zone-mobile-left .widget,
    .header-zone-mobile-right .widget {
        margin: 0;
        display: flex;
        align-items: center;
    }

    /* Show mobile menu toggle on all header types */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide the old primary-menu slide-out - use the new mobile-menu-panel instead */
    .header-standard .primary-menu,
    .header-centered .primary-menu,
    .header-centered-left .primary-menu {
        display: none !important;
    }
}

/* ===== MOBILE MENU LIST SPACING FIX ===== */
/* Override default list spacing in mobile menu */
.mobile-nav-menu li,
.mobile-nav-menu .sub-menu li {
    margin-bottom: 0 !important;
}

