/* ═══════════════════════════════════════════════════════════════
   CB Header Widget – Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset / Box ────────────────────────────────────────────── */
.cb-hw-header *,
.cb-hw-header *::before,
.cb-hw-header *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
.cb-hw-search-input{
    border: none!important;
}
/* ── Wrapper ────────────────────────────────────────────────── */
.cb-hw-header {
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    z-index: 9000;
    width: 100%;
}

/* ════════════════════════════════════════
   TOP BAR
════════════════════════════════════════ */
.cb-hw-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    flex-wrap: nowrap;
}

/* ── Logo ───────────────────────────────────────────────────── */
.cb-hw-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.cb-hw-logo img {
    width: 135px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}
.cb-hw-logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
}

/* ── Desktop Search ─────────────────────────────────────────── */
.cb-hw-search-form {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #22222226;
    border-radius: 9999px;
    overflow: visible;
    background: #fff;
    flex-grow: 0;
    max-width: 420px;
}
.cb-hw-desktop-search {
    display: none; /* shown via JS / media query */
}
.cb-hw-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-weight: 300;
    color: #222;
    min-width: 0;
}
.cb-hw-search-input::placeholder { font-weight: 300; color: #999; }
.cb-hw-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    display: flex;
    align-items: center;
}
.cb-hw-search-btn svg { width: 20px; height: 20px; stroke: #222; }

/* Live search results */
.cb-hw-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    z-index: 99999;
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}
.cb-hw-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #222;
    border-bottom: 1px solid #f3f4f6;
    transition: background .15s;
}
.cb-hw-search-result-item:last-child { border-bottom: none; }
/* .cb-hw-search-result-item:hover { background: #f9fafb; } */
.cb-hw-result-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f3f4f6;
}
.cb-hw-result-info { display: flex; flex-direction: column; gap: 2px; }
.cb-hw-result-title { font-size: .875rem; font-weight: 500; color: #111; }
.cb-hw-result-price { font-size: .8rem; color: #06402B; }
.cb-hw-result-type {
    font-size: .7rem;
    color: #6b7280;
    text-transform: capitalize;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 1px 5px;
    width: fit-content;
}
.cb-hw-no-results {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
    font-size: .875rem;
}

/* ── Actions ────────────────────────────────────────────────── */
.cb-hw-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Place desktop search beside account/cart on the right */
.cb-hw-actions .cb-hw-desktop-search {
    display: flex;
    order: 1;
}
.cb-hw-actions .cb-hw-account-link,
.cb-hw-actions .cb-hw-cart-link,
.cb-hw-actions .cb-hw-mobile-search-toggle {
    order: 2;
}
.cb-hw-account-link,
.cb-hw-cart-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #222;
    padding: 6px;
    border-radius: 8px;
    transition: background .15s;
}
.cb-hw-account-link:hover,
.cb-hw-cart-link:hover { background: #f3f4f6; }
.cb-hw-account-link svg,
.cb-hw-cart-link svg { width: 22px; height: 22px; stroke: #555; }
.cb-hw-account-label {
    font-size: .875rem;
    font-weight: 300;
    white-space: nowrap;
}
.cb-hw-cart-link { position: relative; }
.cb-hw-cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #222;
    color: #fff;
    font-size: 10px;
    line-height: 15px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    text-align: center;
    display: block;
}

/* Mobile search toggle & hamburger */
.cb-hw-hamburger,
.cb-hw-mobile-search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: background .15s;
}
.cb-hw-hamburger:hover,
.cb-hw-mobile-search-toggle:hover { background: #f3f4f6; }
.cb-hw-hamburger svg,
.cb-hw-mobile-search-toggle svg { width: 22px; height: 22px; stroke: #555; }

/* ════════════════════════════════════════
   MOBILE SEARCH BAR (full width strip)
════════════════════════════════════════ */
.cb-hw-mobile-search-bar {
    padding: 8px 0;
    border-top: none;
}
.cb-hw-mobile-search-form { max-width: 100%; width: 100%; border-radius: 8px; }

/* ════════════════════════════════════════
   NAV BAR (desktop)
════════════════════════════════════════ */
.cb-hw-nav-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0 0px;
    border-top: none;
    flex-wrap: wrap;
}

/* Desktop nav list */
.cb-hw-nav-desktop {
    list-style: none;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
}
.cb-hw-nav-item {
    position: static;
}
.cb-hw-has-dropdown {
    /* create a small hover "bridge" to prevent dropdown flicker */
    padding-bottom: 0;
}
.cb-hw-nav-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    cursor: pointer;
    opacity: .75;
    transition: opacity .2s;
    font-size: .85rem;
    color: #222;
    border-radius: 8px;
    position: relative;
}
.cb-hw-nav-label a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cb-hw-nav-label:hover,
.cb-hw-nav-item:hover > .cb-hw-nav-label { opacity: 1; background: transparent; }
.cb-hw-menu-icon { width: 28px; height: 28px; stroke: #555; }
.cb-hw-chevron { width: 10px; height: 6px; stroke: #555; }

/* Dropdown */
.cb-hw-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: auto;
    min-width: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.1);
    padding: 20px;
    z-index: 99999;
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(0);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.cb-hw-has-dropdown:hover .cb-hw-dropdown,
.cb-hw-has-dropdown:focus-within .cb-hw-dropdown,
.cb-hw-dropdown:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}
.cb-hw-dropdown-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    max-height: 320px;
    overflow-y: auto;
}
.cb-hw-dropdown-item a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: .85rem;
    white-space: nowrap;
    transition: background .12s, color .12s;
}
/* .cb-hw-dropdown-item a:hover { background: #f0fdf4; color: #06402B; } */

