.cr-header {
    width: 100%;
    position: relative;
    z-index: 50;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, border-radius 0.25s ease;
}

.cr-header-inner {
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    gap: 32px;
}

.cr-header-section {
    display: flex;
    align-items: center;
}

.cr-header-section-left,
.cr-header-section-right {
    flex: 1;
    min-width: 0;
}

.cr-header-section-left {
    padding-left: 56px; /* Balance the burger space on the right for symmetry */
}

.cr-header-section-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.cr-header-logo img,
.cr-header-logo svg {
    display: block;
    max-height: 60px;
    max-width: 100%;
    height: auto;
}

.cr-header-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 24px;
}

.cr-header-menu li {
    margin: 0;
}

.cr-header-menu a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.cr-header-section-right {
    justify-content: flex-end;
    gap: 24px;
    position: relative;
    padding-right: 56px;
}

.cr-header-burger-box {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: transparent;
    overflow: hidden;
    transform-origin: top right;
    transform: none;
    transition: width 0.3s ease, height 0.3s ease, border-radius 0.3s ease, box-shadow 0.3s ease;
}

.cr-header-burger {
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 42px;
    border: none !important;
    background: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    cursor: pointer;
    z-index: 2;
    box-shadow: none !important;
    transition: transform 0.2s ease;
}

.cr-header-burger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cr-header-burger-icon img,
.cr-header-burger-icon svg,
.cr-header-burger-icon i {
    display: block;
    width: 60%;
    height: 60%;
}

