/**
 * VO2 Desktop Sidebar — fixed RIGHT (RTL), full chrome (logo, search, cart, nav)
 */

:root {
    --vo2-ds-width: 280px;
    --vo2-ds-collapsed: 76px;
    --vo2-ds-bg: var(--surface-1, #eef1f6);
    --vo2-ds-accent: var(--primary, #df2063);
    --vo2-ds-fg: var(--fg-2, #3a4254);
    --vo2-ds-muted: var(--fg-3, #6b7282);
    --vo2-ds-raised: var(--nm-raised-sm, -4px -4px 10px rgba(255, 255, 255, 0.92), 5px 5px 12px rgba(163, 177, 198, 0.45));
    --vo2-ds-inset: var(--nm-inset-sm, inset 2px 2px 5px rgba(163, 177, 198, 0.45), inset -2px -2px 5px rgba(255, 255, 255, 0.92));
}

/* ---- Layout offset: sidebar on physical RIGHT ---- */
@media (min-width: 992px) {
    body.vo2-has-desktop-sidebar {
        margin-right: var(--vo2-ds-width);
        margin-left: 0;
        transition: margin-right 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    }

    body.vo2-has-desktop-sidebar.vo2-ds-collapsed {
        margin-right: var(--vo2-ds-collapsed);
    }

    /* هدر دسکتاپ کاملاً حذف — همه‌چیز در سایدبار */
    body.vo2-has-desktop-sidebar #header {
        display: none !important;
    }

    /* فاصله hero بدون هدر ثابت */
    body.vo2-has-desktop-sidebar #hero {
        padding-top: 24px !important;
    }

    body.vo2-has-desktop-sidebar #hero .intro-info {
        padding-top: 20px !important;
    }
}

.vo2-desktop-sidebar {
    display: none;
}

@media (min-width: 992px) {
    .vo2-desktop-sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        width: var(--vo2-ds-width);
        height: 100vh;
        height: 100dvh;
        z-index: 1045;
        background: var(--vo2-ds-bg);
        box-shadow: -8px 0 32px rgba(163, 177, 198, 0.32);
        border-left: 1px solid rgba(163, 177, 198, 0.25);
        transition: width 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        overflow: visible;
        direction: rtl;
        text-align: right;
    }

    body.vo2-ds-collapsed .vo2-desktop-sidebar {
        width: var(--vo2-ds-collapsed);
    }
}

/* ---- Brand ---- */
.vo2-ds-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 0.9rem;
    min-height: 60px;
    border-bottom: 1px solid rgba(163, 177, 198, 0.2);
    flex-shrink: 0;
}

.vo2-ds-brand__link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1 1 auto;
    text-decoration: none !important;
}

.vo2-ds-brand__link img {
    height: 28px;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) opacity(0.78);
}

.vo2-ds-brand__title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--vo2-ds-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease, width 0.2s ease;
}

body.vo2-ds-collapsed .vo2-ds-brand__title {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* جمع‌شده: لوگو و دکمه باز/بسته زیر هم — بدون هم‌پوشانی */
body.vo2-ds-collapsed .vo2-ds-brand {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.35rem;
    min-height: auto;
}

body.vo2-ds-collapsed .vo2-ds-brand__link {
    flex: 0 0 auto;
    justify-content: center;
    width: 100%;
}

body.vo2-ds-collapsed .vo2-ds-collapse-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.vo2-ds-collapse-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: var(--vo2-ds-bg);
    color: var(--vo2-ds-muted);
    box-shadow: var(--vo2-ds-inset);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, box-shadow 0.15s ease, transform 0.2s ease;
}

.vo2-ds-collapse-btn:hover {
    color: var(--vo2-ds-accent);
    box-shadow: var(--vo2-ds-raised);
}

body.vo2-ds-collapsed .vo2-ds-collapse-btn i {
    transform: rotate(180deg);
}

