/* ================================================================
   DESKTOP HEADER — Novinex
   ================================================================ */

.nk-desktop-header {
    position: sticky;
    top: 0;
    z-index: 1200 !important;
    isolation: isolate;
    overflow: visible !important;

    background: rgba(250, 252, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(108, 43, 217, 0.10);
    box-shadow: 0 2px 14px rgba(76, 42, 165, 0.05);
}

/* صفحه اصلی: دقیقاً همان لایه‌های هیرو (alm-hero) تا هدر در سکشن اول
   «فرو برود» — همان مراکز، همان شدت‌ها، بدون مرز مشخص */
body.home .nk-desktop-header,
.nk-desktop-header.nk-header--front {
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(127, 181, 255, 0.35), transparent 60%),
        radial-gradient(700px 420px at 10% 0%, rgba(108, 43, 217, 0.18), transparent 55%),
        var(--alm-bg, #eef4ff);
    border-bottom: 1px solid rgba(108, 43, 217, 0.14);
    box-shadow: none;
}

body.home .nk-desktop-header .nk-desktop-header__account,
.nk-desktop-header.nk-header--front .nk-desktop-header__account {
    background: rgba(255, 255, 255, 0.66);
}

body.home .nk-store-category-dropdown__toggle,
.nk-desktop-header.nk-header--front .nk-store-category-dropdown__toggle {
    background: rgba(255, 255, 255, 0.66);
}

/* حالت hover/باز روی صفحه اصلی هم باید بنفشِ کامل شود
   (Specificity باید از قانون شیشه‌ایِ بالا بالاتر باشد وگرنه متن سفید روی سفید می‌شود) */
body.home .nk-store-category-dropdown__toggle:hover,
body.home .nk-store-category-dropdown__toggle[aria-expanded="true"],
.nk-desktop-header.nk-header--front .nk-store-category-dropdown__toggle:hover,
.nk-desktop-header.nk-header--front .nk-store-category-dropdown__toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(108, 43, 217, 0.45);
    color: var(--alm-primary, #2B5CE6);
}

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

@media screen and (max-width: 782px) {
    body.admin-bar .nk-desktop-header {
        top: 46px;
    }
}

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

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

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

.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: 800;
    color: var(--alm-ink, #14101f);
    background: var(--alm-gradient, linear-gradient(135deg, #2B5CE6 0%, #7fb5ff 100%));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

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

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

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

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

    color: var(--alm-ink-soft, #3a3350);
    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: var(--alm-primary-soft, #F3F6FD);
    color: var(--alm-primary-strong, #1E46B8);
}

/* --- ابزارها --- */

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

/* جست‌وجوی فروشگاه (ماژول افزونه داخل این ظرف رندر می‌شود) */
.nk-desktop-header__search,
.nk-storefront-header__search {
    position: relative;
    min-width: 0;
}

/* --- حساب کاربری --- */

.nk-desktop-header__account {
    display: inline-flex;
    flex-direction: row;
    direction: rtl; /* آیکون همیشه سمت راست، متن سمت چپ */
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 14px; /* آیکون چسبیده به لبه راست، متن با فاصله در چپ */
    border-radius: 999px;
    border: 1.5px solid rgba(108, 43, 217, 0.32);
    background: rgba(255, 255, 255, 0.66);
    text-decoration: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.nk-desktop-header__account:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(108, 43, 217, 0.45);
}

.nk-desktop-header__account:hover .nk-desktop-header__account-label {
    color: var(--alm-primary, #2B5CE6);
}

.nk-desktop-header__account:hover .nk-desktop-header__account-copy small {
    color: var(--alm-muted, #6f6893);
}

.nk-desktop-header__account-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--alm-gradient, linear-gradient(135deg, #2B5CE6 0%, #7fb5ff 100%));
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

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

.nk-desktop-header__account-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.nk-desktop-header__account-copy small {
    font-size: 11px;
    color: var(--alm-muted, #6f6893);
}

.nk-desktop-header__account-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--alm-ink, #14101f);
    white-space: nowrap;
}

/* --- دکمه ذره‌بین جست‌وجو (فقط آیکون، بدون باکس) --- */

.nk-desktop-header__search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--alm-ink-soft, #3a3350);
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease;
}

.nk-desktop-header__search-toggle:hover {
    background: var(--alm-primary-soft, #F3F6FD);
    color: var(--alm-primary-strong, #1E46B8);
}

/* --- سبد خرید مینیمال (فقط آیکون + عدد؛ بدون باکس و قیمت) --- */

.nk-desktop-header .spx-header-basket-wrap--desktop .spx-header-basket {
    min-width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
}

.nk-desktop-header .spx-header-basket-wrap--desktop .spx-header-basket:hover,
.nk-desktop-header .spx-header-basket-wrap--desktop .spx-header-basket[aria-expanded="true"] {
    background: var(--alm-primary-soft, #F3F6FD);
    box-shadow: none;
    transform: none;
    border-color: transparent;
}

.nk-desktop-header .spx-header-basket-wrap--desktop .spx-header-basket__icon {
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    border-radius: 0;
    background: transparent;
    color: var(--alm-ink-soft, #3a3350);
}

.nk-desktop-header .spx-header-basket-wrap--desktop .spx-header-basket:hover .spx-header-basket__icon {
    color: var(--alm-primary-strong, #1E46B8);
}

/* خود SVG سبد هم‌اندازه ذره‌بین (۲۰px) شود */
.nk-desktop-header .spx-header-basket-wrap--desktop .spx-header-basket__icon svg {
    width: 20px;
    height: 20px;
}

/* قیمت و برچسب سبد در هدر دسکتاپ نمایش داده نمی‌شود */
.nk-desktop-header .spx-header-basket-wrap--desktop .spx-header-basket__body {
    display: none;
}

/* نشان عدد: گوشه بالا-راست دکمه، بیرون از آیکون */
.nk-desktop-header .spx-header-basket-wrap--desktop .spx-header-basket-count {
    top: -4px;
    right: -4px;
    min-width: 19px;
    height: 19px;
    border-color: #fff;
    background: var(--alm-primary, #2B5CE6);
}

/* ================================================================
   مودال جست‌وجو (دسکتاپ + موبایل)
   — بدون قفل اسکرول (بدون پرش هدر) و پنل زیر هدر می‌نشیند
   ================================================================ */

.nk-search-modal {
    position: fixed;
    z-index: 999997;
    top: var(--nk-search-top, 0px);
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 14px 20px 20px;
    box-sizing: border-box;
}

/* مهم: قانون hidden باید display:flex را شکست بدهد وگرنه مودال همیشه باز می‌ماند */
.nk-search-modal[hidden] {
    display: none !important;
}

.nk-search-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 31, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.nk-search-modal__panel {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    background:
        linear-gradient(180deg, rgba(239, 231, 253, 0.5), rgba(255, 255, 255, 0) 90px),
        #fff;
    border: 1px solid var(--alm-border, #e3ddf5);
    border-radius: 24px;
    box-shadow:
        0 34px 90px rgba(20, 16, 31, 0.32),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    overflow: hidden;
    animation: nk-search-modal-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* نوار گرادیانی بالای پنل */
.nk-search-modal__accent {
    display: block;
    height: 4px;
    background: var(--alm-gradient, linear-gradient(135deg, #2B5CE6 0%, #7fb5ff 100%));
}

@keyframes nk-search-modal-in {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.nk-search-modal__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 10px;
}

.nk-search-modal__heading {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
}

.nk-search-modal__heading svg {
    width: 18px;
    height: 18px;
    color: var(--alm-primary, #2B5CE6);
    overflow: visible;
}

.nk-search-modal__title {
    font-size: 15px;
    font-weight: 800;
    color: var(--alm-ink, #14101f);
}

.nk-search-modal__hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--alm-faint, #93A1B8);
    font-size: 11.5px;
    white-space: nowrap;
}

.nk-search-modal__hint kbd {
    padding: 3px 8px;
    border: 1px solid var(--alm-border, #e3ddf5);
    border-bottom-width: 2px;
    border-radius: 7px;
    background: var(--alm-bg-soft, #f7f3fe);
    color: var(--alm-muted, #6f6893);
    font-family: inherit;
    font-size: 10.5px;
    line-height: 1.4;
}

.nk-search-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--alm-border, #e3ddf5);
    border-radius: 50%;
    background: var(--alm-bg-soft, #f7f3fe);
    color: var(--alm-primary-strong, #1E46B8);
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}
.nk-search-modal__close svg { display: block; }

.nk-search-modal__close:hover {
    background: var(--alm-primary-soft, #F3F6FD);
    transform: rotate(90deg);
}

.nk-search-modal__body {
    padding: 0 20px 18px;
}

/* فرم جست‌وجوی افزونه داخل مودال: خودِ باکس تمام‌عرض پنل */
.nk-search-modal .spx-header-search {
    display: block;
    width: 100%;
}

.nk-search-modal .spx-header-search__field {
    width: 100%;
    box-sizing: border-box;
    height: 58px;
    border-radius: 16px;
    padding: 0 16px 0 12px;
    gap: 10px;
    background: var(--alm-bg-soft, #f7f3fe);
    border-color: var(--alm-border-strong, #cfc7ec);
}

/* دکمه جست‌وجو همیشه با متن «جست‌وجو» — نه فلش تنها */
.nk-search-modal .spx-header-search button span {
    display: inline !important;
}

.nk-search-modal .spx-header-search button {
    min-width: 96px;
    width: auto;
    padding: 0 16px;
    border-radius: 12px;
    gap: 6px;
}

.nk-search-modal .spx-header-search button svg {
    position: static;
    width: 15px;
    height: 15px;
    transform: none;
}

.nk-search-modal .spx-header-search__field:focus-within {
    background: #fff;
    box-shadow: 0 0 0 4px rgba(108, 43, 217, 0.12);
}

.nk-search-modal .spx-header-search__icon svg {
    width: 20px;
    height: 20px;
}

.nk-search-modal .spx-header-search input {
    font-size: 16px;
    height: 100%;
}

.nk-search-modal .spx-header-search button {
    min-width: 118px;
    height: 42px;
    font-size: 13px;
}

/* نتایج زنده داخل مودال: تمام‌عرض پنل، کارت‌های بزرگ‌تر */
.nk-search-modal .spx-header-search__results {
    position: static;
    margin-top: 10px;
    max-height: 48vh;
    border: 1px solid var(--alm-border-soft, #efeafd);
    border-radius: 16px;
    box-shadow: none;
}

.nk-search-modal .spx-header-search__result-grid {
    gap: 6px;
}

.nk-search-modal .spx-header-search__result {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 10px;
    border-radius: 12px;
}

.nk-search-modal .spx-header-search__result img,
.nk-search-modal .spx-header-search__result-image {
    width: 56px;
    height: 56px;
}

.nk-search-modal .spx-header-search__result strong {
    font-size: 13.5px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.nk-search-modal .spx-header-search__result small {
    font-size: 11.5px;
}

/* جست‌وجوهای پرطرفدار: یک ردیف فشرده (بدون شکستن خط) */
.nk-search-modal__quick {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.nk-search-modal__quick::-webkit-scrollbar {
    display: none;
}

.nk-search-modal__quick-label {
    flex-shrink: 0;
    color: var(--alm-faint, #93A1B8);
    font-size: 11.5px;
}

.nk-search-modal__quick a {
    flex-shrink: 0;
    padding: 5px 11px;
    border: 1px solid var(--alm-border, #e3ddf5);
    border-radius: 999px;
    background: #fff;
    color: var(--alm-ink-soft, #3a3350);
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nk-search-modal__quick a:hover {
    background: var(--alm-primary-soft, #F3F6FD);
    border-color: var(--alm-primary, #2B5CE6);
    color: var(--alm-primary-strong, #1E46B8);
}

/* عبارت‌های واقعاً پرجست‌وجو — با پس‌زمینه بنفش ملایم متمایز از میان‌برهای ثابت */
.nk-search-modal__quick a.nk-search-modal__quick-hit {
    background: var(--alm-primary-soft, #F3F6FD);
    border-color: #d9c8f7;
    color: var(--alm-primary-strong, #1E46B8);
}

/* در صفحات کوچک عمودی، نتایج کوتاه‌تر */
@media (max-height: 700px) {
    .nk-search-modal .spx-header-search__results {
        max-height: 34vh;
    }
}


/* ================================================================
   دراپ‌داون سبک‌های رقص (دسته‌بندی‌های فروشگاه)
   ================================================================ */

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

/* دکمه شیشه‌ای هم‌خانواده‌ی هدر */
.nk-store-category-dropdown__toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px 9px 14px;
    border-radius: 999px;
    border: 1.5px solid rgba(108, 43, 217, 0.32);
    background: rgba(255, 255, 255, 0.66);
    color: var(--alm-ink, #14101f);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.nk-store-category-dropdown__toggle:hover,
.nk-store-category-dropdown__toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(108, 43, 217, 0.45);
    color: var(--alm-primary, #2B5CE6);
}

/* کاشی آیکون: مربع گرد سفید با گرادیان بنفش */
.nk-store-category-dropdown__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--alm-gradient, linear-gradient(135deg, #2B5CE6 0%, #7fb5ff 100%));
    color: #fff;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 3px 8px rgba(108, 43, 217, 0.25);
    transition: transform 200ms ease;
}

.nk-store-category-dropdown__toggle:hover .nk-store-category-dropdown__icon,
.nk-store-category-dropdown__toggle[aria-expanded="true"] .nk-store-category-dropdown__icon {
    background: rgba(108, 43, 217, 0.12);
    color: var(--alm-primary, #2B5CE6);
    box-shadow: none;
    transform: rotate(90deg);
}

.nk-store-category-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1300;
    width: 348px;
    max-height: 72vh;
    overflow-y: auto;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(108, 43, 217, 0.14);
    background: #fff;
    box-shadow: 0 24px 60px rgba(60, 30, 130, 0.16);
    direction: rtl;
}

.nk-store-category-menu__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 8px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--alm-border-soft, #efeafd);
}

.nk-store-category-menu__heading strong {
    font-size: 14px;
    font-weight: 800;
    color: var(--alm-ink, #14101f);
}

.nk-store-category-menu__heading a {
    font-size: 12px;
    font-weight: 700;
    color: var(--alm-primary, #2B5CE6);
    text-decoration: none;
}

.nk-store-category-menu__heading a:hover {
    text-decoration: underline;
}

.nk-store-category-menu__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

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

.nk-store-category-menu__item > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 11px;
    border-radius: 12px;
    color: var(--alm-ink-soft, #3a3350);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease;
}

.nk-store-category-menu__item > a:hover {
    background: var(--alm-primary-faint, #f7f3fe);
    color: var(--alm-primary-strong, #1E46B8);
}

/* نام دسته + شمار دوره‌ها + توضیح کوتاه */
.nk-store-category-menu__name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}

.nk-store-category-menu__title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
}

.nk-store-category-menu__name em {
    flex-shrink: 0;
    font-style: normal;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--alm-secondary-soft, #eaf3ff);
    color: #4a7fd4;
}

.nk-store-category-menu__desc {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--alm-muted, #6f6893);
    line-height: 1.8;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.nk-store-category-menu__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--alm-secondary-soft, #eaf3ff);
    color: #4a7fd4;
    font-size: 0;
    line-height: 1;
    transition: transform 200ms ease, background-color 200ms ease, color 200ms ease;
}

.nk-store-category-menu__arrow svg {
    display: block;
    margin: 0;
}

.nk-store-category-menu__item.is-open > a {
    background: var(--alm-primary-soft, #F3F6FD);
    color: var(--alm-primary-strong, #1E46B8);
}

.nk-store-category-menu__item.is-open .nk-store-category-menu__arrow {
    background: var(--alm-primary, #2B5CE6);
    color: #fff;
    transform: rotate(-90deg);
}

/* زیرمنو */
.nk-store-category-menu__item > ul {
    display: none;
    margin: 2px 0 6px;
    padding: 0 14px 0 0;
    list-style: none;
    border-right: 2px solid var(--alm-border-soft, #efeafd);
}

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

.nk-store-category-menu__item > ul a {
    display: block;
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--alm-muted, #6f6893);
    font-size: 13px;
    text-decoration: none;
}

.nk-store-category-menu__item > ul a:hover {
    background: var(--alm-primary-faint, #f7f3fe);
    color: var(--alm-primary-strong, #1E46B8);
}

/* ================================================================
   واکنش‌گرایی (سوییچ به هدر موبایل با .nk-global-header-mobile
   انجام می‌شود؛ اینجا فقط شکستن چیدمان دسکتاپ را مدیریت می‌کنیم)
   ================================================================ */

@media (max-width: 1100px) {
    .nk-desktop-header__inner {
        gap: 16px;
    }

    .nk-desktop-header__account-copy {
        display: none;
    }

    .nk-desktop-header__account {
        padding: 5px;
        border-radius: 50%;
    }

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