/* هدر سایت: لوگو، منوی اصلی با زیرمنوهای بازشونده، جستجو و حساب کاربری. پیشوند pm-hdr / pm-dd / pm-mega */
.pm-hdr {
    --hd-ink: #0f172b;
    --hd-ink-2: #1b2640;
    --hd-muted: #5a6880;
    --hd-line: #e2e7f0;
    --hd-paper: #f5f7fb;
    --hd-teal: #00ac94;
    --hd-teal-ink: #00806e;
    --hd-teal-soft: #e2f5f1;
    position: relative;
    z-index: 60;
    background: #fff;
    border-bottom: 1px solid var(--hd-line);
    font-family: IRANSans, Tahoma, sans-serif;
    direction: rtl;
}

    .pm-hdr a {
        color: inherit;
        text-decoration: none;
    }

    .pm-hdr svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.pm-hdr-in {
    display: flex;
    align-items: center;
    gap: 22px;
    height: 72px;
}

.pm-hdr-brand {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    color: var(--hd-ink) !important;
    white-space: nowrap;
}

    .pm-hdr-brand img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }

/* ---------- منو ---------- */
.pm-hdr-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    /* منو هیچ‌وقت جمع نمی‌شود تا روی جستجو نیفتد؛ جای کم از جستجو کم می‌شود */
    flex: 0 0 auto;
}

.pm-hdr-link,
.pm-dd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--hd-ink-2) !important;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s;
}

    .pm-hdr-link:hover,
    .pm-dd-btn:hover,
    .pm-dd:hover > .pm-dd-btn,
    .pm-dd:has(:focus-visible) > .pm-dd-btn,
    .pm-dd.is-open > .pm-dd-btn {
        background: var(--hd-paper);
    }

/* آیتم بخشی که کاربر الان در آن است */
.pm-hdr-link.is-current,
.pm-dd.is-current > .pm-dd-btn {
    color: var(--hd-teal-ink) !important;
    font-weight: bold;
    box-shadow: inset 0 -2px 0 var(--hd-teal);
    border-radius: 10px 10px 0 0;
}

.pm-dd-chev {
    width: 14px;
    height: 14px;
    transition: transform .15s;
}

.pm-dd:hover .pm-dd-chev,
.pm-dd.is-open .pm-dd-chev {
    transform: rotate(180deg);
}

.pm-hdr-badge {
    padding: 0 7px;
    border-radius: 99px;
    background: #f6eedb;
    color: #8a6a1f;
    font-size: 10.5px;
    font-weight: bold;
    line-height: 1.9;
}

.pm-dd {
    position: relative;
}

.pm-mega {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: none;
    gap: 26px;
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--hd-line);
    box-shadow: 0 24px 50px -20px rgba(15, 23, 43, .3);
    z-index: 70;
}

    /* پل نامرئی بین دکمه و منو تا با حرکت موس بسته نشود */
    .pm-mega::before {
        content: "";
        position: absolute;
        inset: -12px 0 auto 0;
        height: 12px;
    }

.pm-mega--end {
    right: auto;
    left: 0;
}

.pm-dd:hover > .pm-mega,
.pm-dd:has(:focus-visible) > .pm-mega,
.pm-dd.is-open > .pm-mega {
    display: flex;
}

.pm-mega-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
}

    .pm-mega-col a,
    .pm-mega-col button {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border: 0;
        border-radius: 10px;
        background: none;
        color: var(--hd-ink-2);
        font-family: inherit;
        font-size: 14px;
        text-align: right;
        white-space: nowrap;
        cursor: pointer;
    }

        .pm-mega-col a:hover,
        .pm-mega-col button:hover {
            background: var(--hd-paper);
            color: var(--hd-teal-ink);
        }

.pm-mega-title {
    margin: 0 0 6px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: bold;
    color: var(--hd-muted);
}

.pm-mega-ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--hd-paper);
}

    .pm-mega-ico svg {
        width: 17px;
        height: 17px;
        color: var(--hd-teal-ink);
    }

    .pm-mega-ico img {
        width: 18px;
        height: 18px;
        object-fit: contain;
    }

.pm-mega-col .pm-mega-all {
    margin-top: 6px;
    color: var(--hd-teal-ink);
    font-weight: bold;
    font-size: 13px;
}

.pm-mega-col--topics {
    min-width: 0;
    padding-right: 22px;
    border-right: 1px solid var(--hd-line);
}

.pm-mega-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(190px, auto));
    gap: 2px 8px;
}

