.nk-mobile-header {
    width: 100%;
    background:
        radial-gradient(circle at 76% 12%, rgba(223, 243, 239, 0.72), transparent 26rem),
        var(--al-comment-bg);
    border-bottom: 1px solid #dfedef;
    direction: rtl;

    -webkit-tap-highlight-color: transparent; /* حذف باکس آبی در اندروید و iOS */
    outline: none; /* حذف خط دور (Focus Ring) در مرورگرهای خاص */
    user-select: none; /* جلوگیری از انتخاب شدن متن هنگام لمس سریع */
}

.nk-mobile-header__inner {
    max-width: 100%;
    min-height: 64px;
    padding: 0px 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box;
}

.nk-mobile-header__left,
.nk-mobile-header__center,
.nk-mobile-header__right {
    display: flex;
    align-items: center;
}

.nk-mobile-header__center {
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.nk-mobile-header__right {
    gap: 8px;
    flex-shrink: 0;
}

.nk-mobile-header__brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.nk-mobile-header__logo {
    display: block;
    max-height: 40px;
    width: auto;
}

.nk-mobile-header__site-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* دکمه منوی موبایل */
.nk-mobile-header__menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid #dce9e4;
    border-radius: 12px;
    background: #f1f8f5;
    color: #247b71;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    line-height: 1;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    box-shadow: none;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.nk-mobile-header__menu:hover {
    background: #e2f1eb;
    border-color: #b9dcd2;
    color: #247b71;
}

.nk-mobile-header__menu:active {
    transform: scale(0.97);
}

.nk-mobile-header__menu:focus,
.nk-mobile-header__menu:focus-visible {
    outline: none;
    box-shadow: none;
}

/* فقط اگر خواستی فوکوس صفحه‌کلید دیده شود، این را روشن نگه دار
   ولی اگر حتی این هم آبی/مزاحم است، همین را حذف کن */
.nk-mobile-header__menu:focus-visible {
    outline: 2px solid rgba(47, 155, 142, 0.18);
    outline-offset: 2px;
}

/* وقتی منو باز است، فقط یک حالت خیلی ملایم بده */
.nk-mobile-header__menu[aria-expanded="true"] {
    background: #e2f1eb;
    border-color: #b9dcd2;
    color: #247b71;
}

/* ظرف آیکون */
.nk-mobile-header__menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    color: currentColor;
}

