/* NetParsi customer panel — mod_netparsiuser (light theme, follows the site's palette) */

/* ---------- trigger (the template's user icon, or the module's own button) ---------- */
.nup-trigger { cursor: pointer; }
.nup-trigger:focus-visible { outline: 1px solid #A88B63; outline-offset: 4px; border-radius: 2px; }
/* the template hides the user icon on phones (d-only); the panel works there too */
.nup-trigger.d-only { display: block !important; }

.nup-toggle { background: none; border: 0; padding: 0; margin: 0; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.nup-toggle svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.2; }

html.nup-lock { overflow: hidden; }

/* ---------- shell ---------- */
.nup {
    /* own palette: the template switches --ink etc. to light colours on its dark pages */
    --nup-ink: #5A4A38;
    --nup-soft: #86745F;
    --nup-mute: #A89886;
    --nup-gold: #C2AE92;
    --nup-accent: #A88B63;
    --nup-line: rgba(90, 74, 56, .12);
    --nup-line-2: rgba(90, 74, 56, .24);
    --nup-wash: rgba(168, 139, 99, .08);
    --nup-danger: #9B4A3C;
    --nup-ease: cubic-bezier(.2, .7, .2, 1);
    --nup-slide: cubic-bezier(.7, 0, .2, 1);
    --nup-latin: "Maven Pro", sans-serif;
    --nup-off: -100%;

    position: fixed;
    inset: 0;
    z-index: 1000;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear .6s;
    font-family: "Anjoman", "Vazirmatn", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: normal;
    word-spacing: normal;
    text-transform: none;
    color: var(--nup-ink);
    text-align: start;
}

/* the same look on light and dark pages: nothing inherited from the template */
.nup *,
.nup *::before,
.nup *::after { box-sizing: border-box; }
.nup a { text-decoration: none; border-bottom: 0; }
.nup ul,
.nup li { margin: 0; padding: 0; list-style: none; }
.nup.is-open { visibility: visible; pointer-events: auto; transition: visibility 0s; }

/* which edge it slides from: "start" = the right edge on RTL pages, the left edge on LTR pages */
.nup[data-side=end] { --nup-off: 100%; }
[dir=rtl] .nup[data-side=start] { --nup-off: 100%; }
[dir=rtl] .nup[data-side=end] { --nup-off: -100%; }

.nup-scrim {
    position: absolute;
    inset: 0;
    background: rgba(45, 30, 20, .32);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .5s ease;
    cursor: pointer;
}
.nup.is-open .nup-scrim { opacity: 1; }

.nup-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(400px, 88vw);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(255, 253, 248, .95), transparent 70%),
        linear-gradient(180deg, #F3EBDF 0%, #F7F1E7 45%, #FAF6EF 100%);
    box-shadow: 0 0 60px -10px rgba(45, 30, 20, .35);
    transform: translateX(var(--nup-off));
    transition: transform .6s var(--nup-slide);
}
.nup[data-side=start] .nup-panel { inset-inline-start: 0; }
.nup[data-side=end] .nup-panel { inset-inline-end: 0; }
.nup.is-open .nup-panel { transform: none; }

/* thin gold edge on the inner side */
.nup-panel::before {
    content: "";
    position: absolute;
    top: 12%;
    bottom: 12%;
    inset-inline-end: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--nup-gold), transparent);
    opacity: .6;
}
.nup[data-side=end] .nup-panel::before { inset-inline-end: auto; inset-inline-start: 0; }

/* ---------- top bar ---------- */
.nup-top {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 1.6rem 0;
}

.nup-eyebrow {
    font-family: var(--nup-latin);
    font-size: .64rem;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--nup-mute);
    direction: ltr;
}

.nup-x {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: none;
    color: var(--nup-soft);
    cursor: pointer;
    transition: border-color .3s ease, color .3s ease, transform .5s var(--nup-ease);
}
.nup-x svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.3; }
.nup-x:hover { color: var(--nup-ink); border-color: var(--nup-line-2); transform: rotate(90deg); }
.nup-x:focus-visible { outline: 1px solid var(--nup-accent); outline-offset: 2px; }

