/* ============================================================
   Accounti – Sitewide Header (ach- namespace)
   خودکفا: هیچ وابستگی‌ای به dashboard.css/frontend.css یا استایل قالب نداره،
   چون این استایل باید تو همه‌ی صفحات سایت (نه فقط صفحات اکانتی) کار کنه.
   ============================================================ */

@font-face {
    font-family: 'IRYekan';
    src: url('https://pmashop.ir/wp-content/themes/mweb-digiland-pro/assets/fonts/IRYekan-medium-fanum.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

#accounti-site-header {
    --ach-brand:      #ed6205;
    --ach-brand-600:  #d4560a;
    --ach-brand-050:  #fff2e8;
    --ach-ink:        #1c1c1e;
    --ach-ink-500:    #6b6b70;
    --ach-line:       #ececec;
    --ach-surface:    #ffffff;
    --ach-surface-2:  #f6f6f7;
    --ach-ok:         #16a34a;
    --ach-red:        #ef4444;
    --ach-radius:     12px;
    --ach-shadow:     0 4px 20px rgba(0,0,0,.06);
    --ach-topbar-h:   38px;
    --ach-main-h:     68px;
    --ach-admin-bar-offset: 0px;

    font-family: 'IRYekan', IRANSans, Tahoma, Arial, sans-serif;
    color: var(--ach-ink);
    direction: rtl;
    position: relative;
}

#accounti-site-header,
#accounti-site-header *,
#accounti-site-header *::before,
#accounti-site-header *::after {
    box-sizing: border-box;
}

#accounti-site-header a { text-decoration: none; color: inherit; }
#accounti-site-header button { font-family: inherit; cursor: pointer; border: none; background: none; }
#accounti-site-header ul { list-style: none; margin: 0; padding: 0; }
#accounti-site-header img { max-width: none; }

.ach-container { max-width: 1240px; margin-inline: auto; padding-inline: 20px; }

#accounti-site-header .screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* آفست ادمین‌بار وردپرس تا هدر زیرش گم نشه */
body.admin-bar #accounti-site-header { --ach-admin-bar-offset: 32px; }
@media (max-width: 782px) {
    body.admin-bar #accounti-site-header { --ach-admin-bar-offset: 46px; }
}

