/* ==========================================================================
   HealthyZM — minimal single-row header
   Replaces the legacy .header-area / .mobile-header-active blocks.
   ========================================================================== */

:root {
    --hz-h: 66px;
    --hz-h-shrunk: 56px;
    --hz-border: #f0f0f0;
    --hz-text: #1f2937;
    --hz-muted: #64748b;
    --hz-primary: #10b981;
    --hz-primary-d: #059669;
    --hz-bg: #ffffff;
}

/* Reserve space so content doesn't jump under the fixed header */
body { padding-top: var(--hz-h); }
body.hz-shrunk { padding-top: var(--hz-h-shrunk); }

.hz-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--hz-h);
    background: var(--hz-bg);
    border-bottom: 1px solid var(--hz-border);
    z-index: 1040;
    transition: height .2s ease, box-shadow .2s ease;
    font-family: inherit;
}
.hz-header.is-scrolled {
    height: var(--hz-h-shrunk);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}

.hz-container {
    max-width: 1320px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 22px;
}

/* ---------- Logo ---------- */
.hz-logo { flex-shrink: 0; display: flex; align-items: center; }
.hz-logo a { display: inline-flex; align-items: center; }
.hz-logo img { height: 36px; width: auto; display: block; transition: height .2s ease; }
.hz-header.is-scrolled .hz-logo img { height: 30px; }

/* ---------- Nav ---------- */
.hz-nav { display: flex; align-items: center; gap: 4px; }
.hz-nav a {
    position: relative;
    padding: 8px 14px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--hz-text);
    text-decoration: none;
    border-radius: 8px;
    transition: color .15s ease, background-color .15s ease;
    white-space: nowrap;
}
.hz-nav a:hover,
.hz-nav a.is-active { color: var(--hz-primary); background: #f0fdf4; }

/* ---------- Search ---------- */
.hz-search {
    flex: 1 1 320px;
    max-width: 480px;
    margin-left: auto;
}
.hz-search form {
    position: relative;
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, max-width .25s ease;
    height: 40px;
}
.hz-search form:focus-within {
    background: #fff;
    border-color: var(--hz-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
}
.hz-search .hz-search-icon {
    position: absolute;
    left: 12px;
    color: var(--hz-muted);
    font-size: 1.05rem;
    pointer-events: none;
}
.hz-search input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 0 14px 0 38px;
    font-size: 14px;
    color: var(--hz-text);
    outline: none;
    height: 100%;
    border-radius: 10px;
}
.hz-search input::placeholder { color: #94a3b8; }
.hz-search button {
    background: transparent;
    border: 0;
    padding: 0 12px;
    height: 100%;
    cursor: pointer;
    color: var(--hz-muted);
    border-radius: 0 10px 10px 0;
}
.hz-search button:hover { color: var(--hz-primary); }

/* ---------- Actions ---------- */
.hz-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hz-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--hz-primary);
    background: transparent;
    border: 1px solid var(--hz-primary);
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}
.hz-login:hover { background: var(--hz-primary); color: #fff; }

.hz-account {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.hz-account-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hz-text);
    background: transparent;
    border: 1px solid var(--hz-border);
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}
.hz-account-toggle:hover { border-color: var(--hz-primary); background: #f0fdf4; }
.hz-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--hz-primary);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hz-account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--hz-border);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .1);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
    z-index: 50;
}
.hz-account.is-open .hz-account-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.hz-account-menu a,
.hz-account-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: 0;
    text-align: left;
    font-size: 14px;
    color: var(--hz-text);
    text-decoration: none;
    border-radius: 7px;
    cursor: pointer;
}
.hz-account-menu a:hover,
.hz-account-menu button:hover { background: #f1f5f9; color: var(--hz-primary); }
.hz-account-menu i { color: var(--hz-muted); font-size: 1.05rem; }

/* Cart */
.hz-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--hz-text);
    background: #f1f5f9;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.hz-cart:hover { background: #e2e8f0; color: var(--hz-primary); }
.hz-cart i { font-size: 1.25rem; }
.hz-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--hz-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
.hz-cart-count[data-count="0"] { display: none; }

/* Hamburger + mobile-only icon search button */
.hz-hamburger,
.hz-search-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: transparent;
    border: 0;
    align-items: center;
    justify-content: center;
    color: var(--hz-text);
    cursor: pointer;
    font-size: 1.4rem;
}
.hz-hamburger:hover,
.hz-search-toggle:hover { background: #f1f5f9; color: var(--hz-primary); }

/* ---------- Mobile drawer ---------- */
.hz-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    z-index: 1050;
}
.hz-drawer-backdrop.is-open { opacity: 1; visibility: visible; }

.hz-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 84%;
    max-width: 340px;
    background: #fff;
    z-index: 1051;
    transform: translateX(-100%);
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 30px rgba(0, 0, 0, .1);
}
.hz-drawer.is-open { transform: translateX(0); }
.hz-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hz-border);
}
.hz-drawer-head img { height: 32px; }
.hz-drawer-close {
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    color: var(--hz-muted);
    cursor: pointer;
    padding: 4px 8px;
}
.hz-drawer-body { flex: 1; overflow-y: auto; padding: 12px 12px 24px; }
.hz-drawer-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.hz-drawer-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--hz-text);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}
.hz-drawer-nav a:hover,
.hz-drawer-nav a.is-active { background: #f0fdf4; color: var(--hz-primary); }
.hz-drawer-nav a i { font-size: 1.15rem; color: var(--hz-muted); }
.hz-drawer-nav a:hover i,
.hz-drawer-nav a.is-active i { color: var(--hz-primary); }
.hz-drawer-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--hz-border);
}
.hz-drawer-section h6 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--hz-muted);
    margin: 0 0 6px 14px;
    font-weight: 600;
}

/* Mobile expanded search overlay */
.hz-mobile-search {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 16px;
    border-bottom: 1px solid var(--hz-border);
    z-index: 1045;
    display: none;
    align-items: center;
    gap: 8px;
    height: var(--hz-h);
}
.hz-mobile-search.is-open { display: flex; }
.hz-mobile-search form {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 10px;
    height: 40px;
    position: relative;
}
.hz-mobile-search .hz-search-icon {
    position: absolute;
    left: 12px;
    color: var(--hz-muted);
}
.hz-mobile-search input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 0 14px 0 38px;
    height: 100%;
    font-size: 14px;
    outline: none;
    border-radius: 10px;
}
.hz-mobile-search-close {
    background: transparent;
    border: 0;
    color: var(--hz-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px 10px;
}

body.hz-no-scroll { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hz-container { gap: 14px; padding: 0 18px; }
    .hz-nav a { padding: 8px 10px; font-size: 14px; }
    .hz-search { flex-basis: 240px; }
}

@media (max-width: 900px) {
    .hz-nav { display: none; }
    .hz-search { display: none; }
    .hz-login span.hz-login-text { display: none; }
    .hz-search-toggle { display: inline-flex; }
    .hz-hamburger { display: inline-flex; }
    .hz-container { gap: 8px; padding: 0 14px; }
    .hz-logo { margin-right: auto; }
    .hz-logo img { height: 30px; }
    .hz-account-toggle .hz-account-text { display: none; }
    .hz-login { padding: 7px 12px; }
    :root { --hz-h: 56px; }
}

/* Visually hidden helper */
.hz-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Disable / hide legacy theme header pieces if they bleed through ---------- */
.header-area.header-style-1,
.mobile-header-active { display: none !important; }
