/* =====================
   Custom Header
   ===================== */

.ct-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--ct-header-height, 56px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--ct-header-pad-x, 24px);
    background: transparent;
    box-sizing: border-box;
    font-family: var(--ct-font, inherit);
    transition: background 0.4s ease, box-shadow 0.3s ease;
}

.ct-header.scrolled {
    background: rgba(var(--ct-header-bg-rgb), var(--ct-header-opacity));
    backdrop-filter: blur(var(--ct-header-blur));
    -webkit-backdrop-filter: blur(var(--ct-header-blur));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Fade states */
.ct-header.ct-hidden {
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.ct-header.ct-visible {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 1s ease;
}

/* Admin bar */
.admin-bar .ct-header { top: 32px; }

@media (max-width: 782px) {
    .admin-bar .ct-header { top: 46px; }
}

/* Hide theme header */
.ct-has-custom-header .oceanwp-mobile-header,
.ct-has-custom-header #site-header,
.ct-has-custom-header header.site-header,
.ct-has-custom-header .site-header {
    display: none !important;
}

/* =====================
   Logo
   ===================== */

.ct-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.ct-header__logo img {
    height: var(--ct-logo-height);
    width: auto;
}

.ct-header__logo span {
    font-size: 18px;
    font-weight: 600;
    color: var(--ct-header-text);
}

/* =====================
   Nav
   ===================== */

.ct-header__nav {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ct-header__nav li {
    position: relative;
    list-style: none;
}

.ct-header__nav > li > a,
.ct-header__nav > li > span.ct-no-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--ct-header-text);
    text-decoration: none;
    font-family: var(--ct-font, inherit);
    font-size: var(--ct-font-size, 14px);
    font-weight: var(--ct-font-weight, 500);
    text-transform: var(--ct-nav-transform, none);
    padding: 6px 14px;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
}

/* =====================
   Dropdown Arrow
   ===================== */

.ct-arrow {
    display: none;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.ct-arrow polyline {
    stroke-width: var(--ct-arrow-thickness, 1.5);
}

.ct-dd-arrow .ct-has-sub > a .ct-arrow,
.ct-dd-arrow .ct-has-sub > .ct-no-link .ct-arrow {
    display: inline-block;
}

/* Rotate on hover */
.ct-dd-arrow.ct-arrow-rotate .ct-has-sub:hover > a .ct-arrow,
.ct-dd-arrow.ct-arrow-rotate .ct-has-sub:hover > .ct-no-link .ct-arrow {
    transform: rotate(180deg);
}

/* =====================
   Nav Hover: Pill
   ===================== */

.ct-nav-hover--pill .ct-header__nav > li > a,
.ct-nav-hover--pill .ct-header__nav > li > span.ct-no-link {
    border-radius: 20px;
}

.ct-nav-hover--pill .ct-header__nav > li > a:hover,
.ct-nav-hover--pill .ct-header__nav > li > span.ct-no-link:hover,
.ct-nav-hover--pill .ct-header__nav > li:hover > a,
.ct-nav-hover--pill .ct-header__nav > li:hover > span.ct-no-link {
    background: var(--ct-nav-hover);
    color: var(--ct-nav-hover-text, var(--ct-header-text));
}

.ct-show-active.ct-nav-hover--pill .ct-header__nav > li.current-menu-item > a,
.ct-show-active.ct-nav-hover--pill .ct-header__nav > li.current_page_item > a,
.ct-show-active.ct-nav-hover--pill .ct-header__nav > li.current-menu-ancestor > a {
    background: var(--ct-nav-active-bg, var(--ct-nav-hover));
    color: var(--ct-nav-active-text, var(--ct-nav-hover-text, var(--ct-header-text)));
}

/* =====================
   Nav Hover: Underline
   ===================== */

.ct-nav-hover--underline .ct-header__nav > li > a::after,
.ct-nav-hover--underline .ct-header__nav > li > span.ct-no-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--ct-nav-hover);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.ct-nav-hover--underline .ct-header__nav > li > a:hover::after,
.ct-nav-hover--underline .ct-header__nav > li > span.ct-no-link:hover::after,
.ct-nav-hover--underline .ct-header__nav > li:hover > a::after,
.ct-nav-hover--underline .ct-header__nav > li:hover > span.ct-no-link::after {
    transform: scaleX(1);
}

.ct-show-active.ct-nav-hover--underline .ct-header__nav > li.current-menu-item > a::after,
.ct-show-active.ct-nav-hover--underline .ct-header__nav > li.current_page_item > a::after,
.ct-show-active.ct-nav-hover--underline .ct-header__nav > li.current-menu-ancestor > a::after {
    transform: scaleX(1);
    background: var(--ct-nav-active-bg, var(--ct-nav-hover));
}

.ct-nav-hover--underline .ct-header__nav > li > a:hover,
.ct-nav-hover--underline .ct-header__nav > li > span.ct-no-link:hover,
.ct-nav-hover--underline .ct-header__nav > li:hover > a,
.ct-nav-hover--underline .ct-header__nav > li:hover > span.ct-no-link {
    color: var(--ct-nav-hover-text, var(--ct-header-text));
}

.ct-show-active.ct-nav-hover--underline .ct-header__nav > li.current-menu-item > a,
.ct-show-active.ct-nav-hover--underline .ct-header__nav > li.current_page_item > a,
.ct-show-active.ct-nav-hover--underline .ct-header__nav > li.current-menu-ancestor > a {
    color: var(--ct-nav-active-text, var(--ct-nav-hover-text, var(--ct-header-text)));
}

/* =====================
   Nav Hover: None
   ===================== */

.ct-nav-hover--none .ct-header__nav > li > a:hover,
.ct-nav-hover--none .ct-header__nav > li > span.ct-no-link:hover,
.ct-nav-hover--none .ct-header__nav > li:hover > a,
.ct-nav-hover--none .ct-header__nav > li:hover > span.ct-no-link {
    color: var(--ct-nav-hover-text, var(--ct-header-text));
}

.ct-show-active.ct-nav-hover--none .ct-header__nav > li.current-menu-item > a,
.ct-show-active.ct-nav-hover--none .ct-header__nav > li.current_page_item > a,
.ct-show-active.ct-nav-hover--none .ct-header__nav > li.current-menu-ancestor > a {
    color: var(--ct-nav-active-text, var(--ct-nav-hover-text, var(--ct-header-text)));
}

/* =====================
   Dropdowns
   ===================== */

.ct-header__nav .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: -6px;
    min-width: 180px;
    padding: 6px 0;
    margin: 0;
    list-style: none;
    background: var(--ct-dropdown-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 10000;
}

/* Invisible hover bridge — covers the gap between parent and dropdown */
.ct-header__nav .sub-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.ct-header__nav li:hover > .sub-menu {
    display: block;
}

.ct-header__nav .sub-menu a,
.ct-header__nav .sub-menu span.ct-no-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--ct-dropdown-text);
    text-decoration: none;
    padding: 8px 14px 8px var(--ct-dd-pad-left, 14px);
    font-family: var(--ct-font, inherit);
    font-size: var(--ct-dd-font-size, 13px);
    font-weight: var(--ct-font-weight, 500);
    text-transform: var(--ct-dd-transform, none);
    margin: 0 6px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
}

