/* ==========================================================================
   Bottom Navigation Bar (موبایل) — نوار ناوبری پایین صفحه
   فقط زیر 768px نمایش داده می‌شود.
   ========================================================================== */

:root {
    --bnp-h: 64px;
    --bnp-safe: env(safe-area-inset-bottom, 0px);
    --bnp-total: calc(var(--bnp-h) + var(--bnp-safe) + 8px);
    --bnp-ink: #0b1a2f;
    --bnp-muted: #6b7a90;
    --bnp-glass: rgba(255, 255, 255, .82);
}

.bnp {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 9998;
    direction: rtl;
    text-align: right;
    font-family: inherit;
    display: none;
    pointer-events: none;
}

/* در دسکتاپ هیچ لایه‌ای از این نوار فعال نیست */
@media (min-width: 768px) {

    .bnp__tray,
    .bnp__scrim,
    .bnp__sheet {
        display: none !important;
    }
}

/* ---------- نوار اصلی ---------- */
.bnp__bar {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 2px;
    margin: 0 8px calc(8px + var(--bnp-safe));
    height: var(--bnp-h);
    padding: 0 6px;
    border-radius: 22px 22px 18px 18px;
    background: var(--bnp-glass);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    box-shadow: 0 -6px 30px rgba(9, 30, 55, .16), 0 10px 34px rgba(9, 30, 55, .13), inset 0 0 0 1px rgba(255, 255, 255, .65);
    pointer-events: auto;
}

.bnp__bar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 12%;
    left: 12%;
    height: 3px;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(90deg, #7c4dff, #00c3ff, #22e3c6, #ff8a3d, #ff4d8d);
    opacity: .95;
}

/* ---------- آیتم‌ها ---------- */
.bnp__item,
.bnp__trig,
.bnp__cta {
    -webkit-tap-highlight-color: transparent;
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    max-width: 88px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 2px 4px;
    border: 0;
    background: transparent;
    color: var(--bnp-muted);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    -webkit-user-select: none;
    user-select: none;
    border-radius: 16px;
    transition: color .28s ease, transform .28s cubic-bezier(.34, 1.56, .64, 1);
    overflow: hidden;
}

.bnp__item:focus-visible,
.bnp__trig:focus-visible,
.bnp__cta:focus-visible,
.bnp__sheet a:focus-visible,
.bnp__close:focus-visible {
    outline: 2px solid #00c3ff;
    outline-offset: -4px;
}

.bnp__icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 26px;
    font-size: 19px;
    line-height: 1;
    transition: transform .34s cubic-bezier(.34, 1.56, .64, 1);
}

.bnp__icon .halo {
    position: absolute;
    inset: -4px;
    border-radius: 14px;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .3s ease, transform .4s cubic-bezier(.34, 1.56, .64, 1);
    pointer-events: none;
}

.bnp__txt {
    position: relative;
    z-index: 1;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    max-width: 100%;
    overflow: visible;
    white-space: nowrap;
}

.bnp__badge {
    position: absolute;
    top: 8px;
    right: 14%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22e3c6;
    box-shadow: 0 0 0 3px rgba(34, 227, 198, .22);
    opacity: 0;
    transform: scale(0);
    transition: opacity .3s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
}

.bnp__chev {
    display: none;
    font-size: 8px;
    opacity: .55;
    transition: transform .3s ease;
}

/* حالت فعال */
.bnp__item.is-active,
.bnp__trig.is-active,
.bnp__cta.is-active,
.bnp__home-link.is-active {
    color: var(--bnp-ink);
}

.bnp__home-link.is-active {
    color: #fff;
}

.bnp__item.is-active .halo,
.bnp__trig.is-active .halo,
.bnp__cta.is-active .halo {
    opacity: 1;
    transform: scale(1);
}

.bnp__item.is-active .bnp__icon,
.bnp__trig.is-active .bnp__icon,
.bnp__cta.is-active .bnp__icon {
    transform: translateY(-3px) scale(1.12);
}

.bnp__item.is-active .bnp__badge,
.bnp__trig.is-active .bnp__badge {
    opacity: 1;
    transform: scale(1);
}

/* رنگ‌های شاد per-item */
.bnp__serv.is-active .halo,
.bnp__serv .halo {
    background: linear-gradient(135deg, rgba(124, 77, 255, .28), rgba(0, 195, 255, .22));
}

.bnp__prod.is-active .halo {
    background: linear-gradient(135deg, rgba(255, 138, 61, .3), rgba(255, 77, 141, .22));
}