/* ---------- سمت چپ: جستجو و حساب ---------- */
.pm-hdr-end {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.pm-hdr-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 260px;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    background: var(--hd-paper);
    border: 1px solid var(--hd-line);
    transition: border-color .15s, box-shadow .15s;
}

    .pm-hdr-search:focus-within {
        background: #fff;
        border-color: var(--hd-teal);
        box-shadow: 0 0 0 4px rgba(0, 172, 148, .14);
    }

    .pm-hdr-search svg {
        flex: none;
        width: 18px;
        height: 18px;
        color: var(--hd-muted);
    }

    .pm-hdr-search input {
        flex: 1;
        min-width: 0;
        height: 100%;
        border: 0;
        outline: 0;
        background: transparent;
        font-family: inherit;
        font-size: 13.5px;
        color: var(--hd-ink);
    }

.pm-hdr-icon {
    display: none;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--hd-line);
    background: #fff;
    color: var(--hd-ink) !important;
    cursor: pointer;
}

    .pm-hdr-icon svg {
        width: 20px;
        height: 20px;
    }

.pm-hdr-coins,
.pm-hdr-account,
.pm-hdr-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: bold;
    white-space: nowrap;
    cursor: pointer;
}

.pm-hdr-coins {
    background: var(--hd-teal-soft);
    color: var(--hd-teal-ink) !important;
}

    .pm-hdr-coins img {
        width: 20px;
        height: 20px;
    }

    .pm-hdr-coins span {
        font-weight: 500;
    }

.pm-hdr-account {
    border: 1px solid var(--hd-line);
    color: var(--hd-ink) !important;
}

.pm-hdr-login {
    border: 0;
    background: var(--hd-ink);
    color: #fff;
}

    .pm-hdr-account svg,
    .pm-hdr-login svg {
        width: 18px;
        height: 18px;
    }

.pm-hdr-account:hover {
    border-color: var(--hd-ink);
}

.pm-hdr-login:hover {
    background: var(--hd-ink-2);
}

.pm-hdr a:focus-visible,
.pm-hdr button:focus-visible,
.pm-hdr input:focus-visible {
    outline: 3px solid rgba(0, 172, 148, .45);
    outline-offset: 2px;
}

/* ---------- عرض‌های کمتر ---------- */
@media (max-width: 1360px) {
    .pm-hdr-in {
        gap: 14px;
    }

    .pm-hdr-link,
    .pm-dd-btn {
        padding: 0 9px;
        font-size: 14px;
    }
}

/* جستجو تبدیل به آیکون می‌شود */
@media (max-width: 1280px) {
    .pm-hdr-search {
        display: none;
    }

    .pm-hdr-search-btn {
        display: grid;
    }
}

@media (max-width: 1180px) {
    .pm-hdr-account span,
    .pm-hdr-coins span {
        display: none;
    }

    .pm-hdr-account {
        width: 42px;
        padding: 0;
        justify-content: center;
    }

}

/* موبایل و تبلت: منوی کشویی */
@media (max-width: 992px) {
    .pm-hdr-in {
        height: 64px;
        gap: 10px;
    }

    .pm-hdr-nav {
        display: none;
    }

    .pm-hdr-burger {
        display: grid;
    }

    .pm-hdr-brand {
        margin-left: auto;
        font-size: 16px;
    }

        .pm-hdr-brand img {
            width: 36px;
            height: 36px;
        }

    .pm-hdr-account span,
    .pm-hdr-coins span {
        display: none;
    }

    .pm-hdr-account {
        width: 42px;
        padding: 0;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .pm-hdr-brand span {
        display: none;
    }

    .pm-hdr-login {
        padding: 0 12px;
        font-size: 13px;
    }

        .pm-hdr-login svg {
            display: none;
        }

    .pm-hdr-end.is-compact .pm-hdr-coins,
    .pm-hdr-end.is-compact .pm-hdr-account {
        display: none;
    }
}

/* ---------- دانلود اپلیکیشن (کنار جستجو) ---------- */
.pm-hdr-app-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 42px;
    min-width: 42px;
    padding: 0 13px;
    border-radius: 12px;
    background: #e8f6ee;
    color: #23804a !important;
    font-size: 13.5px;
    font-weight: bold;
    white-space: nowrap;
    transition: background .15s;
}

    .pm-hdr-app-btn:hover {
        background: #d6efe1;
    }

    .pm-hdr-app-btn svg {
        width: 19px;
        height: 19px;
    }

@media (max-width: 1280px) {
    .pm-hdr-app-btn {
        padding: 0;
    }

        .pm-hdr-app-btn span {
            display: none;
        }
}

/* منوی کشویی موبایل */
.pm-drawer-cta.pm-drawer-cta--app {
    margin-top: 10px;
    background: linear-gradient(135deg, #34b26a, #23804a);
    box-shadow: 0 10px 24px rgba(35, 128, 74, .28);
}
