body {
    padding-top: 0;
}

body.no-scroll {
    overflow: hidden;
}

/* Premium Glassmorphism Header */
.cb-premium-header {
    background: rgba(255, 255, 255, 0.85);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    /* Glass effect */
    -webkit-backdrop-filter: blur(12px);
    /* Safari support */
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    /* Subtle border-like shadow */
    position: sticky;
    top: 0;
    z-index: var(--cb-z-index-sticky, 1000);
    font-family: var(--cb-font-main);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.cb-premium-header.is-scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
}

.cb-container {
    max-width: var(--cb-container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Top Bar */
.header-top-bar {
    padding: 12px 0;
    /* Removed border-bottom to clean up look */
}

.header-top-bar .cb-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

/* Logo */
.site-branding {
    flex-shrink: 0;
    width: auto;
    display: flex;
    align-items: center;
}

.cb-logo-img {
    height: 48px;
    /* Refined size */
    width: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.site-branding:hover .cb-logo-img {
    transform: scale(1.02);
}

/* Search Bar Container */
.header-search {
    flex: 1;
    max-width: 600px;
    position: relative;
    z-index: 1001;
    /* Above nav */
    margin: 0 40px;
}

/* Utility Nav */
.utility-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 24px;
    align-items: center;
}

.utility-nav a {
    text-decoration: none;
    color: var(--cb-text-main);
    /* Darker text */
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.utility-nav a:hover {
    color: var(--cb-color-primary);
    opacity: 1;
    transform: translateY(-1px);
}

/* Main Navigation */
.header-main-nav {
    padding: 0;
    /* Removing padding, letting menu items define height */
    /* Removed background var to keep glass effect visible */
    border-top: 1px solid rgba(0, 0, 0, 0.03);
}

#cb-primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    /* Gap for pill shapes */
    flex-wrap: wrap;
}

#cb-primary-menu>li>a {
    text-decoration: none;
    color: var(--cb-text-main);
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    padding: 12px 18px;
    /* Larger hit area */
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

/* Modern Pill Hover Effect */
#cb-primary-menu>li>a:hover,
#cb-primary-menu>li.current-menu-item>a {
    color: var(--cb-color-primary);
    background: rgba(99, 102, 241, 0.08);
    /* Primary color low opacity */
}

/* Remove old underline */
#cb-primary-menu>li>a::after {
    display: none;
}

/* Dropdown */
#cb-primary-menu .menu-item-has-children {
    position: relative;
}

#cb-primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #ffffff;
    min-width: 220px;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1002;
}

#cb-primary-menu .menu-item-has-children:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

#cb-primary-menu .sub-menu a {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--cb-text-main);
    font-weight: 500;
    display: block;
    text-decoration: none;
    transition: all 0.2s;
}

#cb-primary-menu .sub-menu a:hover {
    background: #f8fafc;
    color: var(--cb-color-primary);
    transform: translateX(2px);
}


/* Mobile Menu - Hamburger */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

.menu-toggle {
    background: rgba(0, 0, 0, 0.03);
    border: none;
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
}

.hamburger-box {
    width: 24px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 24px;
    height: 2px;
    background-color: var(--cb-text-main);
    border-radius: 4px;
    position: absolute;
    transition: transform 0.15s ease;
    display: block;
}

.hamburger-inner {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-inner::before {
    content: "";
    top: -8px;
}

.hamburger-inner::after {
    content: "";
    bottom: -8px;
}

/* Mobile Menu Overlay/Drawer */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--cb-transition-normal);
}

.mobile-menu-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: #ffffff;
    padding: 30px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    /* Apple-like easing */
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
}

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

.mobile-menu-overlay.is-active .mobile-menu-container {
    transform: translateX(0);
}

.mobile-menu-close {
    align-self: flex-end;
    background: rgba(0, 0, 0, 0.03);
    border: none;
    cursor: pointer;
    color: var(--cb-text-main);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    transition: background 0.2s;
}

.mobile-menu-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav a {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cb-text-main);
    text-decoration: none;
    display: block;
    padding: 12px 16px;
    border-radius: 12px;
    transition: background 0.2s;
}

.mobile-nav a:hover {
    background: #f8fafc;
    color: var(--cb-color-primary);
}

.mobile-nav .sub-menu {
    padding-left: 12px;
    margin-top: 4px;
    border-left: 2px solid var(--cb-bg-subtle);
}

/* Breakpoints */
@media (max-width: 900px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .cb-premium-header .cb-container {
        padding: 12px 20px;
    }
}

@media (max-width: 600px) {
    .cb-logo-img {
        height: 40px;
        /* Slightly smaller logo on mobile */
    }

    .cb-premium-header .cb-container {
        padding: 10px 16px;
    }

    .menu-toggle {
        padding: 10px;
    }

    .mobile-menu-container {
        width: 85%;
        /* Responsive drawer width */
        max-width: 320px;
    }
}