/* --- Dropdown Hover: Pill --- */

.ct-dd-hover--pill .ct-header__nav .sub-menu a,
.ct-dd-hover--pill .ct-header__nav .sub-menu span.ct-no-link {
    border-radius: 6px;
}

.ct-dd-hover--pill .ct-header__nav .sub-menu a:hover,
.ct-dd-hover--pill .ct-header__nav .sub-menu span.ct-no-link:hover {
    background: var(--ct-dropdown-hover);
    color: var(--ct-dd-hover-text, var(--ct-dropdown-text));
}

/* --- Dropdown Hover: Underline --- */

.ct-dd-hover--underline .ct-header__nav .sub-menu a::after,
.ct-dd-hover--underline .ct-header__nav .sub-menu span.ct-no-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: var(--ct-dd-pad-left, 14px);
    right: 14px;
    height: 2px;
    background: var(--ct-dropdown-hover);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.ct-dd-hover--underline .ct-header__nav .sub-menu a:hover::after,
.ct-dd-hover--underline .ct-header__nav .sub-menu span.ct-no-link:hover::after {
    transform: scaleX(1);
}

.ct-dd-hover--underline .ct-header__nav .sub-menu a:hover,
.ct-dd-hover--underline .ct-header__nav .sub-menu span.ct-no-link:hover {
    color: var(--ct-dd-hover-text, var(--ct-dropdown-text));
}

/* --- Dropdown Hover: Rows --- */