.bnp__supp.is-active .halo {
    background: linear-gradient(135deg, rgba(47, 225, 109, .3), rgba(34, 227, 198, .22));
}

.bnp__acct.is-active .halo {
    background: linear-gradient(135deg, rgba(0, 124, 245, .3), rgba(34, 227, 198, .24));
}

.bnp__serv.is-active {
    color: #6d3df0;
}

.bnp__prod.is-active {
    color: #f2551f;
}

.bnp__supp.is-active {
    color: #14a44d;
}

.bnp__acct.is-active {
    color: #0b6cff;
}

/* فشرده‌سازی */
.bnp__item:active,
.bnp__trig:active,
.bnp__cta:active {
    transform: scale(.9);
}

.bnp__item:active .bnp__icon,
.bnp__trig:active .bnp__icon {
    transform: translateY(1px) scale(.92);
}

/* ---------- آیتم وسط: خانه (بیرون‌زدگی) ---------- */
.bnp__home {
    flex: 0 0 auto;
    width: 68px;
    max-width: none;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.bnp__home-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 62px;
    height: 62px;
    margin-bottom: 26px;
    border-radius: 50%;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(140deg, #00c3ff 0%, #0b6cff 48%, #7c4dff 100%);
    box-shadow: 0 10px 26px rgba(11, 108, 255, .45), 0 3px 0 rgba(255, 255, 255, .55) inset;
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s ease;
    -webkit-user-select: none;
    user-select: none;
}

.bnp__home-link i {
    font-size: 22px;
    line-height: 1;
    margin-top: 2px;
    filter: drop-shadow(0 2px 4px rgba(6, 32, 66, .35));
}

.bnp__home-link span {
    font-size: 10px;
    font-weight: 700;
    opacity: .95;
}

.bnp__home-link::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(0, 195, 255, .55);
    opacity: 0;
    pointer-events: none;
}

.bnp__home-link:active {
    transform: scale(.9);
}

.bnp__home .is-active {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 14px 32px rgba(11, 108, 255, .55), 0 3px 0 rgba(255, 255, 255, .6) inset;
}

.bnp__home .is-active::after {
    opacity: 1;
    animation: bnpPulse 2.4s ease-out infinite;
}

@keyframes bnpPulse {
    0% {
        transform: scale(.86);
        opacity: .85;
    }

    70% {
        transform: scale(1.22);
        opacity: 0;
    }

    100% {
        transform: scale(1.22);
        opacity: 0;
    }
}