/* ── نوار بالایی ─────────────────────────────────────────── */
.ach-topbar {
    background: var(--ach-ink);
    color: #d7d7db;
    height: var(--ach-topbar-h);
    font-size: 12.5px;
}
.ach-topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.ach-trust { color: var(--ach-ok); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.ach-dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--ach-ok); box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
.ach-topbar__links { display: flex; align-items: center; gap: 18px; }
.ach-topbar__links a { display: flex; align-items: center; gap: 6px; transition: color .15s; }
.ach-topbar__links a:hover { color: #fff; }
@media (max-width: 860px) { .ach-topbar__links { display: none; } }

/* ── هدر اصلی ─────────────────────────────────────────────── */
.ach-header {
    background: var(--ach-surface);
    border-bottom: 1px solid var(--ach-line);
    box-shadow: var(--ach-shadow);
}
.ach-header--sticky {
    position: sticky;
    top: var(--ach-admin-bar-offset);
    z-index: 500;
}
.ach-header__inner { height: var(--ach-main-h); display: flex; align-items: center; gap: 20px; }

.ach-hamburger { display: none; width: 44px; height: 44px; border-radius: 10px; place-items: center; color: var(--ach-ink); font-size: 20px; flex-shrink: 0; }
.ach-hamburger:hover { background: var(--ach-surface-2); }

.ach-logo { display: flex; align-items: center; flex-shrink: 0; }
.ach-logo img { max-height: 40px; width: auto; display: block; }
.ach-logo__text { font-weight: 800; font-size: 20px; letter-spacing: -.3px; color: var(--ach-brand); }

/* ── جستجو ─────────────────────────────────────────────────── */
.ach-search {
    flex: 1; max-width: 560px;
    display: flex; align-items: center;
    background: var(--ach-surface-2); border: 1.5px solid transparent;
    border-radius: var(--ach-radius); height: 46px;
    transition: border-color .15s, background .15s;
}
.ach-search:focus-within { border-color: var(--ach-brand); background: #fff; }
.ach-search__cat { order: 2; border-inline-start: 1px solid var(--ach-line); height: 100%; }
.ach-search__cat select {
    height: 100%; border: none; background: none; outline: none;
    font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ach-ink-500);
    padding: 0 14px; max-width: 150px;
}
.ach-search input[type="text"] {
    order: 1; flex: 1; height: 100%; border: none; background: none; outline: none;
    font-family: inherit; font-size: 14px; padding-inline: 14px; color: var(--ach-ink);
}
.ach-search input::placeholder { color: #a0a0a5; }
.ach-search__btn { order: 0; width: 46px; height: 100%; color: var(--ach-ink-500); display: grid; place-items: center; font-size: 17px; }
.ach-search__btn:hover { color: var(--ach-brand); }

/* ── اکشن‌ها ───────────────────────────────────────────────── */
.ach-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; flex-shrink: 0; }

.ach-sell-btn {
    display: flex; align-items: center; gap: 7px;
    background: var(--ach-brand); color: #fff; font-weight: 700; font-size: 14px;
    padding: 0 18px; height: 44px; border-radius: var(--ach-radius);
    transition: background .15s, transform .05s; white-space: nowrap;
}
.ach-sell-btn:hover { background: var(--ach-brand-600); }
.ach-sell-btn:active { transform: translateY(1px); }

.ach-icon-btn {
    position: relative; width: 44px; height: 44px; border-radius: 10px;
    display: grid; place-items: center; color: var(--ach-ink-500); font-size: 19px;
    transition: background .15s, color .15s;
}
.ach-icon-btn:hover { background: var(--ach-surface-2); color: var(--ach-brand); }

.ach-badge {
    position: absolute; top: 4px; inset-inline-start: 4px;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: var(--ach-brand); color: #fff; font-size: 10.5px; font-weight: 700;
    display: grid; place-items: center; line-height: 1;
}
.ach-badge.is-empty { display: none; }

.ach-divider { width: 1px; height: 28px; background: var(--ach-line); margin-inline: 6px; flex-shrink: 0; }

.ach-wallet {
    display: flex; align-items: center; gap: 8px;
    background: var(--ach-brand-050); color: var(--ach-brand-600);
    padding: 0 14px; height: 44px; border-radius: var(--ach-radius); font-weight: 700; font-size: 13.5px;
    white-space: nowrap; min-width: 90px;
}
.ach-wallet small { color: var(--ach-ink-500); font-weight: 500; font-size: 11px; }

.ach-profile { display: flex; align-items: center; gap: 9px; padding: 0 6px 0 12px; height: 44px; border-radius: var(--ach-radius); transition: background .15s; }
.ach-profile:hover { background: var(--ach-surface-2); }
.ach-profile img { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.ach-profile__name { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.ach-verified { display: flex; align-items: center; gap: 3px; color: var(--ach-ok); font-weight: 500; font-size: 11px; }

.ach-auth-guest { display: flex; align-items: center; gap: 8px; }
.ach-btn-ghost {
    padding: 0 16px; height: 44px; border-radius: var(--ach-radius); border: 1.5px solid var(--ach-line);
    font-weight: 600; font-size: 14px; color: var(--ach-ink); display: flex; align-items: center; transition: border-color .15s;
}
.ach-btn-ghost:hover { border-color: var(--ach-brand); color: var(--ach-brand); }

/* ── دراپ‌داون اعلان‌ها ────────────────────────────────────── */
.ach-notif { position: relative; }
.ach-dropdown {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
    width: 320px; max-width: 90vw;
    background: var(--ach-surface); border: 1px solid var(--ach-line); border-radius: var(--ach-radius);
    box-shadow: var(--ach-shadow); overflow: hidden; z-index: 600;
}
.ach-dropdown__header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--ach-line); }
.ach-dropdown__header strong { font-size: 13.5px; }
.ach-dropdown__mark-all { font-size: 11.5px; color: var(--ach-brand); font-weight: 600; }
.ach-dropdown__mark-all:hover { text-decoration: underline; }
.ach-dropdown__body { max-height: 360px; overflow-y: auto; }
.ach-dropdown__empty { padding: 28px 16px; text-align: center; color: var(--ach-ink-500); font-size: 12.5px; }
.ach-notif-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--ach-line); transition: background .15s; }
.ach-notif-item:last-child { border-bottom: none; }
.ach-notif-item:hover { background: var(--ach-surface-2); }
.ach-notif-item.is-unread { background: var(--ach-brand-050); }
.ach-notif-item__title { font-size: 12.5px; font-weight: 700; margin: 0 0 3px; }
.ach-notif-item__msg { font-size: 11.5px; color: var(--ach-ink-500); margin: 0; line-height: 1.6; }
.ach-notif-item__time { font-size: 10px; color: #b5b5ba; margin-top: 4px; display: block; }

/* ── نوار دسته‌بندی ────────────────────────────────────────── */
.ach-catnav { background: var(--ach-surface); border-bottom: 1px solid var(--ach-line); }
.ach-catnav__inner { display: flex; align-items: center; gap: 6px; height: 52px; overflow-x: auto; scrollbar-width: none; }
.ach-catnav__inner::-webkit-scrollbar { display: none; }
.ach-all-games {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    background: var(--ach-ink); color: #fff; font-weight: 700; font-size: 13.5px;
    padding: 0 16px; height: 38px; border-radius: 10px;
}
.ach-cat-link {
    flex-shrink: 0; padding: 0 14px; height: 38px; display: flex; align-items: center; gap: 7px;
    font-size: 13.5px; color: var(--ach-ink); font-weight: 500; border-radius: 10px; transition: background .15s, color .15s;
}
.ach-cat-link:hover { background: var(--ach-brand-050); color: var(--ach-brand-600); }
.ach-cat-link__icon { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.ach-cat-link__icon-fallback { font-size: 16px; color: var(--ach-ink-500); }

/* ── پنل «همه بازی‌ها» ────────────────────────────────────── */
.ach-all-games-panel {
    position: absolute; inset-inline-start: 0; inset-inline-end: 0; top: 100%;
    background: var(--ach-surface); border-bottom: 1px solid var(--ach-line); box-shadow: var(--ach-shadow);
    z-index: 400;
}
.ach-all-games-panel[hidden] { display: none; }
.ach-all-games-panel__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; padding: 20px; }
.ach-all-games-panel__item {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--ach-radius);
    font-size: 13px; font-weight: 600; transition: background .15s;
}
.ach-all-games-panel__item:hover { background: var(--ach-surface-2); }
.ach-all-games-panel__item img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.ach-all-games-panel__item i { font-size: 20px; color: var(--ach-ink-500); }

