/**
 * چیدمان دسکتاپ پنل (فقط عرض‌های بزرگ‌تر از ۱۰۲۴px).
 *
 * منوهای پایین موبایل به سایدبار عمودی سمت راست تبدیل می‌شوند و محتوا در
 * سمت چپ (باقی عرض صفحه) می‌نشیند. کل این فایل با یک کلید در autoarvan.php
 * فعال/غیرفعال می‌شود (AUTOARVAN_PWA_DESKTOP_SIDEBAR)؛ برای بازگشت به
 * چیدمان موبایل همان مقدار را false کنید.
 *
 * @package autoarvan
 */

@media (min-width: 1024px) {
    /* ریشهٔ اپ از عرض ثابت قالب بیرون می‌زند تا کل صفحه را بگیرد.
       .aa-pwa (حالت ورود/غیرمجاز) روی همین المان پدینگ و مرکزچین دارد؛
       در دسکتاپ خنثی می‌شود تا محاسبهٔ عرض کامل دقیق بماند. */
    .aa-pwa-app {
        width: 100vw;
        max-width: 100vw;
        margin-inline: calc(50% - 50vw);
        padding: 0;
        display: block;
        overflow-x: clip;
    }

    /* ---------------- سایدبار (منوها) ---------------- */
    .aa-pwa-app .aa-pwa-nav {
        top: 0;
        bottom: 0;
        right: 0;
        left: auto;
        width: 248px;
        padding: 18px 12px 16px;
        background-color: #fff;
        background-image: radial-gradient(circle at 88% 100%, rgba(240, 164, 19, .18), transparent 62%);
        border-left: 1px solid var(--aa-pwa-border);
        box-shadow: none;
        display: flex;
        flex-direction: column;
        z-index: 950;
        padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
        transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    }

    .aa-pwa-app .aa-pwa-nav-bar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        width: 100%;
        max-width: none;
        height: auto;
        position: static;
    }

    .aa-pwa-app .aa-pwa-nav-bar--limited {
        display: flex;
    }

    .aa-pwa-app .aa-pwa-nav-item {
        width: 100%;
        padding: 0;
    }

    .aa-pwa-app .aa-pwa-nav-btn {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
        height: auto;
        min-height: 44px;
        padding: 11px 14px;
        border-radius: 12px;
        color: var(--aa-pwa-muted);
        transition: background .18s ease, color .18s ease;
    }

    .aa-pwa-app .aa-pwa-nav-btn:hover {
        background: rgba(31, 39, 51, .05);
        color: var(--aa-pwa-navy-1);
    }

    .aa-pwa-app .aa-pwa-nav-ic svg {
        width: 20px;
        height: 20px;
    }

    .aa-pwa-app .aa-pwa-nav-label {
        font-size: 14px;
        font-weight: 700;
    }

    .aa-pwa-app .aa-pwa-nav-item.is-active .aa-pwa-nav-btn {
        background: rgba(240, 164, 19, .14);
        color: var(--aa-pwa-navy-1);
    }

    /* نشانگر کهربایی مخصوص منوی پایین است؛ در سایدبار لازم نیست. */
    .aa-pwa-app .aa-pwa-nav-indicator {
        display: none;
    }

    /* صفحه‌های بدون منو (مشاهدهٔ خودرو) و درگاه پروفایل: سایدبار نباید
       دوباره ظاهر شود — قاعدهٔ بالا display آن‌ها را بازنویسی می‌کرد. */
    .aa-pwa-app.is-navless .aa-pwa-nav,
    .aa-pwa-app.is-gated .aa-pwa-nav {
        display: none;
    }

    /* ---------------- هدر و نوار برند: فقط روی محتوا ---------------- */
    .aa-pwa-app .aa-pwa-header {
        right: 248px;
        left: 0;
    }

    .aa-pwa-app .aa-pwa-header-bar {
        max-width: none;
        padding: 0 28px;
    }

    .aa-pwa-app .aa-pwa-brandbar {
        right: 248px;
        left: 0;
        background: #fff;
    }

    /* ---------------- محتوا: سمت چپ ---------------- */
    .aa-pwa-app .aa-pwa-content {
        max-width: none;
        width: auto;
        margin: 0 248px 0 0;
        padding-left: 28px;
        padding-right: 28px;
        padding-bottom: 36px;
        overflow-x: clip;
        transition: margin .28s cubic-bezier(.4, 0, .2, 1);
    }

    /* صفحه‌های بدون منو (مشاهدهٔ خودرو، درگاه تکمیل پروفایل): تمام‌عرض */
    .aa-pwa-app.is-navless .aa-pwa-header,
    .aa-pwa-app.is-gated .aa-pwa-header {
        right: 0;
    }

    .aa-pwa-app.is-navless .aa-pwa-brandbar,
    .aa-pwa-app.is-gated .aa-pwa-brandbar {
        right: 0;
    }

    .aa-pwa-app.is-navless .aa-pwa-content,
    .aa-pwa-app.is-gated .aa-pwa-content {
        margin: 0;
        max-width: 960px;
        margin-inline: auto;
        width: 100%;
    }

    /* نوارهای چسبان داخلی که با حاشیهٔ منفی تا لبه می‌رفتند: در دسکتاپ
       داخل ستون محتوا بمانند. */
    .aa-pwa-app .aa-pwa-cars-top,
    .aa-pwa-app .aa-pwa-board-top,
    .aa-pwa-app .aa-pwa-stepper-bar {
        margin-left: 0;
        margin-right: 0;
    }

    /* اسکرول‌بار محتوا زیر هدر نمی‌رود. */
    .aa-pwa-app .aa-pwa-content > *:first-child {
        margin-top: 0;
    }

    /* صفحهٔ پنل: «وضعیت تلگرامی» و «آمار عملکردی» کنار هم در یک سطر. */
    .aa-pwa-app .aa-pwa-panel-top {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        align-items: start;
        margin-bottom: 14px;
    }

    .aa-pwa-app .aa-pwa-panel-top > * {
        margin-bottom: 0;
    }

    /* کاشی‌های منوی پنل: ۶ آیتم در هر سطر. */
    .aa-pwa-app .aa-pwa-panel-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* بازگشت در نسخهٔ دسکتاپ لازم نیست (منوی سایدبار همیشه در دسترس است). */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-brandbar-back {
        display: none;
    }
}

