/* =====================================================================
   ریسپانسیو داشبورد کاربر
   بریک‌پوینت‌ها هماهنگ با بقیه سایت: 1200 / 1024 / 768 / 576 / 430 / 360
   این فایل بعد از style.css لود میشه تا بتونه override کنه.

   استراتژی ساید‌بار: تو دسکتاپ ثابت و عمودیه. از 1024 به پایین به یه
   بخش بالای صفحه تبدیل میشه: بالا اطلاعات کاربر، پایینش منوی داشبورد
   به‌صورت یه لیست تمام‌عرض (ردیف به ردیف با آیکون + عنوان + فلش) —
   شبیه لیست منوی حساب کاربری دیجی‌کالا تو موبایل.
===================================================================== */

/* دکمه همبرگری فقط تو حالت موبایل/تبلت (زیر 1024) دیده میشه */
.menu-toggle {
    display: none;
}

.user-box-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =========================================================
   1200px
========================================================= */
@media (max-width:1200px) {

    .content {
        padding: 28px;
    }

    .card {
        width: calc(33.333% - 14px);
        min-width: 230px;
    }

    .profile-card,
    .invoice-card {
        max-width: 100%;
    }
}


/* =========================================================
   1024px — ساید‌بار به بخش بالای صفحه تبدیل میشه
========================================================= */
@media (max-width:1024px) {

    .dashboard {
        flex-direction: column;
        min-height: unset;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        position: relative;
        border-left: none;
        border-bottom: 1px solid #E5E7EB;
        overflow: visible;
    }

    /* هدر موبایل: همبرگری راست، اطلاعات کاربر چپ */
    .user-box {
        margin: 0;
        padding: 14px 16px;
        justify-content: space-between;
        gap: 0;
    }

    .user-box-info {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: none;
        background: #f5f7fb;
        border-radius: 8px;
        color: #333;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
    }

    .user-box-svg {
        padding: 6px;
    }

    .user-box-svg__svg {
        width: 17px;
        height: 17px;
    }

    #userName {
        font-size: 15px;
        width: auto;
    }

    /* دیگه لازم نیست، لیست دراپ‌داون خودش جداکننده داره */
    .dashboard-line {
        display: none;
    }

    .content {
        padding: 20px;
    }

    .btn-home {
        display: none;
    }

    /* -------- منوی داشبورد: دراپ‌داون زیر هدر، پیش‌فرض بسته -------- */
    .dashboard-ul {
        display: flex;
        flex-direction: column;
        padding: 0;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: #fff;
        box-shadow: 0 12px 24px rgba(0, 0, 0, .1);
        max-height: 0;
        overflow: hidden;
        transition: max-height .28s ease;
        z-index: 40;
    }

    .dashboard-ul.open {
        max-height: 70vh;
        overflow-y: auto;
        border-top: 1px solid #f0f0f0;
    }

    .dashboard-ul__item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
        height: auto;
        margin-bottom: 0;
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
        background: #fff;
        font-size: 14px;
        position: relative;
    }

    .dashboard-ul__item:last-child {
        border-bottom: none;
    }

    .dashboard-ul__item svg {
        width: 19px;
        height: 19px;
        color: #6b7280;
        flex-shrink: 0;
    }

    /* فلش سمت چپ هر ردیف، بدون نیاز به تغییر HTML */
    .dashboard-ul__item::after {
        content: "›";
        margin-right: auto;
        font-size: 20px;
        line-height: 1;
        color: #cbd5e1;
    }

    .sidebar .active {
        background-color: #fafafa;
        border-radius: 0;
    }

    .active {
        height: auto;
    }

    #logout svg {
        color: #ef4444;
    }

    .menu-toggle.active {
        background: #eef0f3;
    }

    .menu-toggle.active .icon-menu {
        display: none !important;
    }

    .menu-toggle.active .icon-close {
        display: block !important;
    }

    /* -------- کارت‌های آمار سفارش (خلاصه داشبورد) -------- */
    .cards {
        gap: 14px;
    }

    .card {
        width: 100%;
    }

    /* آخرین سفارش */
    #lastOrderBox {
        width: 100%;
        height: auto;
    }

    .last-order-card {
        width: 100%;
        height: auto;
    }

    /* لیست سفارش‌ها */
    .order-filter__wraper {
        height: auto;
        padding: 20px 20px 15px 20px;
    }

    .orders-filter {
        position: static;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .filter-btn {
        margin-top: 0;
        padding: 8px 12px 12px 12px;
        font-size: 13px;
    }

    .order-wrapper {
        height: auto;
        padding: 15px;
    }

    .order-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .order-a {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        height: auto;
    }

    .order-products-images {
        flex-wrap: wrap;
    }

    /* گرید‌های دو ستونه به تک‌ستونه */
    .profile-info,
    .order-details-info,
    .order-info,
    .invoice-meta {
        grid-template-columns: 1fr;
    }

    .invoice-card,
    .order-details-card {
        padding: 20px;
    }

    .invoice-header,
    .order-details-top {
        flex-wrap: wrap;
        gap: 12px;
    }

    /* جدول فاکتور: اسکرول افقی بدون نیاز به تغییر HTML */
    .invoice-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .edit-modal {
        width: 90%;
        max-width: 420px;
        padding: 22px;
    }
}