.ct-dd-hover--rows .ct-header__nav .sub-menu {
    padding: 0;
}

.ct-dd-hover--rows .ct-header__nav .sub-menu a,
.ct-dd-hover--rows .ct-header__nav .sub-menu span.ct-no-link {
    margin: 0;
    border-radius: 0;
    padding: 10px 14px 10px var(--ct-dd-pad-left, 14px);
}

/* Extra padding on first and last rows */
.ct-dd-hover--rows .ct-header__nav .sub-menu li:first-child > a,
.ct-dd-hover--rows .ct-header__nav .sub-menu li:first-child > span.ct-no-link {
    padding-top: calc(10px + var(--ct-dd-rows-pad-top, 0px));
}

.ct-dd-hover--rows .ct-header__nav .sub-menu li:last-child > a,
.ct-dd-hover--rows .ct-header__nav .sub-menu li:last-child > span.ct-no-link {
    padding-bottom: calc(10px + var(--ct-dd-rows-pad-bottom, 0px));
}

/* Clip hover tint to rounded corners */
.ct-dd-hover--rows .ct-header__nav .sub-menu li:first-child a,
.ct-dd-hover--rows .ct-header__nav .sub-menu li:first-child span.ct-no-link {
    border-radius: 10px 10px 0 0;
}

.ct-dd-hover--rows .ct-header__nav .sub-menu li:last-child a,
.ct-dd-hover--rows .ct-header__nav .sub-menu li:last-child span.ct-no-link {
    border-radius: 0 0 10px 10px;
}

.ct-dd-hover--rows .ct-header__nav .sub-menu li:only-child a,
.ct-dd-hover--rows .ct-header__nav .sub-menu li:only-child span.ct-no-link {
    border-radius: 10px;
}

.ct-dd-hover--rows .ct-header__nav .sub-menu li + li {
    position: relative;
}

.ct-dd-hover--rows .ct-header__nav .sub-menu li + li::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--ct-dd-divider-width, 100%);
    height: var(--ct-dd-divider-thickness, 1px);
    background: var(--ct-dd-divider-color, rgba(255,255,255,0.15));
    pointer-events: none;
}

.ct-dd-hover--rows .ct-header__nav .sub-menu a:hover,
.ct-dd-hover--rows .ct-header__nav .sub-menu span.ct-no-link:hover {
    background: var(--ct-dropdown-hover);
    color: var(--ct-dd-hover-text, var(--ct-dropdown-text));
}

/* --- Dropdown Hover: None --- */

.ct-dd-hover--none .ct-header__nav .sub-menu a:hover,
.ct-dd-hover--none .ct-header__nav .sub-menu span.ct-no-link:hover {
    color: var(--ct-dd-hover-text, var(--ct-dropdown-text));
}

/* Nested sub-menus */
.ct-header__nav .sub-menu .sub-menu {
    top: -6px;
    left: 100%;
    margin: 0;
}

.ct-header__nav .sub-menu .sub-menu::before {
    top: 0;
    left: -14px;
    right: auto;
    width: 14px;
    height: 100%;
}

/* Nested arrows point right */
.ct-header__nav .sub-menu .ct-has-sub > a .ct-arrow,
.ct-header__nav .sub-menu .ct-has-sub > .ct-no-link .ct-arrow {
    transform: rotate(-90deg);
}

.ct-header__nav .sub-menu .ct-has-sub:hover > a .ct-arrow,
.ct-header__nav .sub-menu .ct-has-sub:hover > .ct-no-link .ct-arrow {
    transform: rotate(-90deg);
}

/* =====================
   Mobile: Hamburger (opens full-screen overlay)
   ===================== */

.ct-header__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--ct-header-text) !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none;
    appearance: none;
}