/* ---------------- سایدبار دسکتاپ: کاربر + منوهای پنل ---------------- */
@media (min-width: 1024px) {
    /* تب «پنل» لازم نیست؛ همهٔ آیتم‌های آن در همین سایدبار آمده‌اند.
       «خودروها» و «حساب» هم در سایدبار حذف می‌شوند (فقط دسکتاپ؛ موبایل دست‌نخورده). */
    .aa-pwa-app .aa-pwa-nav-item[data-tab="panel"],
    .aa-pwa-app .aa-pwa-nav-item[data-tab="cars"],
    .aa-pwa-app .aa-pwa-nav-item[data-tab="more"],
    .aa-pwa-app .aa-pwa-nav-item[data-tab="home"],
    .aa-pwa-app .aa-pwa-nav-item[data-tab="compose"] {
        display: none;
    }

    /* فقط فهرست منو اسکرول می‌شود؛ کارت کاربر و پانوشت ثابت می‌مانند. */
    .aa-pwa-app .aa-pwa-nav {
        overflow: hidden;
    }

    /* در سایدبار دسکتاپ نوار تب‌های موبایل لازم نیست. */
    .aa-pwa-app .aa-pwa-nav .aa-pwa-nav-bar {
        display: none;
    }

    .aa-pwa-app .aa-pwa-header {
        background: #fff;
    }

    /* بلوک کاربر واردشده در ابتدای سایدبار. */
    /* کارت کاربر: سفید طرح‌دار، کوتاه‌تر، تمام‌عرض و چسبیده به لبه‌های بالا/چپ/راست. */
    .aa-pwa-app .aa-pwa-side-user {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 0 0 auto;
        padding: 10px 12px 10px 6px;
        margin: -18px -12px 12px;
        border: 0;
        border-radius: 0;
        background: transparent;
        cursor: pointer;
        transition: background-color .18s ease;
    }

    .aa-pwa-app .aa-pwa-side-user:hover,
    .aa-pwa-app .aa-pwa-side-user:focus-visible {
        background: rgba(255, 255, 255, .55);
        outline: none;
    }

    .aa-pwa-app .aa-pwa-side-usercaret {
        flex: 0 0 auto;
        display: inline-flex;
        margin-inline-start: auto;
        color: rgba(34, 54, 78, .45);
        transition: transform .2s ease, color .2s ease;
    }

    .aa-pwa-app .aa-pwa-side-user:hover .aa-pwa-side-usercaret,
    .aa-pwa-app .aa-pwa-side-user:focus-visible .aa-pwa-side-usercaret {
        transform: translateX(-5px);
        color: rgba(34, 54, 78, .7);
    }

    .aa-pwa-app .aa-pwa-side-usercaret svg {
        width: 16px;
        height: 16px;
    }

    .aa-pwa-app .aa-pwa-side-avatar {
        flex: 0 0 auto;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        object-fit: cover;
        background: rgba(34, 54, 78, .1);
        border: 2px solid #fff;
        box-shadow: 0 2px 8px rgba(16, 24, 40, .18);
        display: block;
    }

    .aa-pwa-app .aa-pwa-side-avatar--text {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--aa-pwa-navy-1, #22364e);
        font-size: 17px;
        font-weight: 800;
    }

    .aa-pwa-app .aa-pwa-side-id {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .aa-pwa-app .aa-pwa-side-name {
        font-size: 13.5px;
        font-weight: 800;
        color: var(--aa-pwa-navy-1, #22364e);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* چیپ نقش با زمینهٔ زرد. */
    .aa-pwa-app .aa-pwa-side-role {
        align-self: flex-start;
        max-width: 100%;
        margin-top: 3px;
        padding: 1px 8px;
        border-radius: 999px;
        background: var(--aa-pwa-navy-1, #22364e);
        color: #fff;
        font-size: 10.5px;
        font-weight: 800;
        line-height: 1.6;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* منوی کامل پنل زیر تب‌های اصلی — آکاردئونی. */
    .aa-pwa-app .aa-pwa-side-menu {
        display: flex;
        flex-direction: column;
        gap: 0;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        /* اسکرول انجام می‌شود ولی نوار اسکرول دیده نمی‌شود. */
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-top: 2px;
        margin-top: 2px;
    }

    .aa-pwa-app .aa-pwa-side-menu::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    .aa-pwa-app .aa-pwa-side-group {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* ردیف اصلی گروه: هم‌اندازهٔ آیتم‌های منوی سایدبار. */
    .aa-pwa-app .aa-pwa-side-toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 38px;
        padding: 7px 10px;
        border: 0;
        border-radius: 11px;
        background: transparent;
        color: var(--aa-pwa-text);
        font-family: inherit;
        font-size: 13px;
        font-weight: 700;
        text-align: start;
        cursor: pointer;
        transition: background .16s ease, color .16s ease;
    }

    .aa-pwa-app .aa-pwa-side-toggle:hover {
        background: rgba(31, 39, 51, .05);
        color: var(--aa-pwa-navy-1);
    }

    .aa-pwa-app .aa-pwa-side-group.is-open > .aa-pwa-side-toggle {
        background: rgba(34, 54, 78, .07);
        color: var(--aa-pwa-navy-1);
    }

    /* ایکن گروه با پس‌زمینهٔ گرد خاکستری؛ گروه باز ← زرد. */
    .aa-pwa-app .aa-pwa-side-ic {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 26px;
        height: 26px;
        border-radius: 8px;
        background: rgba(31, 39, 51, .08);
        color: var(--aa-pwa-muted);
        transition: background .16s ease, color .16s ease;
    }

    .aa-pwa-app .aa-pwa-side-group.is-open > .aa-pwa-side-toggle .aa-pwa-side-ic {
        background: var(--aa-pwa-navy-1, #22364e);
        color: #fff;
    }

    .aa-pwa-app .aa-pwa-side-ic svg {
        width: 16px;
        height: 16px;
    }

    .aa-pwa-app .aa-pwa-side-label {
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* بج شمارندهٔ «در انتظار» مقابل هر ردیف. */
    .aa-pwa-app .aa-pwa-side-badge {
        flex: 0 0 auto;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 10px;
        background: #e11d48;
        color: #fff;
        font-size: 11px;
        font-weight: 800;
        line-height: 20px;
        text-align: center;
        direction: ltr;
    }

    .aa-pwa-app .aa-pwa-side-chev {
        flex: 0 0 auto;
        display: inline-flex;
        color: var(--aa-pwa-muted);
        transition: transform .18s ease;
    }

    .aa-pwa-app .aa-pwa-side-chev svg {
        width: 16px;
        height: 16px;
    }

    .aa-pwa-app .aa-pwa-side-group.is-open .aa-pwa-side-chev {
        transform: rotate(180deg);
    }

    /* زیرمنو: بدون ایکن، کمی کوچک‌تر و تورفته. */
    .aa-pwa-app .aa-pwa-side-sub {
        display: flex;
        flex-direction: column;
        gap: 1px;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0;
        margin-inline-start: 34px;
        border-inline-start: 1px solid var(--aa-pwa-border);
        transition: max-height .28s ease, opacity .2s ease, padding .28s ease;
    }

    .aa-pwa-app .aa-pwa-side-group.is-open .aa-pwa-side-sub {
        max-height: 520px;
        opacity: 1;
        padding: 2px 0 6px 0;
    }

    .aa-pwa-app .aa-pwa-side-subitem {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-height: 30px;
        padding: 4px 10px;
        border: 0;
        border-radius: 9px;
        background: transparent;
        color: var(--aa-pwa-muted);
        font-family: inherit;
        font-size: 11.5px;
        font-weight: 600;
        text-align: start;
        cursor: pointer;
        transition: background .16s ease, color .16s ease;
    }

    .aa-pwa-app .aa-pwa-side-subitem:hover {
        background: rgba(31, 39, 51, .05);
        color: var(--aa-pwa-navy-1);
    }

    /* زیرمنوی فعال: فقط تغییر رنگ متن (بدون تغییر زمینه). */
    .aa-pwa-app .aa-pwa-side-subitem.is-active {
        color: #be123c;
        font-weight: 800;
    }

    .aa-pwa-app .aa-pwa-side-subitem.is-soon {
        opacity: .5;
        cursor: default;
    }

    .aa-pwa-app .aa-pwa-side-sublabel {
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .aa-pwa-app .aa-pwa-side-subitem .aa-pwa-side-badge {
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        line-height: 18px;
        font-size: 10.5px;
    }
}

/* ---------------- سایدبار دسکتاپ: پانوشت (کپی‌رایت + طراحی) ---------------- */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-side-foot {
        display: block;
        flex: 0 0 auto;
        margin-top: 8px;
        padding: 14px 8px 4px;
        border-top: 1px solid var(--aa-pwa-border);
        text-align: center;
        direction: ltr;
    }

    .aa-pwa-app .aa-pwa-side-copy {
        font-size: 10.5px;
        font-weight: 600;
        color: var(--aa-pwa-muted);
        direction: ltr;
        unicode-bidi: plaintext;
    }

    .aa-pwa-app .aa-pwa-side-credit {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 3px;
        margin-top: 6px;
        font-size: 10.5px;
        font-weight: 600;
        color: var(--aa-pwa-muted);
        line-height: 1.6;
    }

    .aa-pwa-app .aa-pwa-side-author {
        font-weight: 800;
        color: var(--aa-pwa-navy-1);
        direction: ltr;
        unicode-bidi: plaintext;
    }

    .aa-pwa-app .aa-pwa-foot-ic {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 14px;
        height: 14px;
        flex: 0 0 auto;
    }

    .aa-pwa-app .aa-pwa-foot-ic svg {
        width: 14px;
        height: 14px;
    }

    /* قلب تپنده. */
    .aa-pwa-app .aa-pwa-foot-heart {
        color: #e11d48;
        transform-origin: center;
        animation: aa-foot-heartbeat 1.6s ease-in-out infinite;
    }

    @keyframes aa-foot-heartbeat {
        0%, 100% { transform: scale(1); }
        15% { transform: scale(1.28); }
        30% { transform: scale(0.96); }
        45% { transform: scale(1.16); }
        60% { transform: scale(1); }
    }

    /* قهوه: بخار بالا می‌رود. */
    .aa-pwa-app .aa-pwa-foot-coffee {
        color: #92400e;
    }

    .aa-pwa-app .aa-pwa-foot-steam {
        opacity: 0;
        animation: aa-foot-steam 2.4s ease-in-out infinite;
    }

    .aa-pwa-app .aa-pwa-foot-steam.steam-2 {
        animation-delay: .4s;
    }

    .aa-pwa-app .aa-pwa-foot-steam.steam-3 {
        animation-delay: .8s;
    }

    @keyframes aa-foot-steam {
        0% { opacity: 0; transform: translateY(2px); }
        35% { opacity: .9; }
        70% { opacity: 0; transform: translateY(-2.5px); }
        100% { opacity: 0; transform: translateY(-2.5px); }
    }

    @media (prefers-reduced-motion: reduce) {
        .aa-pwa-app .aa-pwa-foot-heart,
        .aa-pwa-app .aa-pwa-foot-steam {
            animation: none;
        }

        .aa-pwa-app .aa-pwa-foot-steam {
            opacity: .8;
        }
    }
}

/* ---------------- لیست خودروها: ۳ کارت در هر سطر (دسکتاپ) ---------------- */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-list.aa-pwa-carlist-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        align-items: start;
    }

    .aa-pwa-app .aa-pwa-carlist-grid > .aa-pwa-car-card {
        margin-bottom: 0;
        height: 100%;
    }

    /* ردیف‌های کمکی (لود بیشتر، خالی، اسکلت) تمام‌عرض می‌مانند. */
    .aa-pwa-app .aa-pwa-carlist-grid > .aa-pwa-list-more,
    .aa-pwa-app .aa-pwa-carlist-grid > .aa-pwa-list-sentinel,
    .aa-pwa-app .aa-pwa-carlist-grid > .aa-pwa-empty {
        grid-column: 1 / -1;
    }
}

/* ---------------- دکمهٔ افزودن (FAB): چپ-پایین در دسکتاپ ---------------- */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-fab,
    .aa-pwa-app .aa-pwa-fab.aa-pwa-fab--wide {
        left: 28px;
        right: auto;
        bottom: 24px;
        transform: none;
    }

    .aa-pwa-app .aa-pwa-fab.aa-pwa-fab--wide:hover {
        transform: scale(1.04);
    }

    .aa-pwa-app .aa-pwa-fab.aa-pwa-fab--wide:active {
        transform: scale(.96);
    }
}

/* ---------------- تاپ‌هدر جدید دسکتاپ + لوگو در سایدبار ---------------- */
@media (min-width: 1024px) {
    /* نوار لوگوی موبایل و هدر قدیمی در دسکتاپ دیده نمی‌شوند. */
    .aa-pwa-app .aa-pwa-brandbar,
    .aa-pwa-app .aa-pwa-header {
        display: none;
    }

    /* لوگوی منتقل‌شده به بالای سایدبار. */
    .aa-pwa-app .aa-pwa-side-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        padding: 0 4px 12px;
    }

    .aa-pwa-app .aa-pwa-side-brand-logo {
        display: block;
        max-width: 100%;
        max-height: 42px;
        width: auto;
        object-fit: contain;
    }

    .aa-pwa-app .aa-pwa-side-brand-name {
        font-size: 16px;
        font-weight: 800;
        color: var(--aa-pwa-navy-1);
    }

    /* کارت کاربر دیگر به لبهٔ بالا نمی‌چسبد؛ لوگو بالای آن است. */
    .aa-pwa-app .aa-pwa-side-user {
        margin: 12px -12px 12px;
    }

    /* نوار بالای دسکتاپ: جستجو (راست) + عنوان + عملیات صفحه + خروج (چپ). */
    .aa-pwa-app .aa-pwa-dtop {
        position: fixed;
        top: 0;
        right: 248px;
        left: 0;
        transition: right .28s cubic-bezier(.4, 0, .2, 1);
        z-index: 900;
        display: flex;
        align-items: center;
        gap: 14px;
        height: 68px;
        padding: 0 28px;
        background: #fff;
        border-bottom: 1px solid var(--aa-pwa-border);
    }

    .aa-pwa-app.is-navless .aa-pwa-dtop,
    .aa-pwa-app.is-gated .aa-pwa-dtop {
        display: none;
    }

    .aa-pwa-app .aa-pwa-dtop-search {
        flex: 0 1 320px;
        display: flex;
        align-items: center;
        gap: 8px;
        height: 40px;
        padding: 0 12px;
        border: 1px solid var(--aa-pwa-border);
        border-radius: 12px;
        background: #f7f8fa;
        transition: border-color .18s ease, background .18s ease;
    }

    .aa-pwa-app .aa-pwa-dtop-search:focus-within {
        background: #fff;
        border-color: #f0a413;
    }

    .aa-pwa-app .aa-pwa-dtop-search-ic {
        display: inline-flex;
        flex: 0 0 auto;
        color: var(--aa-pwa-muted);
    }

    .aa-pwa-app .aa-pwa-dtop-search-ic svg {
        width: 18px;
        height: 18px;
    }

    .aa-pwa-app .aa-pwa-dtop-search-input {
        flex: 1 1 auto;
        min-width: 0;
        border: 0;
        background: transparent;
        font-family: inherit;
        font-size: 13px;
        color: var(--aa-pwa-text);
        outline: none;
    }

    .aa-pwa-app .aa-pwa-dtop-spacer {
        flex: 1 1 auto;
        min-width: 0;
    }

    .aa-pwa-app .aa-pwa-dtop-action {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
    }

    .aa-pwa-app .aa-pwa-dtop-logout {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        height: 40px;
        padding: 0 14px;
        border: 1px solid rgba(225, 29, 72, .25);
        border-radius: 12px;
        background: rgba(225, 29, 72, .07);
        color: #be123c;
        font-family: inherit;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
        transition: background .18s ease, border-color .18s ease;
    }

    .aa-pwa-app .aa-pwa-dtop-logout:hover {
        background: rgba(225, 29, 72, .13);
        border-color: rgba(225, 29, 72, .4);
    }

    .aa-pwa-app .aa-pwa-dtop-logout-ic svg {
        width: 16px;
        height: 16px;
    }

    /* محتوا زیر نوار ثابت جدید. */
    .aa-pwa-app.has-brandbar .aa-pwa-content,
    .aa-pwa-app.has-brandbar:not(.is-headerless) .aa-pwa-content {
        padding-top: calc(68px + 18px);
    }

    /* نوارهای چسبان داخلی زیر نوار بالای دسکتاپ بمانند. */
    .aa-pwa-app .aa-pwa-cars-top,
    .aa-pwa-app .aa-pwa-board-top {
        top: 68px;
    }
}

/* ---------------- دکمهٔ کاربر و منوی کشویی در تاپ‌هدر دسکتاپ ---------------- */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-dtop-userwrap {
        position: relative;
        flex: 0 0 auto;
    }

    .aa-pwa-app .aa-pwa-dtop-user {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        height: 44px;
        max-width: 230px;
        padding: 0 10px;
        border: 1px solid var(--aa-pwa-border);
        border-radius: 12px;
        background: #fff;
        color: var(--aa-pwa-navy-1);
        font-family: inherit;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
        transition: background .18s ease, border-color .18s ease;
    }

    .aa-pwa-app .aa-pwa-dtop-user:hover,
    .aa-pwa-app .aa-pwa-dtop-user[aria-expanded="true"] {
        background: #f7f8fa;
        border-color: rgba(34, 54, 78, .28);
    }

    .aa-pwa-app .aa-pwa-dtop-avatar {
        flex: 0 0 auto;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        object-fit: cover;
        background: rgba(34, 54, 78, .1);
        display: block;
    }

    .aa-pwa-app .aa-pwa-dtop-user .aa-pwa-side-avatar--text {
        width: 30px;
        height: 30px;
        font-size: 13px;
        background: rgba(34, 54, 78, .1);
        border: 0;
        box-shadow: none;
    }

    .aa-pwa-app .aa-pwa-dtop-user-name {
        min-width: 0;
        max-width: 130px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .aa-pwa-app .aa-pwa-dtop-user-chev {
        flex: 0 0 auto;
        display: inline-flex;
        color: var(--aa-pwa-muted);
        transition: transform .18s ease;
    }

    .aa-pwa-app .aa-pwa-dtop-user[aria-expanded="true"] .aa-pwa-dtop-user-chev {
        transform: rotate(180deg);
    }

    .aa-pwa-app .aa-pwa-dtop-user-chev svg {
        width: 16px;
        height: 16px;
    }

    .aa-pwa-app .aa-pwa-dtop-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        z-index: 960;
        min-width: 200px;
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 6px;
        background: #fff;
        border: 1px solid var(--aa-pwa-border);
        border-radius: 14px;
        box-shadow: 0 12px 28px rgba(16, 24, 40, .16);
    }

    .aa-pwa-app .aa-pwa-dtop-menu[hidden] {
        display: none;
    }

    .aa-pwa-app .aa-pwa-dtop-menu-item {
        display: flex;
        align-items: center;
        gap: 9px;
        width: 100%;
        padding: 9px 10px;
        border: 0;
        border-radius: 9px;
        background: transparent;
        color: var(--aa-pwa-text);
        font-family: inherit;
        font-size: 13px;
        font-weight: 600;
        text-align: start;
        cursor: pointer;
        transition: background .15s ease, color .15s ease;
    }

    .aa-pwa-app .aa-pwa-dtop-menu-item:hover {
        background: rgba(34, 54, 78, .07);
        color: var(--aa-pwa-navy-1);
    }

    .aa-pwa-app .aa-pwa-dtop-menu-ic {
        display: inline-flex;
        flex: 0 0 auto;
        color: var(--aa-pwa-muted);
    }

    .aa-pwa-app .aa-pwa-dtop-menu-ic svg {
        width: 17px;
        height: 17px;
    }
}

/* ---------------- نوارهای دکمهٔ ثابت انتهای صفحه: چپ-پایین و کاملاً گرد ---------------- */
@media (min-width: 1024px) {
    /* بدون باکس: خود دکمه‌ها شناور و قرص‌شکل‌اند (هم‌استایل «ثبت خودرو»). */
    .aa-pwa-app .aa-pwa-wizard-nav,
    .aa-pwa-app .aa-pwa-savebar,
    .aa-pwa-app .aa-pwa-carview-bar {
        left: 28px;
        right: auto;
        bottom: 24px;
        width: auto;
        max-width: min(560px, calc(100% - 56px));
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .aa-pwa-app .aa-pwa-wizard-nav {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .aa-pwa-app .aa-pwa-wizard-nav .aa-pwa-btn,
    .aa-pwa-app .aa-pwa-wizard-nav .aa-pwa-btn-ghost,
    .aa-pwa-app .aa-pwa-savebar .aa-pwa-btn,
    .aa-pwa-app .aa-pwa-carview-bar .aa-pwa-carview-bar-btn {
        width: auto;
        min-width: 132px;
        min-height: 44px;
        padding: 0 20px;
        border: 0;
        border-radius: 999px;
        background: #f0a413;
        color: var(--aa-pwa-navy-1, #22364e);
        font-size: 13px;
        font-weight: 800;
        box-shadow: 0 8px 20px rgba(240, 164, 19, .32);
        transition: transform .15s ease, box-shadow .2s ease;
    }

    .aa-pwa-app .aa-pwa-wizard-nav .aa-pwa-btn:hover,
    .aa-pwa-app .aa-pwa-savebar .aa-pwa-btn:hover,
    .aa-pwa-app .aa-pwa-carview-bar .aa-pwa-carview-bar-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(240, 164, 19, .4);
    }

    .aa-pwa-app .aa-pwa-savebar .aa-pwa-btn {
        margin: 0;
        max-width: none;
    }

    .aa-pwa-app .aa-pwa-carview-bar .aa-pwa-carview-bar-btn--icon {
        min-width: 0;
        flex: 0 0 56px;
        padding: 0;
    }
}

/* ---------------- نمایش موبایلی محتوا (دکمهٔ تاپ‌هدر دسکتاپ) ---------------- */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-dtop-iconbtn {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid var(--aa-pwa-border);
        border-radius: 12px;
        background: #fff;
        color: var(--aa-pwa-navy-1);
        cursor: pointer;
        transition: background .18s ease, border-color .18s ease, color .18s ease;
    }

    .aa-pwa-app .aa-pwa-dtop-iconbtn:hover {
        background: #f7f8fa;
        border-color: rgba(34, 54, 78, .28);
    }

    .aa-pwa-app .aa-pwa-dtop-iconbtn.is-active,
    .aa-pwa-app .aa-pwa-dtop-iconbtn[aria-pressed="true"] {
        background: #f0a413;
        border-color: #f0a413;
        color: var(--aa-pwa-navy-1);
    }

    /* فقط ناحیهٔ محتوا به عرض گوشی درمی‌آید، از زیر تاپ‌هدر تا پایین صفحه ثابت می‌شود
       و خودِ محتوای داخلش اسکرول می‌خورد (بدون زمینه/قاب سفید). */
    .aa-pwa-app.is-mobile-content .aa-pwa-content {
        position: fixed;
        top: 84px;
        bottom: 16px;
        right: calc(248px + (100vw - 248px - 430px) / 2);
        left: auto;
        width: 430px;
        max-width: 430px;
        height: auto;
        margin: 0;
        padding: 14px 16px 24px;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }
}

/* ---------------- دکمهٔ باز/بست منوی سایدبار + جمع‌شدن منو ---------------- */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-dtop-burger {
        flex: 0 0 auto;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid var(--aa-pwa-border);
        border-radius: 12px;
        background: #fff;
        color: var(--aa-pwa-navy-1);
        cursor: pointer;
        transition: background .18s ease, border-color .18s ease;
    }

    .aa-pwa-app .aa-pwa-dtop-burger:hover {
        background: #f7f8fa;
        border-color: rgba(34, 54, 78, .28);
    }

    .aa-pwa-app .aa-pwa-dtop-burger span {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform .28s cubic-bezier(.4, 0, .2, 1), opacity .18s ease;
    }

    .aa-pwa-app .aa-pwa-dtop-burger span:nth-child(1) {
        transform-origin: center;
    }

    .aa-pwa-app .aa-pwa-dtop-burger span:nth-child(3) {
        transform-origin: center;
    }

    /* پیش‌فرض: منو باز است، پس آیکن ضربدر است. */
    .aa-pwa-app .aa-pwa-dtop-burger span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .aa-pwa-app .aa-pwa-dtop-burger span:nth-child(2) {
        opacity: 0;
        transform: scaleX(.3);
    }

    .aa-pwa-app .aa-pwa-dtop-burger span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    /* منو جمع شد: ضربدر به سه خط باز می‌شود. */
    .aa-pwa-app.is-side-collapsed .aa-pwa-dtop-burger span:nth-child(1),
    .aa-pwa-app.is-side-collapsed .aa-pwa-dtop-burger span:nth-child(3) {
        transform: none;
    }

    .aa-pwa-app.is-side-collapsed .aa-pwa-dtop-burger span:nth-child(2) {
        opacity: 1;
        transform: none;
    }

    .aa-pwa-app.is-side-collapsed .aa-pwa-nav {
        transform: translateX(100%);
    }

    .aa-pwa-app.is-side-collapsed .aa-pwa-content {
        margin-right: 0;
    }

    .aa-pwa-app.is-side-collapsed .aa-pwa-dtop {
        right: 0;
    }

    /* در حالت موبایلی محتوا هم ستون وسط کل صفحه دوباره وسط‌چین می‌شود. */
    .aa-pwa-app.is-side-collapsed.is-mobile-content .aa-pwa-content {
        right: calc((100vw - 430px) / 2);
    }
}

/* ---------------- بلور صفحه هنگام فوکوس روی جستجوی تاپ‌هدر ---------------- */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-dtop-veil {
        position: fixed;
        inset: 0;
        z-index: 890;
        background: rgba(247, 248, 250, .28);
        -webkit-backdrop-filter: blur(4px) saturate(.9);
        backdrop-filter: blur(4px) saturate(.9);
        cursor: default;
    }

    .aa-pwa-app .aa-pwa-dtop-veil[hidden] {
        display: none;
    }

    .aa-pwa-app .aa-pwa-dtop-search:focus-within {
        border-color: var(--aa-pwa-navy-1);
        box-shadow: 0 0 0 3px rgba(34, 54, 78, .12);
    }
}

/* ---------------- دسترسی سریع تاپ‌هدر: کاربران / خودروها / سایت ---------------- */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-dtop-quick {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 0 0 auto;
    }

    .aa-pwa-app .aa-pwa-dtop-quickbtn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 1px solid var(--aa-pwa-border);
        border-radius: 10px;
        background: #fff;
        color: var(--aa-pwa-muted);
        cursor: pointer;
        transition: background .16s ease, color .16s ease, border-color .16s ease;
    }

    .aa-pwa-app .aa-pwa-dtop-quickbtn svg {
        width: 17px;
        height: 17px;
    }

    .aa-pwa-app .aa-pwa-dtop-quickbtn:hover {
        background: #f7f8fa;
        color: var(--aa-pwa-navy-1);
        border-color: rgba(34, 54, 78, .28);
    }

    /* فشرده‌شدن ملایم هدر در عرض‌های متوسط تا همهٔ کنترل‌ها جا شوند. */
    .aa-pwa-app .aa-pwa-dtop-search {
        min-width: 140px;
    }

    @media (max-width: 1279px) {
        .aa-pwa-app .aa-pwa-dtop {
            gap: 10px;
        }

        .aa-pwa-app .aa-pwa-dtop-user-name {
            max-width: 96px;
        }
    }
}