/* ---------- هایلایت زیر آیتم باز شده ---------- */
.bnp__state {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.bnp__g {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    max-width: 88px;
    height: 100%;
    display: flex;
}

.bnp__g > .bnp__trig {
    flex: 1 1 auto;
}

.bnp__g::after {
    content: '';
    position: absolute;
    right: 8%;
    left: 8%;
    bottom: 5px;
    height: 3px;
    border-radius: 3px;
    opacity: 0;
    transform: scaleX(.2);
    transition: opacity .3s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
    pointer-events: none;
}

.bnp__serv-g::after {
    background: linear-gradient(90deg, #7c4dff, #00c3ff);
}

.bnp__prod-g::after {
    background: linear-gradient(90deg, #ff8a3d, #ff4d8d);
}

.bnp__supp-g::after {
    background: linear-gradient(90deg, #2fe16d, #22e3c6);
}

#bnp-serv:checked~.bnp__bar .bnp__serv-g::after,
#bnp-prod:checked~.bnp__bar .bnp__prod-g::after,
#bnp-supp:checked~.bnp__bar .bnp__supp-g::after {
    opacity: 1;
    transform: scaleX(1);
}

/* ---------- شیت زیرمنو ---------- */
.bnp__tray,
.bnp__scrim {
    position: fixed;
    inset: 0;
    z-index: -1;
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.bnp__scrim {
    transition: opacity .32s ease, visibility .32s ease;
}

.bnp__sheet {
    position: fixed;
    right: 10px;
    left: 10px;
    bottom: calc(var(--bnp-total) + 6px);
    max-height: min(62vh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 22px 55px rgba(9, 30, 55, .28), inset 0 0 0 1px rgba(255, 255, 255, .7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(26px) scale(.96);
    transform-origin: bottom center;
    transition: opacity .3s ease, transform .42s cubic-bezier(.34, 1.56, .64, 1), visibility .35s ease;
    pointer-events: none;
}

.bnp__sheet::before {
    content: '';
    display: block;
    width: 42px;
    height: 4px;
    margin: -4px auto 10px;
    border-radius: 4px;
    background: #d7dee9;
}

/* باز شدن شیت‌ها */
#bnp-serv:checked~.bnp__scrim,
#bnp-prod:checked~.bnp__scrim,
#bnp-supp:checked~.bnp__scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: rgba(11, 26, 47, .38);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

#bnp-serv:checked~.bnp__bar .bnp__serv-s,
#bnp-prod:checked~.bnp__bar .bnp__prod-s,
#bnp-supp:checked~.bnp__bar .bnp__supp-s {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#bnp-serv:checked~.bnp__bar .bnp__serv-s .bnp__row,
#bnp-serv:checked~.bnp__bar .bnp__serv-s .bnp__grp,
#bnp-prod:checked~.bnp__bar .bnp__prod-s .bnp__row,
#bnp-prod:checked~.bnp__bar .bnp__prod-s .bnp__grp,
#bnp-supp:checked~.bnp__bar .bnp__supp-s .bnp__row,
#bnp-supp:checked~.bnp__bar .bnp__supp-s .bnp__grp {
    animation: bnpRowIn .42s cubic-bezier(.22, 1, .36, 1) backwards;
    animation-delay: calc(var(--i, 1) * 45ms);
}

.bnp__sheet > :nth-child(1) { --i: 1; }
.bnp__sheet > :nth-child(2) { --i: 2; }
.bnp__sheet > :nth-child(3) { --i: 3; }
.bnp__sheet > :nth-child(4) { --i: 4; }
.bnp__sheet > :nth-child(5) { --i: 5; }
.bnp__sheet > :nth-child(6) { --i: 6; }
.bnp__sheet > :nth-child(7) { --i: 7; }
.bnp__sheet > :nth-child(8) { --i: 8; }

@keyframes bnpRowIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

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

/* چرخش فلش تریگر */
#bnp-serv:checked~.bnp__bar .bnp__serv .bnp__chev,
#bnp-prod:checked~.bnp__bar .bnp__prod .bnp__chev,
#bnp-supp:checked~.bnp__bar .bnp__supp .bnp__chev {
    transform: rotate(180deg);
    opacity: 1;
}

/* محتوای شیت */
.bnp__sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.bnp__sheet-title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--bnp-ink);
}

.bnp__close {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f0f3f8;
    color: #5a6b80;
    font-size: 13px;
    cursor: pointer;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), background .25s ease;
}

.bnp__close:active {
    transform: scale(.88);
    background: #e2e8f1;
}

.bnp__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin-bottom: 6px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--bnp-ink);
    background: #f6f8fc;
    box-shadow: inset 0 0 0 1px rgba(11, 26, 47, .05);
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), background .22s ease, box-shadow .22s ease;
}

.bnp__row:active {
    transform: scale(.97);
}

.bnp__row:hover {
    background: #eef3fb;
    text-decoration: none;
    color: var(--bnp-ink);
}

.bnp__row .ic {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(140deg, #00c3ff, #0b6cff);
    box-shadow: 0 6px 14px rgba(11, 108, 255, .28);
}

.bnp__row .lb {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.5;
    text-align: right;
}

.bnp__row .ar {
    flex: 0 0 auto;
    font-size: 11px;
    color: #9aa8bb;
    transition: transform .22s ease;
}

.bnp__row:hover .ar {
    transform: translateX(-3px);
}

/* گروه‌های تو در خدمات */
.bnp__grp {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 16px;
    background: #f6f8fc;
    box-shadow: inset 0 0 0 1px rgba(11, 26, 47, .05);
}

.bnp__grp>.bnp__row {
    margin-bottom: 4px;
    padding: 6px 8px;
    background: transparent;
    box-shadow: none;
    font-weight: 800;
}

.bnp__grp>.bnp__row .ic {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 13px;
}

.bnp__kids {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 4px 2px 0;
}

.bnp__kids a {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    color: #2f4460;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(11, 26, 47, .08);
    transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), color .2s ease, box-shadow .2s ease;
}

.bnp__kids a:active {
    transform: scale(.94);
}

.bnp__kids a:hover {
    color: #0b6cff;
    box-shadow: inset 0 0 0 1px rgba(11, 108, 255, .4);
    text-decoration: none;
}