.nup-scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.6rem 1.6rem 1.4rem;
    scrollbar-width: thin;
    scrollbar-color: var(--nup-line-2) transparent;
}

/* ---------- customer ---------- */
.nup-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: inherit;
    text-decoration: none;
    border: 0;
}

.nup-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }

/* hairline under the customer block */
.nup-profile { padding-bottom: 1.4rem; border-bottom: 1px solid var(--nup-line); }

.nup-name {
    display: block;
    margin: 0;
    font-size: 1.12rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--nup-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nup-mobile {
    align-self: flex-start;      /* sits under the name (right side on RTL pages) */
    font-family: var(--nup-latin);
    font-size: .8rem;
    letter-spacing: .08em;
    color: var(--nup-mute);
    text-align: start;
}

.nup-go { display: inline-flex; color: var(--nup-accent); opacity: .45; transition: opacity .3s ease, transform .5s var(--nup-ease); }
.nup-go svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.3; }
[dir=rtl] .nup-go svg { transform: scaleX(-1); }
.nup-profile:hover .nup-go { opacity: 1; transform: translateX(calc(-4px * var(--nup-x, 1))); }
[dir=ltr] .nup { --nup-x: -1; }

/* ---------- level + wallet ---------- */
.nup-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: .7rem;
    margin-top: 1.6rem;
}

.nup-stat {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-width: 0;
    padding: .95rem 1rem;
    border: 1px solid rgba(255, 255, 255, .75);
    background: linear-gradient(135deg, rgba(255, 255, 255, .7), rgba(234, 223, 206, .45));
    color: inherit;
    text-decoration: none;
    transition: border-color .3s ease, transform .5s var(--nup-ease);
}
a.nup-stat:hover { border-color: var(--nup-gold); transform: translateY(-2px); }

.nup-stat small { font-size: .68rem; letter-spacing: .08em; color: var(--nup-mute); }