/* «خروج» منوی کاربر: قرمز، با هاور قرمز ملایم */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-dtop-menu-item--danger,
    .aa-pwa-app .aa-pwa-dtop-menu-item--danger .aa-pwa-dtop-menu-ic {
        color: var(--aa-pwa-error);
    }

    .aa-pwa-app .aa-pwa-dtop-menu-item--danger:hover {
        background: rgba(214, 69, 69, .1);
        color: var(--aa-pwa-error);
    }
}

/* هم‌اندازه‌بودن دکمهٔ حالت موبایل و باکس کاربر با دکمه‌های دسترسی سریع */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-dtop-iconbtn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .aa-pwa-app .aa-pwa-dtop-iconbtn svg {
        width: 16px;
        height: 16px;
    }

    .aa-pwa-app .aa-pwa-dtop-user {
        height: 36px;
        padding: 0 8px;
        gap: 6px;
        border-radius: 10px;
        font-size: 12px;
    }

    .aa-pwa-app .aa-pwa-dtop-avatar,
    .aa-pwa-app .aa-pwa-dtop-user .aa-pwa-side-avatar--text {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .aa-pwa-app .aa-pwa-dtop-user-name {
        max-width: 104px;
    }

    .aa-pwa-app .aa-pwa-dtop-user-chev svg {
        width: 14px;
        height: 14px;
    }
}