/* ---- Toolbar — neumorphic (header-toolbar) ---- */
.vo2-ds-toolbar {
    flex-shrink: 0;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(163, 177, 198, 0.2);
    position: relative;
    z-index: 2;
    --ht-bg: var(--surface-1, #eef1f6);
    --ht-fg: var(--fg-2, #3a4254);
    --ht-fg-muted: var(--fg-3, #6b7282);
    --ht-accent: var(--primary, #df2063);
    --ht-shadow-dark: rgba(163, 177, 198, 0.45);
    --ht-shadow-light: rgba(255, 255, 255, 0.92);
    --ht-raised: var(--nm-raised-sm, -4px -4px 10px var(--ht-shadow-light), 5px 5px 12px var(--ht-shadow-dark));
    --ht-inset: var(--nm-inset-sm, inset 2px 2px 5px var(--ht-shadow-dark), inset -2px -2px 5px var(--ht-shadow-light));
}

.vo2-ds-toolbar__row.header-toolbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    direction: rtl;
    width: 100%;
    margin: 0;
}

.vo2-ds-toolbar .header-toolbar__search {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    margin: 0;
}

.vo2-ds-toolbar .header-toolbar__search .form-control {
    width: 100%;
    height: 36px;
    font-size: 0.8rem;
    border-radius: 12px;
}

.vo2-ds-toolbar .header-toolbar__group {
    flex-shrink: 0;
}

.vo2-ds-toolbar .header-toolbar__btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.vo2-ds-toolbar .header-toolbar__btn--profile {
    width: auto;
    height: auto;
}

.vo2-ds-toolbar .header-toolbar__avatar {
    width: 32px;
    height: 32px;
}

.vo2-ds-toolbar .header-toolbar__badge,
.vo2-ds-toolbar .nc-badge {
    background: var(--primary, #df2063) !important;
}

.vo2-ds-toolbar .my-cart-icon {
    color: var(--ht-fg, #3a4254) !important;
}

.vo2-ds-toolbar .header-toolbar__btn:hover .my-cart-icon {
    color: var(--ht-accent, #df2063) !important;
    transform: none;
}

.vo2-ds-toolbar__social img {
    filter: brightness(0) saturate(100%) opacity(0.55);
}

body.vo2-ds-collapsed .vo2-ds-toolbar__row {
    flex-direction: column;
    gap: 0.4rem;
}

body.vo2-ds-collapsed .vo2-ds-toolbar .header-toolbar__search {
    display: none;
}

.vo2-ds-notif-wrap {
    flex: 0 0 auto;
}

.vo2-ds-notif-wrap .dropdown-menu.nc-dropdown {
    right: auto !important;
    left: 0 !important;
    transform: translate3d(0, 40px, 0) !important;
}

.vo2-ds-profile-drop {
    flex: 0 0 auto;
}

.vo2-ds-profile-link::after {
    display: none !important;
}

.vo2-ds-toolbar .header-toolbar__search .bootstrap-autocomplete.dropdown-menu,
.vo2-ds-toolbar > .bootstrap-autocomplete.dropdown-menu {
    right: 0.7rem !important;
    left: 0.7rem !important;
    width: auto !important;
    max-width: none !important;
    z-index: 1065 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--fg-2, #3a4254) !important;
    box-shadow: 0 10px 28px rgba(26, 31, 43, 0.14) !important;
}

.vo2-ds-toolbar .bootstrap-autocomplete.dropdown-menu .dropdown-item {
    color: var(--fg-2, #3a4254) !important;
    padding: 0.55rem 0.7rem !important;
    white-space: normal !important;
}

.vo2-ds-toolbar .bootstrap-autocomplete.dropdown-menu .dropdown-item:hover,
.vo2-ds-toolbar .bootstrap-autocomplete.dropdown-menu .dropdown-item:focus,
.vo2-ds-toolbar .bootstrap-autocomplete.dropdown-menu .dropdown-item.active {
    background: rgba(223, 32, 99, 0.08) !important;
    color: var(--primary, #df2063) !important;
}

/* ادمین — برچسب برند */
.vo2-desktop-sidebar--admin .vo2-ds-brand__title {
    color: var(--primary, #df2063);
}

/* ---- Scroll nav ---- */
.vo2-ds-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.55rem 0.5rem 0.75rem;
    -webkit-overflow-scrolling: touch;
}

.vo2-ds-section-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--vo2-ds-muted);
    padding: 0.65rem 0.8rem 0.3rem;
    white-space: nowrap;
}

body.vo2-ds-collapsed .vo2-ds-section-label {
    display: none;
}

.vo2-ds-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.58rem 0.8rem;
    margin: 0.12rem 0;
    border-radius: 14px;
    color: var(--vo2-ds-fg) !important;
    text-decoration: none !important;
    font-size: 0.86rem;
    font-weight: 600;
    border-right: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.vo2-ds-link .bi {
    font-size: 1.1rem;
    width: 1.3rem;
    text-align: center;
    flex-shrink: 0;
    color: var(--vo2-ds-muted);
}

body.vo2-ds-collapsed .vo2-ds-link span,
body.vo2-ds-collapsed .vo2-ds-accordion__toggle > span,
body.vo2-ds-collapsed .vo2-ds-accordion__chevron {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

body.vo2-ds-collapsed .vo2-ds-link {
    justify-content: center;
    padding-inline: 0.45rem;
}

.vo2-ds-link:hover,
.vo2-ds-link:focus {
    background: rgba(255, 255, 255, 0.55);
    color: var(--vo2-ds-accent) !important;
}

.vo2-ds-link:hover .bi,
.vo2-ds-link:focus .bi {
    color: var(--vo2-ds-accent);
}

.vo2-ds-link.active {
    background: rgba(223, 32, 99, 0.09);
    border-right-color: var(--vo2-ds-accent);
    color: var(--vo2-ds-accent) !important;
}

.vo2-ds-link.active .bi {
    color: var(--vo2-ds-accent);
}

.vo2-ds-link--cta {
    background: linear-gradient(145deg, #ea4782, #be1553);
    color: #fff !important;
    border-right-color: transparent;
}

.vo2-ds-link--cta .bi {
    color: #fff !important;
}

.vo2-ds-divider {
    height: 1px;
    margin: 0.45rem 0.7rem;
    background: rgba(163, 177, 198, 0.28);
}

/* ---- Accordion ---- */
.vo2-ds-accordion {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vo2-ds-accordion__toggle {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.58rem 0.8rem;
    margin: 0.12rem 0;
    border: none;
    border-radius: 14px;
    border-right: 3px solid transparent;
    background: none;
    color: var(--vo2-ds-fg);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
}

.vo2-ds-accordion__toggle .bi:first-child {
    font-size: 1.1rem;
    width: 1.3rem;
    text-align: center;
    flex-shrink: 0;
    color: var(--vo2-ds-muted);
}

.vo2-ds-accordion__chevron {
    margin-right: auto;
    margin-left: 0;
    font-size: 0.82rem;
    color: var(--vo2-ds-muted);
    transition: transform 0.25s ease;
}

.vo2-ds-accordion__toggle.is-open .vo2-ds-accordion__chevron {
    transform: rotate(180deg);
}

.vo2-ds-accordion__toggle:hover,
.vo2-ds-accordion__toggle.is-open {
    background: rgba(255, 255, 255, 0.55);
    color: var(--vo2-ds-accent);
}

body.vo2-ds-collapsed .vo2-ds-accordion__sub {
    display: none !important;
}

.vo2-ds-accordion__sub {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    border-right: 2px solid rgba(223, 32, 99, 0.12);
    margin-right: 1.1rem;
}

.vo2-ds-accordion__sub.is-open {
    max-height: 2400px;
}

.vo2-ds-accordion__sub a {
    display: block;
    padding: 0.42rem 0.65rem 0.42rem 0.4rem;
    margin: 0.08rem 0;
    border-radius: 10px;
    color: var(--vo2-ds-muted) !important;
    text-decoration: none !important;
    font-size: 0.78rem;
    font-weight: 500;
    text-align: right;
}

.vo2-ds-accordion__sub a:hover,
.vo2-ds-accordion__sub a.active {
    background: rgba(223, 32, 99, 0.07);
    color: var(--vo2-ds-accent) !important;
}

.vo2-ds-accordion__sub--deep {
    margin-right: 0.75rem;
}

.vo2-ds-accordion__sub .vo2-ds-accordion__toggle {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.55rem;
}

/* ---- حساب من ---- */
.vo2-ds-account {
    margin-bottom: 0.15rem;
}

.vo2-ds-account__head {
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    padding: 0.62rem 0.85rem !important;
    gap: 0.5rem !important;
}

.vo2-ds-account__head.is-open,
.vo2-ds-account__head:hover,
.vo2-ds-account:has(.vo2-ds-account__body > li > a.active) .vo2-ds-account__head {
    color: var(--primary, #df2063) !important;
    background: rgba(223, 32, 99, 0.1) !important;
    border-right-color: var(--primary, #df2063) !important;
    box-shadow: var(--vo2-ds-inset);
}

.vo2-ds-account__head .vo2-ds-accordion__chevron {
    color: var(--primary, #df2063);
}

.vo2-ds-account__body.vo2-ds-accordion__sub {
    border-right: none;
    margin-right: 0.35rem;
    margin-left: 0.15rem;
    padding: 0.2rem 0.35rem 0.35rem;
    background: rgba(255, 255, 255, 0.42);
    border-radius: 0 0 14px 14px;
    box-shadow: var(--vo2-ds-inset);
}

.vo2-ds-account__body > li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vo2-ds-account__body > li > a {
    display: block;
    padding: 0.5rem 0.65rem;
    margin: 0.1rem 0;
    border-radius: 10px;
    color: var(--vo2-ds-fg) !important;
    text-decoration: none !important;
    font-size: 0.84rem;
    font-weight: 500;
    text-align: right;
    line-height: 1.45;
}

.vo2-ds-account__body > li > a:hover,
.vo2-ds-account__body > li > a.active {
    background: rgba(223, 32, 99, 0.09);
    color: var(--primary, #df2063) !important;
    font-weight: 600;
}

.vo2-ds-account__body > li > a.active {
    box-shadow: inset 3px 0 0 var(--primary, #df2063);
}

.vo2-ds-account__action {
    cursor: pointer;
}

.vo2-ds-account__divider {
    margin: 0.35rem 0.65rem 0.55rem;
}

body.vo2-ds-collapsed .vo2-ds-account,
body.vo2-ds-collapsed .vo2-ds-account__divider {
    display: none;
}

/* ---- Footer ---- */
.vo2-ds-footer {
    flex-shrink: 0;
    padding: 0.65rem 0.55rem 0.85rem;
    border-top: 1px solid rgba(163, 177, 198, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

body.vo2-ds-collapsed .vo2-ds-footer {
    padding-inline: 0.35rem;
}

.vo2-ds-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.55rem;
    border-radius: 14px;
    text-decoration: none !important;
    color: var(--vo2-ds-fg) !important;
}

body.vo2-ds-collapsed .vo2-ds-user {
    justify-content: center;
}

.vo2-ds-user:hover {
    background: rgba(255, 255, 255, 0.5);
}

.vo2-ds-user img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(223, 32, 99, 0.2);
    flex-shrink: 0;
}

body.vo2-ds-collapsed .vo2-ds-user__meta {
    display: none;
}

.vo2-ds-user__name {
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vo2-ds-user__hint {
    font-size: 0.68rem;
    color: var(--vo2-ds-muted);
}

.vo2-ds-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.55rem;
    border-radius: 12px;
    border: none;
    background: rgba(223, 32, 99, 0.08);
    color: var(--primary, #df2063) !important;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: var(--vo2-ds-inset);
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.vo2-ds-logout:hover {
    background: rgba(223, 32, 99, 0.14);
    box-shadow: var(--vo2-ds-raised);
}

body.vo2-ds-collapsed .vo2-ds-logout span {
    display: none;
}

body.vo2-ds-collapsed .vo2-ds-logout {
    padding: 0.5rem;
}

@media (max-width: 991.98px) {
    .vo2-desktop-sidebar {
        display: none !important;
    }
}