.nk-mobile-header__menu-icon img {
    display: block;
    width: 24px;
    height: 24px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.nk-mobile-header__menu-icon svg {
    display: block;
    width: 20px;
    height: 20px;
    overflow: visible;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nk-mobile-header__menu-label {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.nk-mobile-header__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
	min-width: 50px;
    padding: 0 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
	font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.nk-mobile-header__action--phone {
    background: #f1f8f5;
    color: var(--nk-teal-dark, #247b71);
    border: 1px solid #dce9e4;
}

.nk-mobile-header__action--cta {
    background: #f1f8f5;
    color: var(--nk-teal-dark, #247b71);
    border: 1px solid #dce9e4;
}

.nk-mobile-header__action:hover {
    opacity: 0.92;
}

/* ========================================
   account icon
======================================== */

.nk-mobile-header__account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #dce9e4;
    background: #f1f8f5;
    color: var(--nk-teal-dark, #247b71);
    text-decoration: none;
    flex-shrink: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nk-mobile-header__account:hover {
    background: #e2f1eb;
    border-color: #b9dcd2;
}

.nk-mobile-header__account:active {
    transform: scale(0.97);
}

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

.nk-mobile-header__account-icon img,
.nk-mobile-header__account-icon svg {
    width: 24px;
    height: 24px;
    object-fit: contain;

	border-radius: 50%;
}

/* فاصله بین دکمه منو و آیکون حساب کاربری */
.nk-mobile-header__left {
    gap: 8px;
}

/* ========================================
   Drawer
======================================== */

:root {
    --nk-teal: #2f9b8e;
    --nk-teal-dark: #247b71;
    --nk-soft-teal: #f1f8f5;
    --nk-bg: #fdfdfb;
    --nk-text: #2b3632;
    --nk-muted: #667570;
    --nk-border: #e5eeea;
    --wp-admin-bar-safe-top: 0px;
}

/* مدیریت Admin Bar */
body.admin-bar {
    --wp-admin-bar-safe-top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar {
        --wp-admin-bar-safe-top: 46px;
    }
}

/* ظرف اصلی دراور (تمام صفحه) */
#nk-mobile-drawer {
    position: fixed;
    z-index: 999998;
    top: var(--wp-admin-bar-safe-top);
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: calc(100dvh - var(--wp-admin-bar-safe-top));
    display: block; /* تغییر از flex به block برای مدیریت مطلق overlay */
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition:
        opacity 0.35s ease,
        visibility 0.35s ease,
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    isolation: isolate; /* ایزوله کردن لایه‌های داخلی */

    -webkit-tap-highlight-color: transparent; /* حذف باکس آبی در اندروید و iOS */
    outline: none; /* حذف خط دور (Focus Ring) در مرورگرهای خاص */
    user-select: none; /* جلوگیری از انتخاب شدن متن هنگام لمس سریع */
}

/* حالت فعال دراور */
#nk-mobile-drawer:not([hidden]) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Backdrop (پس‌زمینه تیره) */
.nk-mobile-drawer__overlay {
    position: absolute; /* تغییر از fixed به absolute نسبت به ظرف اصلی */
    inset: 0;
    z-index: 0; /* فرستادن به پشت پنل */
    background: rgba(36, 65, 59, 0.24);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* نمایش پس‌زمینه هنگام باز بودن */
#nk-mobile-drawer:not([hidden]) .nk-mobile-drawer__overlay {
    opacity: 1;
    visibility: visible;
}

/* پنل اصلی محتوا (روی overlay قرار می‌گیرد) */
.nk-mobile-drawer__panel {
    position: relative;
    z-index: 1; /* بالاتر از overlay */
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: var(--nk-bg);
    box-sizing: border-box;
    pointer-events: auto; /* اطمینان از دریافت کلیک‌ها */
}

/* Header داخل drawer */
.nk-mobile-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    padding: 22px 24px 16px;
    border-bottom: 1px solid rgba(229, 238, 234, 0.8);
    background: var(--nk-bg);
    box-sizing: border-box;
}

.nk-mobile-drawer__title {
    color: var(--aram-teal-dark);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

/* دکمه بستن منو */
.nk-mobile-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--nk-soft-teal);
    color: var(--nk-teal-dark);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
}

.nk-mobile-drawer__close:hover,
.nk-mobile-drawer__close:focus-visible {
    background: #e2f1eb;
    transform: rotate(90deg);
}

/* بخش اسکرول‌شونده کارت‌ها */
.nk-mobile-drawer__nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 20px 28px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* دکمه‌های اکشن زیر منو */
.nk-mobile-drawer__actions {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 20px 20px;
    box-sizing: border-box;
}

.nk-mobile-drawer__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nk-mobile-drawer__button:hover,
.nk-mobile-drawer__button:focus-visible {
    transform: translateY(-2px);
}

.nk-mobile-drawer__button--primary {
    background: var(--nk-teal);
    color: #ffffff;
}

.nk-mobile-drawer__button--primary:hover,
.nk-mobile-drawer__button--primary:focus-visible {
    background: var(--nk-teal-dark);
}

.nk-mobile-drawer__button--secondary {
    background: var(--nk-soft-teal);
    color: var(--nk-teal-dark);
}

.nk-mobile-drawer__button--secondary:hover,
.nk-mobile-drawer__button--secondary:focus-visible {
    background: #e2f1eb;
}

/* ========================================
   Menu Cards
======================================== */

.nk-mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
}

.nk-mobile-menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 138px;
    padding: 16px 12px;
    border-radius: 20px;
    border: 1px solid #dfe5e7;
    background: #fff;
    color: #1a1a1a;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.nk-mobile-menu-card:hover,
.nk-mobile-menu-card:focus-visible {
    transform: translateY(-2px);
    background: #f4fbfb;
    border-color: #8fcfcb;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.nk-mobile-menu-card__image,
.nk-mobile-menu-card__placeholder {
    width: 55px;
    height: 55px;
    border-radius: 16px;
    display: block;
    /*border: 1px solid #dfe5e7;*/
    /*background: #eef7f7;*/
	background: transparent;
    object-fit: cover;
}

.nk-mobile-menu-card__placeholder {
    background: linear-gradient(135deg, #eef7f7, #ffffff);
}

.nk-mobile-menu-card__text {
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    color: var(--nk-text); /* #2b3632 */
}

/* ========================================
   Responsive
======================================== */

@media (max-width: 420px) {
    .nk-mobile-drawer__header {
        padding: 18px 16px 14px;
    }

    .nk-mobile-drawer__title {
        font-size: 16px;
    }

    .nk-mobile-drawer__nav {
        padding: 16px 16px 20px;
    }

    .nk-mobile-drawer__actions {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 16px 16px;
    }

    .nk-mobile-menu-grid {
        gap: 10px;
    }

    .nk-mobile-menu-card {
        min-height: 124px;
        padding: 14px 10px;
    }

    .nk-mobile-header__inner {
        padding: 8px 10px;
        gap: 8px;
    }

    .nk-mobile-header__menu {
        gap: 6px;
    }

    .nk-mobile-header__menu-label {
        display: inline-block;
        font-size: 13px;
    }

    .nk-mobile-header__action {
        padding: 0 10px;
    }

    .nk-mobile-header__site-title {
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .nk-mobile-header__menu-label {
        display: none;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    #nk-mobile-drawer,
    .nk-mobile-drawer__overlay,
    .nk-mobile-drawer__close,
    .nk-mobile-menu-card,
    .nk-mobile-drawer__button {
        transition: none;
    }
}



/* قفل اسکرول بدنه هنگام باز بودن drawer */
body.nk-drawer-open {
    overflow: hidden;
    /* iOS Safari نیاز به position: fixed دارد */
    position: fixed;
    width: 100%;
    /* جلوگیری از پرش صفحه به بالا در iOS */
    top: calc(-1 * var(--nk-scroll-y, 0px));
}