/* هم‌اندازه‌کردن دکمهٔ منو و باکس جستجو با بقیهٔ کنترل‌های هدر */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-dtop {
        align-items: center;
    }

    .aa-pwa-app .aa-pwa-dtop-burger {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .aa-pwa-app .aa-pwa-dtop-search {
        height: 36px;
        border-radius: 10px;
    }

    .aa-pwa-app .aa-pwa-dtop-action {
        display: inline-flex;
        align-items: center;
        height: 36px;
    }
}


/* در دسکتاپ نوار لوگو مخفی و تاپ‌هدر ۶۸px است؛ نوار چسبان خودروها/برد
   باید زیر همان ۶۸px بچسبد، نه زیر ارتفاع نوار لوگوی موبایل. */
@media (min-width: 1024px) {
    .aa-pwa-app.has-brandbar.is-headerless .aa-pwa-cars-top,
    .aa-pwa-app.has-brandbar.is-headerless .aa-pwa-board-top,
    .aa-pwa-app.has-brandbar.is-headerless .aa-pwa-stepper-bar,
    .aa-pwa-app .aa-pwa-cars-top,
    .aa-pwa-app .aa-pwa-board-top {
        top: 68px;
    }
}

/* فاصلهٔ نوار جستجو/تب‌های خودروها از تاپ‌هدر: دقیقاً هم‌تراز اولین
   عنصر بقیهٔ صفحه‌ها (۹۶px از بالای ویوپورت). */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-cars-top,
    .aa-pwa-app .aa-pwa-board-top {
        margin-top: -2px;
    }
}