.nup-stat b {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    min-width: 0;
    font-weight: 400;
    color: var(--nup-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nup-level b { align-items: center; font-size: .92rem; }
.nup-level svg { flex: 0 0 auto; width: 15px; height: 15px; stroke: var(--nup-accent); fill: rgba(168, 139, 99, .18); stroke-width: 1.2; }

.nup-amount { font-size: 1.35rem; font-weight: 300; line-height: 1.2; color: var(--nup-accent); }
.nup-wallet i { font-style: normal; font-size: .72rem; color: var(--nup-mute); }

/* ---------- menu (built-in) and modules in the panel position ---------- */
.nup-menu { margin-top: 1.8rem; }

.nup-list,
.nup-modules ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nup-link,
.nup-modules li > a,
.nup-modules li > span {
    position: relative;
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .7rem .7rem;
    margin: 0 -.7rem;
    color: var(--nup-soft);
    font-size: .92rem;
    text-decoration: none;
    border: 0;
    transition: color .3s ease, background-color .3s ease;
}

.nup-link::before,
.nup-modules li > a::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 22%;
    bottom: 22%;
    width: 1px;
    background: var(--nup-accent);
    transform: scaleY(0);
    transition: transform .4s var(--nup-ease);
}

a.nup-link:hover,
.nup-modules li > a:hover { color: var(--nup-ink); background: var(--nup-wash); }
a.nup-link:hover::before,
.nup-modules li > a:hover::before { transform: scaleY(1); }
a.nup-link:hover .nup-go { opacity: 1; transform: translateX(calc(-4px * var(--nup-x, 1))); }
.nup-link:focus-visible,
.nup-modules li > a:focus-visible { outline: 1px solid var(--nup-accent); outline-offset: -1px; }

.nup-item.current > .nup-link,
.nup-modules li.current > a,
.nup-modules li.active > a { color: var(--nup-ink); font-weight: 500; }
.nup-item.current > .nup-link::before,
.nup-modules li.current > a::before { transform: scaleY(1); }

.nup-ico {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .7);
    color: var(--nup-accent);
    transition: background-color .3s ease;
}
.nup-ico svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.3; }
.nup-ico img { width: 18px; height: 18px; object-fit: contain; }
a.nup-link:hover .nup-ico { background: #fff; }

.nup-label { flex: 1; min-width: 0; }
.nup-link .nup-go { opacity: 0; }
.nup-heading { cursor: default; font-size: .74rem; letter-spacing: .08em; color: var(--nup-mute); }

/* second level: indented under a hairline */
.nup-level-2 {
    margin: 0 0 .4rem;
    padding-inline-start: 1.6rem;
    border-inline-start: 1px solid var(--nup-line);
    margin-inline-start: .4rem;
}
.nup-level-2 .nup-link { padding: .5rem .7rem; font-size: .86rem; }
.nup-level-2 .nup-ico { width: 1.7rem; height: 1.7rem; background: none; }
.nup-level-2 .nup-ico svg { width: 14px; height: 14px; }

.nup-level-1 > .nup-item + .nup-item { border-top: 1px solid var(--nup-line); }

.nup-modules { margin-top: 1.4rem; }
.nup-modules li + li { border-top: 1px solid var(--nup-line); }
.nup-modules h3,
.nup-modules .module-title { margin: 0 0 .6rem; font-size: .74rem; font-weight: 400; letter-spacing: .08em; color: var(--nup-mute); }

/* ---------- footer ---------- */
.nup-foot {
    flex: 0 0 auto;
    padding: 1rem 1.6rem 1.4rem;
    border-top: 1px solid var(--nup-line);
}

.nup-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    height: 3rem;
    border: 1px solid var(--nup-line-2);
    color: var(--nup-soft);
    font-size: .86rem;
    text-decoration: none;
    transition: color .3s ease, border-color .3s ease;
}
.nup-logout svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.3; }
.nup-logout:hover { color: var(--nup-danger); border-color: rgba(155, 74, 60, .45); }

/* ---------- entrance: blocks and menu rows follow the panel in ---------- */
.nup-anim,
.nup-level-1 > .nup-item,
.nup-modules,
.nup-foot {
    opacity: 0;
    transform: translateY(14px);
}

.nup.is-open .nup-anim,
.nup.is-open .nup-level-1 > .nup-item,
.nup.is-open .nup-modules,
.nup.is-open .nup-foot {
    opacity: 1;
    transform: none;
    transition: opacity .7s ease, transform .9s var(--nup-ease);
}

.nup.is-open .nup-anim { transition-delay: .25s; }
.nup.is-open .nup-anim + .nup-anim { transition-delay: .32s; }
.nup.is-open .nup-level-1 > .nup-item { transition-delay: calc(.38s + var(--i, 0) * 50ms); }
.nup.is-open .nup-modules { transition-delay: .45s; }
.nup.is-open .nup-foot { transition-delay: .5s; }

/* closing is quick and plain */
.nup:not(.is-open) .nup-anim,
.nup:not(.is-open) .nup-level-1 > .nup-item,
.nup:not(.is-open) .nup-modules,
.nup:not(.is-open) .nup-foot { transition: opacity .2s ease, transform .2s ease; }

@media (max-width: 480px) {
    .nup-panel { width: 100vw; }
    .nup-top { padding: 1.1rem 1.2rem 0; }
    .nup-scroll { padding: 1.3rem 1.2rem 1.2rem; }
    .nup-foot { padding: .9rem 1.2rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .nup-panel,
    .nup-scrim,
    .nup-anim,
    .nup-level-1 > .nup-item,
    .nup-modules,
    .nup-foot { transition: none !important; }

    .nup-anim,
    .nup-level-1 > .nup-item,
    .nup-modules,
    .nup-foot { opacity: 1; transform: none; }
}