/* Sub-sub menu */
.cb-hw-submenu {
    list-style: none;
    margin-left: 12px;
    padding-left: 8px;
    border-left: 2px solid #e5e7eb;
    margin-top: 4px;
}
.cb-hw-submenu li a {
    font-size: .8rem;
    color: #555;
    padding: 4px 8px;
    display: block;
    border-radius: 4px;
    text-decoration: none;
    transition: background .12s;
}
/* .cb-hw-submenu li a:hover { background: #f0fdf4; color: #06402B; } */

/* ── Phone ──────────────────────────────────────────────────── */
.cb-hw-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    color: #444;
    white-space: nowrap;
    margin-left: auto;
}
.cb-hw-phone svg { width: 16px; height: 16px; stroke: #555; }
.cb-hw-phone a { color: inherit; text-decoration: none; }
/* .cb-hw-phone a:hover { color: #06402B; } */

/* ════════════════════════════════════════
   MOBILE NAV DRAWER
════════════════════════════════════════ */
.cb-hw-mobile-nav {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #06402B;
    z-index: 999999;
    overflow-y: auto;
    transition: left .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
}
.cb-hw-mobile-nav.cb-hw-open { left: 0; }
.cb-hw-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 999998;
    backdrop-filter: blur(2px);
}
.cb-hw-mobile-overlay.cb-hw-active { display: block; }

.cb-hw-mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.15);
}
.cb-hw-mobile-nav-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
    padding: 6px;
    border-radius: 6px;
    transition: background .15s;
}
/* .cb-hw-mobile-nav-close:hover { background: rgba(255,255,255,.1); } */
.cb-hw-mobile-nav-close svg { width: 20px; height: 20px; stroke: #fff; }

/* Mobile menu list */
.cb-hw-mobile-menu {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}
.cb-hw-mobile-item { border-bottom: 1px solid rgba(255,255,255,.08); }
.cb-hw-mobile-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cb-hw-mobile-item-row a {
    display: block;
    padding: 14px 18px;
    color: #fff;
    text-decoration: none;
    font-size: .9rem;
    flex: 1;
    transition: background .15s;
}
/* .cb-hw-mobile-item-row a:hover { background: rgba(255,255,255,.06); } */
.cb-hw-mobile-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 14px 16px;
    transition: transform .2s;
    line-height: 1;
}
.cb-hw-mobile-toggle.cb-hw-toggled { transform: rotate(45deg); }

/* Mobile submenu */
.cb-hw-mobile-submenu { list-style: none; background: rgba(0,0,0,.15); }
.cb-hw-mobile-submenu li a {
    display: block;
    padding: 11px 28px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: .85rem;
    transition: background .15s;
}
/* .cb-hw-mobile-submenu li a:hover { background: rgba(255,255,255,.08); } */
.cb-hw-mobile-sub-sub a { padding-left: 40px !important; font-size: .8rem !important; }

/* ════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
════════════════════════════════════════ */

/* ≥ 768px: show desktop search, hide mobile toggles */
@media (min-width: 768px) {
    .cb-hw-hamburger { display: none; }
    .cb-hw-mobile-search-toggle { display: none; }
    .cb-hw-desktop-search { display: flex; }
    .cb-hw-account-label { display: inline-block; }
    .cb-hw-nav-bar { flex-wrap: nowrap; }
    .cb-hw-mobile-nav { display: none !important; }
    .cb-hw-mobile-overlay { display: none !important; }
    .cb-hw-mobile-search-bar { display: none !important; }
}

/* < 768px: hamburger mode */
@media (max-width: 767px) {
    .cb-hw-desktop-search { display: none !important; }
    .cb-hw-account-label { display: none; }
    .cb-hw-nav-bar { display: none; }
    .cb-hw-top-bar { padding: 8px 12px; gap: 8px; }
    .cb-hw-logo img { width: 100px; }
    .cb-hw-mobile-nav { display: flex; }
    .cb-hw-actions { gap: 4px; }
}

/* Scrollbar inside dropdown */
.cb-hw-dropdown-list::-webkit-scrollbar,
.cb-hw-mobile-nav::-webkit-scrollbar,
.cb-hw-search-results::-webkit-scrollbar { width: 4px; }
.cb-hw-dropdown-list::-webkit-scrollbar-track,
.cb-hw-mobile-nav::-webkit-scrollbar-track,
.cb-hw-search-results::-webkit-scrollbar-track { background: transparent; }
.cb-hw-dropdown-list::-webkit-scrollbar-thumb,
.cb-hw-mobile-nav::-webkit-scrollbar-thumb,
.cb-hw-search-results::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