.ct-header__toggle:hover,
.ct-header__toggle:focus,
.ct-header__toggle:active,
.ct-header__toggle:focus-visible {
    color: var(--ct-header-text) !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ct-header__toggle svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

@media (max-width: 768px) {
    .ct-header__toggle {
        display: block;
    }

    /* Hide desktop nav on mobile; menu is in full-screen overlay only */
    .ct-header__nav {
        display: none !important;
    }
}

/* =====================
   Full-Screen Mobile Overlay
   ===================== */

/* Prevent overscroll revealing page behind when menu is open */
body.ct-mobile-overlay-open {
    overscroll-behavior: none;
}

.ct-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: var(--ct-mobile-overlay-bg, #1a1d28);
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    box-sizing: border-box;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.ct-mobile-overlay.ct-mobile-overlay--open {
    display: flex;
}

.ct-mobile-overlay__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    background: none !important;
    border: none !important;
    padding: 12px;
    cursor: pointer;
    color: var(--ct-mobile-close-color, #ffffff) !important;
    line-height: 0;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none;
    appearance: none;
}

.ct-mobile-overlay__close:hover,
.ct-mobile-overlay__close:focus,
.ct-mobile-overlay__close:active,
.ct-mobile-overlay__close:focus-visible {
    color: var(--ct-mobile-close-color, #ffffff) !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ct-mobile-overlay__close svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.ct-mobile-overlay__nav {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 60px 24px 40px;
}

.ct-mobile-overlay__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ct-mobile-overlay__menu > li {
    list-style: none;
    margin: 0;
}

.ct-mobile-overlay__menu > li > a,
.ct-mobile-overlay__menu > li > span.ct-no-link {
    display: block;
    color: var(--ct-mobile-text-color, #ffffff);
    text-decoration: none;
    font-family: var(--ct-mobile-font, inherit);
    font-size: var(--ct-mobile-font-size, 18px);
    font-weight: var(--ct-mobile-font-weight, 500);
    text-transform: var(--ct-mobile-transform, none);
    padding: 14px 16px;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.ct-mobile-overlay__menu > li > a:hover,
.ct-mobile-overlay__menu > li > span.ct-no-link:hover {
    color: var(--ct-mobile-hover-color, var(--ct-mobile-text-color, #ffffff));
    background: var(--ct-mobile-hover-bg, transparent);
}

.ct-mobile-overlay__menu > li.current-menu-item > a,
.ct-mobile-overlay__menu > li.current_page_item > a,
.ct-mobile-overlay__menu > li.current-menu-ancestor > a {
    color: var(--ct-mobile-active-color, var(--ct-mobile-text-color, #ffffff));
    background: var(--ct-mobile-active-bg, transparent);
}

/* Parent items with sub-menus: show arrow, allow expand/collapse */
.ct-mobile-overlay__menu li.ct-has-sub > a,
.ct-mobile-overlay__menu li.ct-has-sub > span.ct-no-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Arrow for parent items with sub-menus */
.ct-mobile-overlay__menu li.ct-has-sub .ct-arrow {
    display: inline-block;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.ct-mobile-overlay__menu li.ct-has-sub.ct-mobile-sub-open .ct-arrow {
    transform: rotate(180deg);
}

/* Sub-menus in overlay: vertical, indented, collapsed by default */
.ct-mobile-overlay__menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 20px;
    display: none;
}

.ct-mobile-overlay__menu li.ct-has-sub.ct-mobile-sub-open > .sub-menu {
    display: block;
    margin-top: 4px;
}

.ct-mobile-overlay__menu .sub-menu li {
    list-style: none;
    margin: 0;
}

.ct-mobile-overlay__menu .sub-menu a,
.ct-mobile-overlay__menu .sub-menu span.ct-no-link {
    display: block;
    color: var(--ct-mobile-sub-text-color, var(--ct-mobile-text-color, #ffffff));
    text-decoration: none;
    font-family: var(--ct-mobile-sub-font, inherit);
    font-size: var(--ct-mobile-sub-font-size, 16px);
    font-weight: var(--ct-mobile-sub-font-weight, 500);
    text-transform: var(--ct-mobile-sub-transform, none);
    padding: 10px 16px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.ct-mobile-overlay__menu .sub-menu a:hover,
.ct-mobile-overlay__menu .sub-menu span.ct-no-link:hover {
    color: var(--ct-mobile-sub-hover-color, var(--ct-mobile-sub-text-color, var(--ct-mobile-text-color, #ffffff)));
    background: var(--ct-mobile-sub-hover-bg, transparent);
}

.ct-mobile-overlay__menu .sub-menu li.current-menu-item > a,
.ct-mobile-overlay__menu .sub-menu li.current_page_item > a {
    color: var(--ct-mobile-sub-active-color, var(--ct-mobile-sub-text-color, var(--ct-mobile-text-color, #ffffff)));
    background: var(--ct-mobile-sub-active-bg, transparent);
}

/* Only show overlay on mobile */
@media (min-width: 769px) {
    .ct-mobile-overlay {
        display: none !important;
    }
}