/* =========================================================
   768px — چیدمان کارت‌های آمار سفارش شبیه صفحه حساب کاربری
   دیجی‌کالا: آیکون بالا، شمارنده کنار آیکون، عنوان پایین
========================================================= */
@media (max-width:768px) {

    .cards {
        display: flex;
        gap: 8px;
    }

    .card {
        flex: 1;
        min-width: 0;
        height: 104px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px 6px;
        text-align: center;
    }

    .cart-svg {
        width: 42px;
        height: 42px;
    }

    .cart-content {
        align-items: center;
        gap: 2px;
    }

    .cart-content h3 {
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
    }

    .cart-content p {
        display: none;
    }

    .card span.dashboard-cards__number {
        position: absolute;
        top: 10px;
        right: calc(50% - 34px);
        left: auto;
        width: 16px;
        height: 16px;
        font-size: 9px;
    }

    /* هدر «سفارش‌های من» با آندرلاین کوتاه، شبیه رفرنس */
    .last-order {
        border: none;
        border-top: 1px solid #E5E7EB;
        border-radius: 0;
        padding: 20px 0;
        margin-top: 10px;

        border-radius: 8px;
        padding: 25px;
    }

    .last-order__title h2 {
        position: relative;
        padding-bottom: 10px;
        font-size: 15px;
    }

    .last-order__title h2::after {
        /* content: "";
        position: absolute;
        bottom: 0;
        right: 0;
        width: 34px;
        height: 3px;
        background: #ff4757;
        border-radius: 2px; */
    }
}


/* =========================================================
   576px
========================================================= */
@media (max-width:576px) {

    .content {
        padding: 16px;
    }

    .user-box {
        padding: 16px;
        gap: 8px;
    }

    #userName {
        font-size: 14px;
    }

    .dashboard-ul__item {
        padding: 14px 16px;
        font-size: 13px;
    }

    .dashboard-ul__item svg {
        width: 18px;
        height: 18px;
    }

    .dashboard-ul__item::after {
        font-size: 18px;
    }

    /* کارت‌های آمار سفارش */
    .card {
        height: 92px;
        padding: 10px 4px;
        gap: 6px;
    }

    .cart-svg {
        width: 36px;
        height: 36px;
    }

    .cart-content h3 {
        font-size: 11px;
    }

    .card span.dashboard-cards__number {
        right: calc(50% - 28px);
    }

    /* سفارش‌ها */
    .order-filter__wraper h2 {
        font-size: 15px;
    }

    .order-dtail {
        flex-wrap: wrap;
        gap: 8px;
    }

    .order-product-image {
        width: 60px;
        height: 60px;
    }

    .order-a {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* فاکتور و جزئیات سفارش */
    .invoice-card,
    .order-details-card,
    .profile-card,
    .favorites-list-card,
    .favorites-header-card {
        padding: 16px;
    }

    .order-details-top h2,
    .invoice-header h2 {
        font-size: 18px;
    }

    .product-row {
        padding: 14px;
    }

    .product-row img {
        width: 70px;
        height: 70px;
    }

    /* پروفایل */
    .avatar {
        width: 90px;
        height: 90px;
    }

    .info-item {
        padding: 14px;
    }

    /* علاقه‌مندی‌ها */
    .favorites-grid {
        /* grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); */
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));

        gap: 12px;
    }

    .favorite-card-image {
        height: 130px;
    }

    .favorites-pagination {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .edit-modal {
        width: 92%;
        padding: 18px;
    }
}


/* =========================================================
   430px
========================================================= */
@media (max-width:430px) {

    .cards {
        gap: 8px;
    }

    .cart-content p {
        font-size: 11px;
    }

    .last-order h2 {
        font-size: 15px;
    }

    .order-row {
        padding: 15px 0;
    }

    .order-id {
        font-size: 16px;
    }

    .order-price {
        font-size: 14px;
    }

    .filter-btn {
        font-size: 12px;
        padding: 6px 10px 10px 10px;
    }

    .dashboard-ul__item {
        padding: 13px 14px;
    }

    .invoice-meta {
        grid-template-columns: 1fr;
    }

    .invoice-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .favorites-grid {
        /* grid-template-columns: repeat(2, 1fr); */
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));

    }

    .favorites-sort {
        gap: 10px;
        flex-wrap: wrap;
    }

    .info-item {
        flex-direction: row;
        align-items: center;
    }

    .info-wraper span {
        font-size: 12px;
    }
}


/* =========================================================
   360px
========================================================= */
@media (max-width:360px) {

    .content {
        padding: 12px;
    }

    .user-box {
        padding: 12px;
    }

    .user-box-svg {
        padding: 6px;
    }

    .dashboard-ul__item {
        padding: 12px 12px;
        font-size: 12px;
        gap: 10px;
    }

    .dashboard-ul__item::after {
        font-size: 16px;
    }

    .card {
        padding: 8px 4px;
    }

    .cart-svg {
        width: 32px;
        height: 32px;
    }

    .cart-svg svg {
        width: 18px;
        height: 18px;
    }

    .order-product-image {
        width: 50px;
        height: 50px;
    }

    .invoice-card,
    .order-details-card,
    .profile-card,
    .favorites-list-card,
    .favorites-header-card {
        padding: 12px;
    }

    .avatar {
        width: 75px;
        height: 75px;
        border-width: 3px;
    }

    .favorites-grid {
        /* grid-template-columns: 1fr 1fr; */
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));

        gap: 8px;
    }

    .fav-add-cart-btn,
    .fav-remove-btn {
        height: 36px;
        font-size: 12px;
    }

    .edit-modal {
        padding: 14px;
    }

    .modal-buttons button {
        padding: 10px;
        font-size: 13px;
    }
}