/* Desktop header: single white row (logo | menu | search toggle + auth actions). */
.ch-main-header,
.ch-bar {
    background: #fff;
}
.ch-bar {
    position: relative;
    border-bottom: 1px solid #e8eaee;
}
.ch-bar-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
}
.ch-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}
.ch-logo img {
    height: 44px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

/* Menu */
.ch-nav {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}
.ch-nav .heder__category {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    height: 64px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.ch-nav .heder__category::-webkit-scrollbar {
    display: none;
}
/* Items must never shrink, otherwise padding collapses and labels touch each other. */
.ch-nav .heder__category > *,
.ch-nav .menu-style-2-item,
.ch-nav .header-menu-item {
    flex: 0 0 auto !important;
}

/* Scroll arrows (shown by JS via .show-scroll-left / .show-scroll-right on .ch-nav) */
.ch-nav .menu-scroll-arrow {
    position: absolute;
    top: 0;
    width: 40px;
    height: 64px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
    color: #374151;
    font-size: 13px;
}
.ch-nav .menu-scroll-arrow-left { left: 0; justify-content: flex-start; }
.ch-nav .menu-scroll-arrow-right { right: 0; justify-content: flex-end; }
.ch-nav.show-scroll-left .menu-scroll-arrow-left,
.ch-nav.show-scroll-right .menu-scroll-arrow-right {
    display: flex !important;
}
.ch-nav .heder__category > *,
.ch-nav .menu-style-2-item,
.ch-nav .menu-style-2-list,
.ch-nav .menu-style-3-item,
.ch-nav .menu-style-3-list,
.ch-nav .header-menu-item,
.ch-nav .header-menu-item li {
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    min-width: 0 !important;
}
.ch-nav .menu-style-2-link,
.ch-nav .menu-style-3-link,
.ch-nav .header-menu-item li a {
    margin: 0 !important;
    padding: 0 14px !important;
    gap: 4px;
}
.ch-nav .menu-style-2-arrow,
.ch-nav .menu-style-3-arrow {
    margin: 0 0 0 2px !important;
}
.ch-nav .menu-style-2-item,
.ch-nav .menu-style-2-list,
.ch-nav .menu-style-3-item,
.ch-nav .menu-style-3-list {
    height: 64px;
}
.ch-nav .menu-style-2-link,
.ch-nav .menu-style-3-link,
.ch-nav .header-menu-item li a {
    display: flex;
    align-items: center;
    height: 64px;
    color: #1f2937;
    font-size: 15px;
    font-weight: 600;
    text-transform: none;
    white-space: nowrap;
    position: relative;
}
.ch-nav .menu-style-2-link .cat__item__name {
    color: inherit;
}
.ch-nav .menu-style-2-link:hover,
.ch-nav .menu-style-3-link:hover,
.ch-nav .header-menu-item li a:hover {
    color: var(--primary-color);
}
/* Active-style underline on hover */
.ch-nav .menu-style-2-link::after,
.ch-nav .menu-style-3-link::after,
.ch-nav .header-menu-item li a::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}
.ch-nav .menu-style-2-link:hover::after,
.ch-nav .menu-style-3-link:hover::after,
.ch-nav .header-menu-item li a:hover::after {
    transform: scaleX(1);
}
.ch-nav .header-menu-item,
.ch-nav .header-menu-item li {
    display: flex;
    align-items: center;
    height: 64px;
}
.ch-nav .menu-style-2-arrow,
.ch-nav .menu-style-3-arrow {
    border-color: transparent #6b7280 #6b7280 transparent;
}
.ch-nav .menu-scroll-arrow {
    height: 64px;
    color: #374151;
}
.ch-nav .menu-scroll-arrow-left {
    background: linear-gradient(to right, #fff 55%, transparent);
}
.ch-nav .menu-scroll-arrow-right {
    background: linear-gradient(to left, #fff 55%, transparent);
}

/* Actions */
.ch-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ch-search-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.ch-search-toggle:hover,
.ch-search-toggle[aria-expanded="true"] {
    background: var(--primary-color);
    color: #fff;
}
.ch-auth-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ch-auth-link.ch-auth-outline {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    background: #fff;
}
.ch-auth-link.ch-auth-outline:hover {
    background: var(--primary-color);
    color: #fff;
}
.ch-auth-link.ch-auth-solid {
    color: #fff;
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.ch-auth-link.ch-auth-solid:hover {
    filter: brightness(0.92);
    color: #fff;
}

/* Search panel (opens below the bar) */
.ch-search-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border-bottom: 1px solid #e8eaee;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    padding: 14px 0;
    z-index: 1000;
}
.ch-search-panel.is-open {
    display: block;
}
.ch-search-panel .main-search {
    position: relative;
    margin: 0 auto;
    max-width: 720px;
}
.ch-search-panel .main-search form {
    display: flex;
    align-items: stretch;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
    height: auto;
}
.ch-search-panel .main-search form:focus-within {
    border-color: var(--primary-color);
}
.ch-search-panel .main-search input {
    flex: 1 1 auto;
    width: auto;
    float: none;
    height: 46px;
    padding: 0 20px;
    background: transparent;
    border: 0;
    font-size: 15px !important;
}
.ch-search-panel .main-search button {
    flex: 0 0 56px;
    width: 56px;
    float: none;
    height: 46px;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Fixed header height is 65px (64 + border); reserve it for page content on desktop. */
@media (min-width: 768px) {
    #content {
        padding-top: 65px;
    }
}

@media (max-width: 1200px) {
    .ch-bar-inner { gap: 14px; }
    .ch-nav .menu-style-2-link,
    .ch-nav .menu-style-3-link,
    .ch-nav .header-menu-item li a {
        font-size: 14px;
        padding: 0 11px !important;
    }
    .ch-nav .menu-style-2-link::after,
    .ch-nav .menu-style-3-link::after,
    .ch-nav .header-menu-item li a::after {
        left: 11px;
        right: 11px;
    }
    .ch-auth-link { padding: 0 12px; }
}
@media (max-width: 767px) {
    .ch-main-header { display: none; }
}