/* ---------------- صفحهٔ مشاهدهٔ خودرو: تصاویر راست، اطلاعات و تب‌ها چپ ---------------- */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-carview {
        display: grid;
        grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
        align-items: start;
        gap: 16px 20px;
    }

    .aa-pwa-app .aa-pwa-carview-media {
        grid-column: 1;
        position: sticky;
        top: 86px;
        min-width: 0;
    }

    .aa-pwa-app .aa-pwa-carview-info {
        grid-column: 2;
        min-width: 0;
    }

    .aa-pwa-app.is-headerless .aa-pwa-carview-media {
        top: 84px;
    }
}

/* ---------- مشاهدهٔ خودرو در دسکتاپ: دکمه‌های تماس/اشتراک زیر تصاویر ---------- */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-carview-media .aa-pwa-carview-bar {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        max-width: none;
        margin: 12px 0 0;
        padding: 0;
        gap: 10px;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .aa-pwa-app .aa-pwa-carview-media .aa-pwa-carview-bar .aa-pwa-carview-bar-btn {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        min-height: 44px;
        justify-content: center;
        border-radius: 999px;
    }
}

/* ---------- یکسان‌سازی قطعی باکس کاربر و دکمهٔ حالت موبایل ---------- */
/* هر دو کنترل در یک ردیف تاپ‌هدر باید دقیقاً هم‌ارتفاع و هم‌تراز باشند؛
   این قاعده در پایان فایل است تا بر تعریف‌های قبلی اولویت داشته باشد. */
