/* ================================================================
   DESKTOP HEADER
   ================================================================ */

.nk-desktop-header {
    position: sticky;
    top: 0;
    z-index: 1200 !important;
    isolation: isolate;
    overflow: visible !important;
	
    /* بکگراند هدر در صفحه اصلی */
    background: #f5f7f3;
    border-bottom: 1px solid rgba(120, 150, 150, 0.12);
    box-shadow: 0 2px 10px rgba(80, 110, 110, 0.05);
}

/* وقتی نوار مدیریت وردپرس وجود دارد */
body.admin-bar .nk-desktop-header {
    top: 32px;
}

/* موبایل */
@media screen and (max-width: 782px) {

    body.admin-bar .nk-desktop-header {
        top: 46px;
    }

}

/* بکگراند هدر در صفحات غیر از صفحه اصلی */
body:not(.home) .nk-desktop-header {
    background: #f2f5f4;
    border-bottom-color: rgba(105, 130, 125, 0.12);
    box-shadow: 0 2px 10px rgba(70, 95, 90, 0.05);
}

.nk-desktop-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}


/* --- برند / لوگو --- */

.nk-desktop-header__brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nk-desktop-header__logo {
    display: block;
    height: 42px;
    width: auto;
}

.nk-desktop-header__site-title {
    font-size: 20px;
    font-weight: 700;
    color: #27312d;
}


/* --- منوی اصلی --- */

.nk-desktop-header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nk-desktop-menu {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nk-desktop-menu__item a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;

    color: #4f5d57;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;

    transition:
        background-color 180ms ease,
        color 180ms ease;
}

.nk-desktop-menu__item a:hover,
.nk-desktop-menu__item a:focus-visible {
    background: #eaf4f3;
    color: #1e6a61;
}

.nk-desktop-menu__icon {
    width: 25px;
    height: 25px;
    object-fit: contain;
    background: #eef5f4 !important;
    border-radius: 7px;
}

.nk-desktop-menu__icon:hover {
    background: #e4f1ef !important;
}


/* --- اکشن‌های سمت راست --- */

.nk-desktop-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nk-desktop-header__account {
    display: flex;
    align-items: center;
    gap: 8px;

    color: #4f5d57;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;

    padding: 8px 10px;
    border-radius: 10px;

    transition:
        background-color 180ms ease,
        color 180ms ease;
}

.nk-desktop-header__account:hover,
.nk-desktop-header__account:focus-visible {
    background: #eaf4f3;
    color: #1e6a61;
}

.nk-desktop-header__account-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nk-desktop-header__account-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}


/* --- دکمه‌های هدر --- */

.nk-desktop-header__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 18px;
    border-radius: 10px;

    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;

    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease,
        color 180ms ease;
}


/* تماس با ما */

.nk-desktop-header__action--phone {
    color: #2f6f68;
    background: #eaf4f3;
}

.nk-desktop-header__action--phone:hover,
.nk-desktop-header__action--phone:focus-visible {
    color: #1e6a61;
    background: #dff3ef;
}


/* CTA اصلی */

.nk-desktop-header__action--cta {
    color: #ffffff;
    background: #2f9b8e;
    box-shadow: 0 4px 12px rgba(47, 155, 142, 0.14);
}

.nk-desktop-header__action--cta:hover,
.nk-desktop-header__action--cta:focus-visible {
    color: #ffffff;
    background: #228277;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(47, 155, 142, 0.20);
}


/* --- ریسپانسیو --- */

@media (max-width: 1100px) {
    .nk-desktop-header__account-label {
        display: none;
    }

    .nk-desktop-menu {
        gap: 2px;
    }

    .nk-desktop-menu__item a {
        padding: 10px 10px;
        font-size: 14px;
    }
}

/* Simple Shop tools are kept inside the theme header while their behavior
 * remains owned by the plugin. */
