/* ═══════════════════════════════════════════════════
   HONARA — نوبارِ هدرِ سایت (فقط استایل؛ عملکرد حفظ شده)
   شفاف/شیشه‌ای روی main و product (روی هیرو می‌نشیند)،
   و سفید در بقیه‌ی صفحات (کلاس hnr-header--solid).
   با responsive-nav-content (نوبار موبایل) کاری ندارد.
   ═══════════════════════════════════════════════════ */

.hnr-header {

    --hnr-cream: #F9F6EF;
    --hnr-sage: #8C9D79;
    --hnr-sage-d: #5C6247;
    --hnr-ink: #3E3B35;
        background: #EAE3D0;
    height: 89px;
    position: sticky;
    top: 0;
    z-index: 60;

    border-bottom: 1px solid rgba(92, 98, 71, 0);
    box-shadow: 0 6px 20px rgba(62, 59, 53, .08);
    transition: background .4s ease, border-color .4s ease, backdrop-filter .4s ease, box-shadow .4s ease;
}

/* صفحه‌ی اصلی (main): بدون سایه */
.hnr-header--main {
    box-shadow: none;
}

/* شیشه‌ای هنگام اسکرول (روی main/product) */
.hnr-header.is-scrolled {
    background: rgba(249, 246, 239, .85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: rgba(92, 98, 71, .15);
}

/* سفیدِ ثابت در بقیه‌ی صفحات (basket، product-detail، ...) */
.hnr-header--solid {
    background: #ffffff;
    border-bottom-color: rgba(92, 98, 71, .12);
}

.hnr-header__inner {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

/* ── لوگو ── */
.hnr-header__logo {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: none;
}

/* The circle is sized on the CONTAINER; the image always fills it 100%.
   (Previously the image had a hard 64px while main.css shrank the container to
   48px on small screens — with overflow:hidden that cropped/zoomed the logo.) */
.hnr-header__logo .logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex: none;
}

.hnr-header .hnr-logo {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    flex: none;
}

/* متنِ کنار لوگو (مطابق claude design) */
.hnr-header__logo p {
    margin: 0;
    font-family: inherit;
    font-size: 17px;
    color: var(--hnr-ink);
    white-space: nowrap;
    letter-spacing: .2px;
}

/* ── جعبه‌ی جستجو ── */
/* درست‌کردنِ چیدمان: جستجو کنارِ لوگو بچسبد (نه وسط)؛ اکشن‌ها ته صف بروند */
.hnr-header .search-box {
    flex: 0 1 520px;
    position: relative;
    max-width: 520px;
    display: flex;
    align-items: center;
    /* خنثی‌کردنِ استایل‌های قدیمیِ .navbar-search-input (خاکستریِ #F5F5F5) */
    background: transparent;
    height: auto;
    padding: 0;
    z-index: auto;
}

/* استایلِ فیلدِ جستجو مطابق claude design — با #nav-search اسپسیفیک‌تر تا رنگ/بوردرِ قدیمی را ببرد */
.hnr-header .search-box input#nav-search {
    font-family: inherit;
    width: 100%;
    height: auto;
    border: 1px solid rgb(230, 222, 208);
    background: rgb(246, 242, 234);
    border-radius: 14px;
    padding: 12px 46px 12px 16px;
    font-size: 13.5px;
    line-height: 20px;
    color: rgb(47, 42, 36);
    outline: none;
    box-shadow: none;
}

/* روی فوکوس/کلیک هیچ بوردری نیاید (نه مشکی نه کِرِم) */
.hnr-header .search-box input#nav-search:focus {
    border-color: transparent;
    outline: none;
    box-shadow: none;
}

.hnr-header .search-box input#nav-search::placeholder {
    color: #b0a794;
}

/* در صفحاتِ سفید (basket، product-detail، products) پس‌زمینه‌ی سرچ سفید باشد */
.hnr-header--solid .search-box input#nav-search,
.hnr-header--solid .search-box input#nav-search:focus {
    background: #ffffff;
}

/* آیکونِ جستجو (سمت راست) — همان img که searchbar.js به آن نیاز دارد */
.hnr-header .search-box .hnr-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
    color: #b0a794;
}

.hnr-header .search-box .hnr-search-icon img {
    width: 18px;
    height: 18px;
}

/* دراپ‌داونِ پیشنهادها زیر جعبه‌ی جستجو می‌ماند */
.hnr-header .search-box .last-search {
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 70;
    min-height: 0;
    padding: 14px 16px;
    border: 1px solid rgb(230, 222, 208);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(62, 59, 53, .14);
}

.hnr-header .search-box .last-search > p {
    color: var(--hnr-ink);
    font-weight: 600;
}

/* کمتر از ۵ مورد: به اندازه‌ی همان تعداد؛ بیشتر از ۵ مورد: اسکرول */
.hnr-header .search-box .last-search-results-items {
    padding: 12px 4px 0;
    max-height: 216px;
    overflow-y: auto;
}

/* ── اکشن‌ها (سبد + ورود/پروفایل) ── */
.hnr-header .hnr-actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    margin-inline-start: auto; /* اکشن‌ها به انتهای صف؛ جستجو کنارِ لوگو می‌ماند */
}

.hnr-header .hnr-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(92, 98, 71, .3);
    background: rgba(255, 255, 255, .6);
    cursor: pointer;
    transition: background .3s ease;
    padding: 0;
}

.hnr-header .hnr-icon-btn:hover {
    background: #fff;
}

.hnr-header .hnr-icon-btn img {
    width: 22px;
    height: 22px;
}

/* شمارنده‌ی سبد روی دکمه‌ی آیکونی */
.hnr-header #cart-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--hnr-sage);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hnr-header .hnr-login {
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--hnr-sage-d);
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(92, 98, 71, .3);
    border-radius: 999px;
    padding: 9px 18px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .3s ease;
    gap: 6px;
}

.hnr-header .hnr-login:hover {
    background: #fff;
}

.hnr-header .hnr-login img {
    width: 16px;
    height: 16px;
}

/* روی صفحاتِ سفید (basket، product-detail، products)، دکمه‌های نوبار سفید باشند */
.hnr-header--solid .hnr-icon-btn,
.hnr-header--solid .hnr-login {
    background: #ffffff;
}

/* ── موبایل: فقط لوگو + جستجو (سبد/ورود مثل قبل مخفی؛ نوبار موبایل جداست) ── */
@media (max-width: 991.98px) {
    .hnr-header__inner {
        gap: 12px;
        width: calc(100% - 24px);
    }

    .hnr-header .search-box {
        flex: 1 1 auto;
        max-width: none;
    }

    .hnr-header__logo .logo-container {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 575.98px) {
    .hnr-header__logo .logo-container {
        width: 44px;
        height: 44px;
    }
}