/* ── دراور موبایل ─────────────────────────────────────────── */
.ach-mobile-drawer[hidden] { display: none; }
.ach-mobile-drawer__overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 700; }
.ach-mobile-drawer__panel {
    position: fixed; top: 0; inset-inline-start: 0; bottom: 0; width: 280px; max-width: 85vw;
    background: var(--ach-surface); z-index: 701; display: flex; flex-direction: column;
    box-shadow: 2px 0 20px rgba(0,0,0,.15);
}
.ach-mobile-drawer__header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--ach-line); }
.ach-mobile-drawer__close { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: 18px; }
.ach-mobile-drawer__close:hover { background: var(--ach-surface-2); }
.ach-mobile-drawer__body { flex: 1; overflow-y: auto; padding: 10px; }
.ach-mobile-drawer__link {
    display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-radius: var(--ach-radius);
    font-size: 13.5px; font-weight: 600; color: var(--ach-ink);
}
.ach-mobile-drawer__link:hover { background: var(--ach-surface-2); }
.ach-mobile-drawer__link img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; }
.ach-mobile-drawer__link i { font-size: 18px; color: var(--ach-ink-500); width: 22px; text-align: center; }
.ach-mobile-drawer__divider { height: 1px; background: var(--ach-line); margin: 8px 4px; }

/* ── ریسپانسیو ────────────────────────────────────────────── */
@media (max-width: 920px) {
    .ach-search { order: 5; max-width: none; flex-basis: 100%; }
    .ach-search__cat { display: none; }
    .ach-wallet small, .ach-profile__name { display: none; }
    .ach-sell-btn span { display: none; }
    .ach-sell-btn { padding: 0 14px; }
    .ach-all-games-panel__grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 720px) {
    .ach-header__inner { flex-wrap: wrap; height: auto; padding-block: 12px; gap: 12px; }
    .ach-search { order: 5; }
    .ach-catnav { display: none; }
    .ach-hamburger { display: grid; }
    .ach-actions .ach-divider, .ach-wallet { display: none; }
    .ach-all-games-panel__grid { grid-template-columns: repeat(2, 1fr); }
    .ach-dropdown { inset-inline-end: -60px; width: 300px; }
}

@media (max-width: 420px) {
    .ach-container { padding-inline: 12px; }
    .ach-logo img { max-height: 32px; }
    .ach-dropdown { width: calc(100vw - 24px); inset-inline-end: -50px; }
}

@media (prefers-reduced-motion: reduce) {
    #accounti-site-header * { transition: none !important; animation: none !important; }
}