/* رنگ آیکون‌های شیت */
.bnp__prod-s .bnp__row .ic {
    background: linear-gradient(140deg, #ff8a3d, #ff4d8d);
    box-shadow: 0 6px 14px rgba(255, 90, 90, .3);
}

.bnp__supp-s .bnp__row.is-wa .ic {
    background: linear-gradient(140deg, #2fe16d, #1fb857);
    box-shadow: 0 6px 14px rgba(31, 184, 87, .32);
}

.bnp__supp-s .bnp__row.is-ei .ic {
    background: linear-gradient(140deg, #ff9f2f, #f57c00);
    box-shadow: 0 6px 14px rgba(245, 124, 0, .32);
}

.bnp__supp-s .bnp__row.is-ei .ic img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.bnp__supp-s .bnp__row.is-cb .ic {
    background: linear-gradient(140deg, #7c4dff, #00c3ff);
    box-shadow: 0 6px 14px rgba(124, 77, 255, .3);
}

/* ---------- ورود نوار هنگام لود ---------- */
@keyframes bnpBarIn {
    from {
        opacity: 0;
        transform: translateY(90px);
    }

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

/* ---------- فقط موبایل ---------- */
@media (max-width: 767.98px) {
    .bnp {
        display: block;
        pointer-events: auto;
    }

    .bnp__bar {
        animation: bnpBarIn .55s cubic-bezier(.22, 1, .36, 1) .2s backwards;
    }

    body {
        padding-bottom: calc(var(--bnp-h) + var(--bnp-safe));
        scroll-padding-bottom: var(--bnp-total);
    }

    /* فوتر در موبایل مخفی می‌شود (جایگزین: همین نوار) */
    .footer-area {
        display: none !important;
    }

    /* مخفی‌سازی آیکون‌های شناور واتس‌اپ و ایتا */
    .support-fixed {
        display: none !important;
    }

    /* دکمه بازگشت به بالا بالای نوار قرار می‌گیرد */
    #scrollUp {
        bottom: calc(var(--bnp-total) + 12px);
        left: 14px;
        width: 42px;
        height: 42px;
        line-height: 42px;
        font-size: 16px;
    }

    /* پیام نصب PWA بالای نوار */
    .pwa-install-toast {
        bottom: calc(var(--bnp-total) + 12px);
        right: 10px;
        left: 10px;
        z-index: 9997;
    }

    /* هنگام باز بودن زیرمنو، عناصر شناور مزاحم نمی‌شوند */
    body.bnp-open .pwa-install-toast,
    body.bnp-open #scrollUp {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
    }
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {

    .bnp__bar,
    #bnp-serv:checked~.bnp__bar .bnp__serv-s .bnp__row,
    #bnp-prod:checked~.bnp__bar .bnp__prod-s .bnp__row,
    #bnp-supp:checked~.bnp__bar .bnp__supp-s .bnp__row {
        animation: none !important;
    }

    .bnp__sheet,
    .bnp__item,
    .bnp__trig,
    .bnp__cta,
    .bnp__icon,
    .bnp__home-link {
        transition-duration: .01ms !important;
    }

    .bnp__home .is-active::after {
        animation: none !important;
        opacity: .7;
    }
}

/* ==========================================================================
   خنثی‌سازی رنگ سراسری تم (a / a:visited / a:hover) روی پیوندهای این نوار
   تم بدون این قواعد، لینک‌های دیده‌شده را #111 و hover را #00b0ff می‌کند.
   ========================================================================== */
.bnp a,
.bnp a:visited,
.bnp a:hover,
.bnp a:focus {
    text-decoration: none;
}

.bnp .bnp__home-link,
.bnp .bnp__home-link:visited,
.bnp .bnp__home-link:hover,
.bnp .bnp__home-link:active,
.bnp .bnp__home-link:focus {
    color: #ffffff;
}

.bnp .bnp__cta:not(.is-active),
.bnp .bnp__cta:not(.is-active):visited,
.bnp .bnp__cta:not(.is-active):hover,
.bnp .bnp__cta:not(.is-active):active,
.bnp .bnp__cta:not(.is-active):focus {
    color: var(--bnp-muted);
}

.bnp .bnp__row,
.bnp .bnp__row:visited {
    color: var(--bnp-ink);
    text-align: right;
}

.bnp .bnp__kids a,
.bnp .bnp__kids a:visited {
    color: #2f4460;
}

.bnp .bnp__kids a:hover {
    color: #0b6cff;
}

.bnp__sheet-title,
.bnp__txt {
    text-align: right;
}