.nk-store-tools--desktop {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nk-store-tools--desktop .sps-header-search {
    width: min(280px, 26vw);
    margin: 0;
}

.nk-store-tools--desktop .sps-header-search__field {
    min-height: 42px;
}

.nk-store-tools--desktop .sps-header-basket {
    min-height: 42px;
    border: 1px solid rgba(47, 111, 104, 0.16);
    border-radius: 12px;
    background: #f5fbfa;
}

@media (max-width: 1100px) {
    .nk-store-tools--desktop .sps-header-search {
        width: 220px;
    }
}

/* NovinCode marketing header overrides */
.nk-marketing-header {
    position: sticky;
    top: 0;
    z-index: 1200 !important;
    border-bottom: 1px solid rgba(198, 213, 235, .72);
    background: rgba(247, 249, 253, .9);
    box-shadow: 0 10px 28px rgba(12, 35, 75, .05);
    backdrop-filter: blur(16px);
}
.nk-marketing-header .nk-desktop-header__inner { width: min(1180px, calc(100% - 48px)); min-height: 80px; padding: 14px 0; gap: 35px; direction: rtl; }
.nk-marketing-header .nk-desktop-header__brand { flex: 0 0 auto; }
.nk-marketing-header .nk-desktop-header__brand a { color: #07152e; }
.nk-nc-brand-fallback { display: inline-flex; align-items: center; gap: 9px; color: #07152e; font: 800 20px/1 inherit; letter-spacing: -.04em; }
.nk-nc-brand-fallback i { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #1769ff, #35e5e9); font: 800 11px/1 Consolas, monospace; font-style: normal; letter-spacing: 0; }
.nk-marketing-header .nk-desktop-header__logo { max-width: 175px; height: auto; max-height: 48px; object-fit: contain; }
.nk-marketing-header .nk-desktop-header__nav { flex: 1; justify-content: center; }
.nk-marketing-header .nk-desktop-menu { gap: 4px; }
.nk-marketing-header .nk-desktop-menu__item a { padding: 8px 11px; border-radius: 9px; color: #5d6c85; font-size: 12px; font-weight: 700; }
.nk-marketing-header .nk-desktop-menu__item a:hover,.nk-marketing-header .nk-desktop-menu__item a:focus-visible { color: #1769ff; background: #edf4ff; }
.nk-marketing-header .nk-desktop-header__actions { gap: 11px; }
.nk-desktop-header__whatsapp { display: inline-flex; align-items: center; gap: 7px; padding: 9px 10px; color: #147c68 !important; font-size: 12px; font-weight: 800; text-decoration: none; }
.nk-desktop-header__whatsapp span { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #9de6cf; border-radius: 50%; }
.nk-marketing-header .nk-desktop-header__action--cta { min-height: 42px; padding: 9px 16px; border-radius: 10px; color: #fff !important; background: #1769ff; box-shadow: 0 9px 18px rgba(23,105,255,.16); }
.nk-marketing-header .nk-desktop-header__action--cta span { font-size: 17px; }

@media (max-width: 900px) {
    .nk-marketing-header .nk-desktop-header__inner { width: min(100% - 32px, 680px); gap: 16px; }
    .nk-marketing-header .nk-desktop-menu__item a { padding-inline: 7px; font-size: 11px; }
    .nk-marketing-header .nk-desktop-header__whatsapp { display: none; }
}

/* فروشگاه: لوگو، دسته‌بندی، جست‌وجو، حساب و سبد خرید */
.nk-storefront-header {
    background: rgba(255, 255, 255, .94);
    border-bottom-color: rgba(36, 123, 113, .14);
    box-shadow: 0 8px 26px rgba(31, 67, 61, .07);
    backdrop-filter: blur(14px);
}

.nk-storefront-header .nk-desktop-header__inner {
    max-width: 1440px;
    min-height: 78px;
    gap: 14px;
}

.nk-storefront-header .nk-desktop-header__inner {
    display: grid;
    grid-template-columns: minmax(290px, 1fr) minmax(420px, 1.5fr) minmax(290px, 1fr);
    align-items: center;
    direction: rtl;
}

.nk-storefront-header__identity {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    min-width: 0;
    grid-column: 1;
    direction: rtl;
}

.nk-storefront-header .nk-desktop-header__brand {
    flex: 0 0 auto;
}

.nk-storefront-header .nk-desktop-header__nav {
    display: none;
}

.nk-storefront-header .nk-desktop-header__inner {
    width: 100%;
    box-sizing: border-box;
}

.nk-storefront-header {
    z-index: 1200 !important;
    isolation: isolate;
    overflow: visible !important;
}

.nk-storefront-header .nk-store-category-dropdown {
    position: relative;
    z-index: 100000 !important;
    flex: 0 0 auto;
}

.nk-store-category-dropdown__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 15px;
    border: 1px solid #dfeae6;
    border-radius: 12px;
    background: #f7fbfa;
    color: #225f58;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
}

.nk-store-category-dropdown__toggle:hover,
.nk-store-category-dropdown__toggle[aria-expanded="true"] {
    background: #eaf6f3;
    border-color: #9ed2c8;
    box-shadow: 0 8px 18px rgba(47, 155, 142, .12);
    transform: translateY(-1px);
}

.nk-store-category-dropdown__icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: #2f9b8e;
    color: #fff;
    font-size: 16px;
    line-height: 1;
}

.nk-store-category-dropdown__chevron {
    color: #6c847d;
    font-size: 16px;
    line-height: 1;
}

.nk-store-category-menu {
    position: absolute;
    z-index: 100001 !important;
    top: calc(100% + 10px);
    right: 0;
    width: 300px;
    padding: 13px;
    background: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 18px;
    box-shadow: 0 20px 48px rgba(31, 67, 61, .18), inset 0 1px 0 rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background-blend-mode: normal !important;
    isolation: isolate;
    overflow: hidden;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
}

.nk-store-category-menu[hidden] {
    display: none;
}

.nk-store-category-menu__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 5px 12px;
    border-bottom: 1px solid #edf2f0;
}

.nk-store-category-menu__heading strong {
    color: #27312d;
    font-size: 13px;
}

.nk-store-category-menu__heading a {
    color: #2f9b8e;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.nk-store-category-menu__list,
.nk-store-category-menu__item ul {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 8px 0 0;
    list-style: none;
}

.nk-store-category-menu__list {
    gap: 2px;
    padding-top: 10px;
}

.nk-store-category-menu__item {
    position: relative;
}

.nk-store-category-menu__item + .nk-store-category-menu__item {
    margin-top: 4px;
    padding-top: 5px;
    border-top: 1px solid rgba(224, 236, 232, .9);
}

.nk-store-category-menu__item ul {
    display: none;
    position: relative;
    gap: 2px;
    margin: 2px 10px 5px 0;
    padding: 5px 14px 2px 0;
    border-right: 2px solid #d9eee8;
}

.nk-store-category-menu__item.is-open > ul {
    display: grid;
}

.nk-store-category-menu__item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 40px;
    padding: 6px 10px;
    border-radius: 9px;
    color: #4f5d57;
    font-size: 12px;
    text-decoration: none;
    transition: background .2s, color .2s;
}

.nk-store-category-menu__item ul a {
    min-height: 34px;
    padding: 5px 9px;
    color: #6b7d76;
    font-size: 11px;
}

.nk-store-category-menu__item a:hover {
    background: #eff8f5;
    color: #1e6a61;
}

.nk-store-category-menu__arrow {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 1px solid rgba(47, 155, 142, .18);
    border-radius: 50%;
    background: rgba(239, 248, 245, .9);
    color: #2f9b8e;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    transform: rotate(180deg);
    transition: background .2s, color .2s, transform .2s;
}

.nk-store-category-menu__item a:hover .nk-store-category-menu__arrow {
    background: #2f9b8e;
    color: #fff;
    transform: rotate(180deg) translateX(-2px);
}

.nk-store-category-menu__item.is-open > a .nk-store-category-menu__arrow {
    background: #2f9b8e;
    color: #fff;
    transform: rotate(90deg);
}

.nk-storefront-header .nk-desktop-header__actions {
    display: contents;
    align-items: center;
}

.nk-storefront-header .nk-store-tools--desktop {
    display: contents;
}

.nk-storefront-header__search {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    min-width: 0;
    width: 100%;
}

.nk-storefront-header__search .sps-header-search {
    width: 100%;
    max-width: none;
    direction: rtl;
}

.nk-storefront-header__search .sps-header-search__field {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

.nk-storefront-header__search .sps-header-search input {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nk-storefront-header__search .sps-header-search button {
    flex: 0 0 98px;
    width: 98px;
    box-sizing: border-box;
}

.nk-storefront-header__customer-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
    grid-column: 3;
    grid-row: 1;
    direction: rtl;
}

.nk-storefront-header__customer-tools .nk-desktop-header__account,
.nk-storefront-header__customer-tools .sps-header-basket-wrap {
    flex: 0 0 auto;
}

.nk-storefront-header__customer-tools .nk-desktop-header__account,
.nk-storefront-header__customer-tools .sps-header-basket {
    height: 46px;
    box-sizing: border-box;
}

.nk-storefront-header__customer-tools .sps-header-basket-wrap {
    flex: 0 0 auto;
}

.nk-storefront-header__search .sps-header-search__field {
    min-height: 46px;
    height: 46px;
    border-color: #dbe8e4;
    border-radius: 14px;
    background: #fbfefd;
    box-shadow: 0 7px 20px rgba(31, 67, 61, .06);
}

.nk-storefront-header .nk-desktop-header__account {
    min-height: 44px;
    padding: 7px 10px;
    border: 1px solid #e2ece9;
    border-radius: 13px;
    background: #fff;
    color: #27312d;
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.nk-storefront-header .nk-desktop-header__account:hover,
.nk-storefront-header .nk-desktop-header__account:focus-visible {
    border-color: #9ed2c8;
    box-shadow: 0 8px 20px rgba(47, 155, 142, .10);
    transform: translateY(-1px);
    outline: none;
}

.nk-storefront-header .nk-desktop-header__account-copy {
    display: grid;
    gap: 2px;
    line-height: 1.2;
}

.nk-storefront-header .nk-desktop-header__account-copy small {
    color: #80908a;
    font-size: 10px;
}

.nk-storefront-header .nk-desktop-header__account-copy strong {
    color: #27312d;
    font-size: 12px;
}

.nk-storefront-header .nk-store-tools--desktop .sps-header-basket-wrap {
    order: 2;
}

.nk-storefront-header__customer-tools .sps-header-basket {
    min-width: 112px;
    width: 112px;
    min-height: 46px;
    border-color: #dbe8e4;
    border-radius: 14px;
}

.nk-storefront-header .nk-desktop-header__action {
    display: none;
}

@media (max-width: 940px) {
    .nk-storefront-header .nk-desktop-header__account-copy,
    .nk-storefront-header .nk-store-category-dropdown__toggle > span:not(.nk-store-category-dropdown__icon):not(.nk-store-category-dropdown__chevron) {
        display: none;
    }

    .nk-storefront-header__search {
        width: min(300px, 30vw);
    }
}

@media (max-width: 1100px) {
    .nk-storefront-header .nk-desktop-header__inner {
        grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.3fr) minmax(220px, 1fr);
    }

    .nk-storefront-header__customer-tools {
        gap: 8px;
    }
}