@media (min-width: 1024px) {
    .aa-pwa-app .aa-pwa-dtop .aa-pwa-dtop-userwrap,
    .aa-pwa-app .aa-pwa-dtop .aa-pwa-dtop-user,
    .aa-pwa-app .aa-pwa-dtop .aa-pwa-dtop-iconbtn {
        align-self: center;
        height: 36px;
        min-height: 36px;
        max-height: 36px;
        box-sizing: border-box;
    }

    .aa-pwa-app .aa-pwa-dtop .aa-pwa-dtop-userwrap {
        display: flex;
        align-items: center;
    }

    .aa-pwa-app .aa-pwa-dtop .aa-pwa-dtop-user,
    .aa-pwa-app .aa-pwa-dtop .aa-pwa-dtop-iconbtn {
        border-radius: 10px;
    }

    .aa-pwa-app .aa-pwa-dtop .aa-pwa-dtop-user {
        padding: 0 8px;
        gap: 6px;
        font-size: 12px;
        line-height: 1;
    }

    .aa-pwa-app .aa-pwa-dtop .aa-pwa-dtop-user .aa-pwa-dtop-avatar,
    .aa-pwa-app .aa-pwa-dtop .aa-pwa-dtop-user .aa-pwa-side-avatar--text {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

/* ---------- اسکلتون‌ها: همان جانمایی و تعداد ستون‌های محتوای واقعی ---------- */
@media (min-width: 1024px) {
    /* فهرست خودروها/تیپ: کارت‌های اسکلت هم دو ستون در هر سطر. */
    .aa-pwa-app .aa-pwa-list.aa-pwa-carlist-grid > .aa-pwa-skel-stack {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .aa-pwa-app .aa-pwa-list.aa-pwa-carlist-grid > .aa-pwa-skel-stack > .aa-pwa-skel-card {
        height: 100%;
        margin-bottom: 0;
    }

    /* اسکلت بارگذاری صفحهٔ بعد (لود بیشتر) هم دو ستونه. */
    .aa-pwa-app .aa-pwa-carlist-grid > .aa-pwa-list-more > .aa-pwa-skel-stack {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .aa-pwa-app .aa-pwa-carlist-grid > .aa-pwa-list-more > .aa-pwa-skel-stack > .aa-pwa-skel-card {
        margin-bottom: 0;
    }

    /* تب‌های ربات/کانال/گروه: فهرست دو ستونه است و اسکلت هم باید دو ستونه باشد. */
    .aa-pwa-app .aa-pwa-card.is-plain .aa-pwa-list {
        align-items: stretch;
        grid-auto-rows: 1fr;
    }

    .aa-pwa-app .aa-pwa-card.is-plain .aa-pwa-list > .aa-pwa-skel-stack {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .aa-pwa-app .aa-pwa-card.is-plain .aa-pwa-list > .aa-pwa-skel-stack > .aa-pwa-skel-menu {
        height: 100%;
        padding: 12px;
        border: 1px solid var(--aa-pwa-border);
        border-radius: 12px;
        background: var(--aa-pwa-card);
    }

    /* کارت‌های کاربر ربات: حذف فاصلهٔ تکی و کشیده‌شدن تا ارتفاع سطر. */
    .aa-pwa-app .aa-pwa-card.is-plain .aa-pwa-list button.aa-pwa-botrow {
        height: 100%;
        margin-bottom: 0;
    }
}