.cr-header-burger-line {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #000000;
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.cr-header-burger-line + .cr-header-burger-line {
    margin-top: 4px;
}

.cr-header-burger-box:hover {
    box-shadow: none !important;
}

.cr-header-burger-panel {
    position: relative;
    flex: 1 1 auto;
    padding: 56px 20px 20px 20px;
    background: transparent;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.cr-header-burger-panel-light-border {
    position: relative;
}

.cr-header-burger-panel-light-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid var(--cr-burger-light-color, rgba(255, 255, 255, 0.9));
    box-shadow: 0 0 10px var(--cr-burger-light-color, rgba(255, 255, 255, 0.7));
    opacity: 0.45;
    pointer-events: none;
    animation: cr-burger-light-border-pulse var(--cr-burger-light-speed, 6s) ease-in-out infinite;
}

@keyframes cr-burger-light-border-pulse {
    0%, 100% {
        opacity: 0.25;
        box-shadow: 0 0 6px var(--cr-burger-light-color, rgba(255, 255, 255, 0.5));
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 16px var(--cr-burger-light-color, rgba(255, 255, 255, 0.9));
    }
}

.cr-header-burger-panel {
    scrollbar-width: none;
}

.cr-header-burger-panel::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.cr-header-burger-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.cr-header-burger-menu li {
    margin: 0;
}

.cr-header-burger-menu a {
    color: #ffffff;
    text-decoration: none;
    display: block;
}

.cr-header-burger-socials {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.cr-header-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
}

.cr-header-burger-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.cr-header-burger-email-link {
    color: inherit;
    text-decoration: none;
    font-size: 14px;
}

.cr-header-burger-open .cr-header-burger-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cr-header-burger-open .cr-header-burger-box {
    width: 320px !important;
    height: 280px !important;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.cr-header-burger-open .cr-header-burger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.cr-header-burger-open .cr-header-burger-line:nth-child(2) {
    opacity: 0;
}

.cr-header-burger-open .cr-header-burger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.cr-header-burger-open .cr-header-burger::before {
    content: '×';
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
}

.cr-header-burger-open .cr-header-burger-line {
    display: none;
}

.cr-header-burger-open .cr-header-burger-has-custom::before {
    content: none;
}

.cr-header--compact {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.cr-header--compact .cr-header-inner {
    max-width: none;
    margin: 0;
    padding: 18px 26px;
}

.cr-header--compact .cr-header-logo img {
    transform: scale(0.9);
}

/* Off-Canvas Styles */
.cr-off-canvas-trigger {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
}

.cr-off-canvas-trigger svg,
.cr-off-canvas-trigger img {
    width: 28px;
    height: 28px;
    display: block;
}

.cr-off-canvas-menu {
    position: fixed;
    top: 0;
    left: 0; /* Menu on the left */
    width: 70%; /* Width of the menu */
    max-width: 500px; /* Increased max-width slightly */
    height: 100vh;
    /* Removed default background-color so inline style takes full effect */
    z-index: 1; /* Behind wrapper */
    display: flex;
    flex-direction: column;
    padding: 60px 40px;
    visibility: hidden; /* Hidden until active */
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0.4s;
    overflow: hidden; /* Prevent scrolling within menu container if desired, use auto if content is long */
}

.cr-off-canvas-inner {
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex: 1;
    overflow-y: auto; /* Allow inner content to scroll if needed, but hide scrollbar if possible */
}

/* Force Vertical Menu Layout */
.cr-off-canvas-nav {
    display: block;
    width: 100%;
}

.cr-off-canvas-nav ul,
.cr-off-canvas-nav > div > ul { /* Target potential WP menu wrappers */
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column; /* Force vertical stacking */
    gap: 20px;
    width: 100%;
}

.cr-off-canvas-nav li {
    margin-bottom: 0; /* Reset margin in favor of gap */
    display: block;
    width: 100%;
}

.cr-off-canvas-nav a {
    text-decoration: none;
    color: #ffffff; /* Default text color */
    font-size: 24px;
    font-weight: 500;
    transition: color 0.3s;
    display: block;
    width: 100%;
    -webkit-tap-highlight-color: transparent; /* Prevent default tap highlight */
}

/* Close button removed */
.cr-off-canvas-close {
    display: none;
}

/* Staggered Animation for Menu Items */
@keyframes crFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure items are hidden initially when menu is closed or just opening */
.cr-off-canvas-nav li {
    opacity: 0; 
}

/* Trigger animation when menu is open */
body.cr-off-canvas-open .cr-off-canvas-nav li {
    animation: crFadeInUp 0.8s ease forwards;
}

/* Delays for staggered effect */
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(1) { animation-delay: 0.2s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(2) { animation-delay: 0.4s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(3) { animation-delay: 0.6s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(4) { animation-delay: 0.8s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(5) { animation-delay: 1.0s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(6) { animation-delay: 1.2s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(7) { animation-delay: 1.4s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(8) { animation-delay: 1.6s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(9) { animation-delay: 1.8s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(10) { animation-delay: 2.0s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(11) { animation-delay: 2.2s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(12) { animation-delay: 2.4s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(13) { animation-delay: 2.6s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(14) { animation-delay: 2.8s; }
body.cr-off-canvas-open .cr-off-canvas-nav li:nth-child(15) { animation-delay: 3.0s; }

/* Page Wrapper Setup */
.cr-page-wrapper {
    position: relative;
    z-index: 10;
    background-color: #ffffff; /* Ensure opaque background */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-radius 0.4s ease;
    width: 100%;
    min-height: 100vh;
    transform-origin: center center;
    box-shadow: 0 0 0 rgba(0,0,0,0); /* Initial shadow */
}

/* Body State when Menu Open */
body.cr-off-canvas-open {
    overflow: hidden;
    background-color: var(--cr-oc-bg, #000000);
}

body.cr-off-canvas-open .cr-page-wrapper {
    /* Scale down and move based on direction - use fallback values in var() */
    transform: scale(var(--cr-oc-scale, 0.75)) translateX(calc(var(--cr-oc-dir, 1) * (60% - var(--cr-oc-offset-x, 20px)))) translateY(var(--cr-oc-offset-y, 0px));
    border-radius: var(--cr-oc-radius, 40px);
    border: var(--cr-oc-border-width, 0px) solid var(--cr-oc-border-color, transparent);
    
    pointer-events: none;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    
    /* Ensure content inside doesn't spill out of rounded corners */
    overflow: hidden;
}

body.cr-off-canvas-open .cr-off-canvas-menu.cr-menu-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* Ensure other menus stay hidden */
body.cr-off-canvas-open .cr-off-canvas-menu:not(.cr-menu-active) {
    display: none;
}


/* Overlay to close menu */
body.cr-off-canvas-open .cr-page-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.0); /* Transparent overlay just to catch clicks if needed, or minimal tint */
    border-radius: var(--cr-oc-radius, 40px);
    pointer-events: auto; /* Allow clicking to close */
    z-index: 1000;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* Prevent dark highlight on tap */
}

@media (max-width: 767px) {
    .cr-header-inner {
        position: relative;
        padding: 18px 8px 18px 16px;
        gap: 16px;
    }

    .cr-header-section-left > .cr-header-menu,
    .cr-header-section-right > .cr-header-menu {
        display: none;
    }

    .cr-header-section-left,
    .cr-header-section-right {
        flex: 0 0 auto;
    }

    .cr-header-section-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        justify-content: center;
    }

    .cr-header-section-right {
        padding-right: 0;
    }

    .cr-header-section-left {
        padding-left: 0;
    }

    .cr-header-burger-box {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        overflow: visible;
    }

    .cr-header-burger {
        position: relative;
    }

    .cr-header-burger-panel {
        position: absolute;
        top: 100%;
        right: 0;
    }

    .cr-header-burger-open .cr-header-burger-box {
        width: auto !important;
        height: auto !important;
        max-width: none;
        max-height: none;
        box-shadow: none;
    }

    /* Mobile Off-Canvas overrides */
    .cr-off-canvas-trigger {
        display: flex;
    }
    
    /* Hide standard burger if off-canvas is enabled */
    [data-cr-mobile-off-canvas="yes"] .cr-header-burger-box {
        display: none !important;
    }
}

@media (max-width: 767px) {
    [data-cr-header-disable-mobile="1"] {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }
}

/* Sub-menu Styles for Off-Canvas and Burger Panel */
.cr-off-canvas-menu .menu-item-has-children,
.cr-header-burger-menu .menu-item-has-children {
    display: grid !important;
    grid-template-columns: min-content 1fr !important; /* Arrow Left, Text Right */
    align-items: center !important;
    gap: 0 !important;
    position: relative;
    overflow: visible !important; /* Ensure nothing is clipped */
}

/* 
   SCENARIO A: JS Wrapper exists (New Logic) 
   The wrapper takes the full first row.
*/
.cr-menu-link-wrapper {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    justify-content: flex-start !important; /* Align start */
    position: relative;
    z-index: 20; /* Wrapper above everything */
}

/* 
   SCENARIO B: JS Wrapper MISSING (Old Logic / Cache)
   We explicitly place the toggle and link in the grid.
*/
/* Force SVG Color */
.cr-sub-menu-toggle svg,
.cr-sub-menu-toggle svg path {
    stroke: #ffffff !important;
    fill: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Target the link when it is a direct child (No Wrapper Scenario) */
.cr-off-canvas-menu .menu-item-has-children > a,
.cr-header-burger-menu .menu-item-has-children > a {
    grid-column: 1 !important; /* Move to Left */
    grid-row: 1 !important;
    width: auto !important;
    display: block !important;
}

/* 
   SUB-MENU: Always on the second row, full width
*/
.cr-off-canvas-menu .menu-item-has-children > .sub-menu,
.cr-off-canvas-menu .menu-item-has-children > ul {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
}

.cr-sub-menu-toggle {
    width: 44px; /* Slightly larger touch target */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.2s;
    opacity: 1; /* High visibility */
    margin-left: 8px; /* Spacing between text and arrow */
    margin-right: 0px; /* Reset */
    border-radius: 50%; /* Circular touch target */
    color: #ffffff; /* Explicit white color */
    z-index: 10; /* Ensure it is above other elements */
    position: relative;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Wrapper Link Styles */
.cr-menu-link-wrapper a {
    flex: 1; /* Take remaining space */
    display: block;
    width: auto;
    margin: 0;
}

.cr-sub-menu-toggle:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2); /* Hover feedback */
}

.cr-sub-menu-toggle svg {
    width: 20px; /* Larger icon */
    height: 20px;
    display: block;
}

.cr-sub-menu-open > .cr-sub-menu-toggle {
    /* transform: rotate(180deg); REMOVED - Icon changes instead */
    background-color: rgba(255, 255, 255, 0.2); /* Active state */
}

.cr-off-canvas-menu .sub-menu,
.cr-header-burger-menu .sub-menu,
.cr-off-canvas-menu ul.sub-menu,
.cr-header-burger-menu ul.sub-menu,
/* GENERIC FALLBACK: Hide ANY nested ul */
.cr-off-canvas-nav ul, 
.cr-header-burger-menu ul,
/* Aggressively hide active states */
.cr-off-canvas-nav .current-menu-ancestor > .sub-menu,
.cr-off-canvas-nav .current-menu-parent > .sub-menu,
.cr-off-canvas-nav .current-menu-item > .sub-menu {
    flex-basis: 100%;
    width: 100%;
    margin-left: 0;
    padding-left: 0; /* Removed indentation as requested */
    margin-top: 0;
    display: none !important;
    flex-direction: column;
    gap: 12px;
}

.cr-sub-menu-open > .sub-menu,
.cr-sub-menu-open > ul {
    display: flex !important;
    padding-top: 10px;
    margin-bottom: 20px;
}

.cr-off-canvas-menu .sub-menu a,
.cr-header-burger-menu .sub-menu a {
    font-size: 0.85em;
}

/* Desktop Sub-Menu Styles */
.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .menu-item-has-children {
    position: relative;
}

/* Hide default indicators */
.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .menu-item-has-children::after,
.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .menu-item-has-children > a::after,
.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .menu-item-has-children .sub-menu-toggle {
    display: none !important;
    content: none !important;
}

/* Sub-menu container */
.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .sub-menu {
    position: absolute;
    top: 100%;
    left: 0; /* Aligned left by default */
    min-width: 240px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.98);
    transform-origin: top left;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 100;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid rgba(0,0,0,0.04);
}

/* Hover state */
.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .menu-item-has-children:hover > .sub-menu,
.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Sub-menu items */
.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .sub-menu li {
    display: block;
    margin: 0;
    width: 100%;
}

.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .sub-menu a {
    display: block;
    padding: 10px 16px;
    color: #111111 !important; /* Force dark text for readability on white bg */
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    white-space: normal; /* Allow wrapping if needed */
    line-height: 1.4;
}

.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .sub-menu a:hover {
    background-color: #f5f5f7;
    color: #000000 !important;
    transform: translateX(4px);
}

/* Nested sub-menus (Level 3+) */
.cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .sub-menu .menu-item-has-children > .sub-menu {
    top: -12px;
    left: 100%;
    margin-left: 12px;
    display: flex !important;
}

/* Fix for right-aligned menus (prevent overflow) */
.cr-header-section-right .cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .sub-menu {
    left: auto;
    right: 0;
    transform-origin: top right;
}

.cr-header-section-right .cr-header-menu:not(.cr-off-canvas-nav):not(.cr-header-burger-menu) .sub-menu .menu-item-has-children > .sub-menu {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 12px;
}

