/* ============================================
   📦 سفارش‌های کاربر - user-orders.css
   تم مدرن سورمه‌ای و نقره‌ای
   ============================================ */

/* ==========================================
   🎨 متغیرهای رنگ مدرن
========================================== */
:root {
    --primary: #1a1a2e;
    --primary-light: #2d2d44;
    --primary-dark: #0f0f1a;
    --silver: #c0c0c0;
    --silver-light: #e8e8e8;
    --silver-dark: #a0a0a0;
    --bg-body: #f0f2f5;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6b6b80;
    --text-muted: #9999aa;
    --shadow-sm: 0 2px 12px rgba(26, 26, 46, 0.06);
    --shadow-md: 0 4px 24px rgba(26, 26, 46, 0.08);
    --shadow-lg: 0 8px 40px rgba(26, 26, 46, 0.12);
    --shadow-xl: 0 12px 60px rgba(26, 26, 46, 0.16);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   🍞 Breadcrumb مدرن
========================================== */
.breadcrumb-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-white);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(26, 26, 46, 0.04);
}

.breadcrumb-custom li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-custom li a:hover {
    color: var(--primary);
    transform: translateX(-2px);
}

.breadcrumb-custom .separator {
    color: var(--text-muted);
    opacity: 0.3;
}

.breadcrumb-custom .active {
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================
   📋 هدر صفحه مدرن
========================================== */
.page-header-orders {
    margin-bottom: 32px;
    background: var(--bg-white);
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(26, 26, 46, 0.04);
    position: relative;
    overflow: hidden;
}

.page-header-orders::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--silver));
    border-radius: 0 4px 4px 0;
}

.page-header-orders h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header-orders h1 .text-primary {
    color: var(--primary);
}

.page-header-orders p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

/* ==========================================
   📊 آمار سفارش‌ها مدرن
========================================== */
.orders-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-item {
    background: var(--bg-white);
    border: 1px solid rgba(26, 26, 46, 0.06);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--silver));
    opacity: 0;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(26, 26, 46, 0.12);
}

.stat-item:hover::after {
    opacity: 1;
}

.stat-item .stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    display: block;
    line-height: 1.2;
}

.stat-item .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ==========================================
   🔍 فیلترها مدرن
========================================== */
.orders-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.orders-filters select,
.orders-filters input {
    padding: 12px 18px;
    border: 2px solid rgba(26, 26, 46, 0.08);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.orders-filters select:focus,
.orders-filters input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 26, 46, 0.06);
    transform: translateY(-1px);
}

.orders-filters select {
    min-width: 180px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a1a2e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    padding-left: 40px;
}

.orders-filters input {
    flex: 1;
    min-width: 220px;
}

.orders-filters input::placeholder {
    color: var(--text-muted);
}

/* ==========================================
   📋 لیست سفارش‌ها مدرن
========================================== */
.orders-list-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(26, 26, 46, 0.04);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

/* ===== کارت سفارش مدرن ===== */
.order-card {
    background: var(--bg-white);
    border: 1px solid rgba(26, 26, 46, 0.06);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
    position: relative;
}

.order-card:last-child {
    margin-bottom: 0;
}

.order-card:hover {
    border-color: rgba(192, 192, 192, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ===== هدر کارت ===== */
.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 2px solid rgba(26, 26, 46, 0.04);
    flex-wrap: wrap;
    gap: 10px;
}

.order-card-header .order-id {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-card-header .order-id span {
    color: var(--text-muted);
    font-weight: 400;
}

.order-card-header .order-date {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== وضعیت مدرن ===== */
.order-status {
    padding: 5px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
    transition: var(--transition);
}

.status-pending {
    background: rgba(255, 165, 0, 0.12);
    color: #e67e22;
}

.status-processing {
    background: rgba(52, 152, 219, 0.12);
    color: #2980b9;
}

.status-shipped {
    background: rgba(46, 204, 113, 0.12);
    color: #27ae60;
}

.status-delivered {
    background: rgba(46, 204, 113, 0.18);
    color: #1e8449;
}

.status-cancelled {
    background: rgba(231, 76, 60, 0.12);
    color: #c0392b;
}

/* ===== آیتم‌های سفارش مدرن ===== */
.order-items-list {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-item-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 0;
    transition: var(--transition);
}

.order-item-row:hover {
    background: rgba(26, 26, 46, 0.02);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    margin: 0 -12px;
}

.order-item-row img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(26, 26, 46, 0.06);
    background: var(--bg-body);
    transition: var(--transition);
}

.order-item-row:hover img {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.order-item-row .item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.order-item-row .item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.order-item-row .item-quantity {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 2px 12px;
    border-radius: 20px;
}

/* ===== مجموع مدرن ===== */
.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 2px solid rgba(26, 26, 46, 0.04);
    flex-wrap: wrap;
    gap: 10px;
}

.order-card-footer .order-total-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.order-card-footer .order-total-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.tracking-code {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 4px 14px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================
   🆕 دکمه‌های مدرن و جذاب
========================================== */

/* دکمه مشاهده جزئیات - مدرن */
.btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 50px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: left 0.4s ease;
    z-index: 0;
}

.btn-detail:hover::before {
    left: 0;
}

.btn-detail:hover {
    color: var(--silver-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 26, 46, 0.15);
}

.btn-detail i,
.btn-detail span {
    position: relative;
    z-index: 1;
}

/* دکمه ثبت سفارش جدید - مدرن با افکت */
.btn-create-order {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--silver-light);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(26, 26, 46, 0.15);
}

.btn-create-order::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(192, 192, 192, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.btn-create-order:hover::after {
    opacity: 1;
}

.btn-create-order:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(26, 26, 46, 0.25);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-create-order:active {
    transform: scale(0.97);
}

.btn-create-order .badge {
    background: var(--silver);
    color: var(--primary);
    padding: 2px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    transition: var(--transition);
}

.btn-create-order:hover .badge {
    background: var(--silver-light);
}

/* دکمه مشاهده سبد خرید - مدرن */
.btn-view-cart {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(26, 26, 46, 0.12);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-view-cart:hover {
    border-color: var(--primary);
    background: rgba(26, 26, 46, 0.04);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-view-cart i {
    font-size: 16px;
    transition: var(--transition);
}

.btn-view-cart:hover i {
    transform: scale(1.1) rotate(-5deg);
}

/* دکمه تسویه حساب - مدرن با افکت موج */
.btn-checkout {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--silver-light);
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    justify-content: center;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(26, 26, 46, 0.2);
}

.btn-checkout::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(192, 192, 192, 0.1), transparent);
    transition: left 0.6s ease;
}

.btn-checkout:hover::before {
    left: 100%;
}

.btn-checkout:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(26, 26, 46, 0.3);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-checkout:active {
    transform: scale(0.97);
}

.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* دکمه خرید در حالت خالی - مدرن */
.btn-shop-now {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--silver-light);
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(26, 26, 46, 0.15);
}

.btn-shop-now::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(192, 192, 192, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.btn-shop-now:hover::after {
    opacity: 1;
}

.btn-shop-now:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 35px rgba(26, 26, 46, 0.25);
}

/* ==========================================
   🔄 لودینگ مدرن
========================================== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.loading-spinner .spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(26, 26, 46, 0.06);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   📭 حالت خالی مدرن
========================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
    color: var(--primary);
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 24px 0;
}

/* ==========================================
   📋 سبد خرید در صفحه تسویه مدرن
========================================== */
.checkout-summary {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(26, 26, 46, 0.06);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.checkout-summary .summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(26, 26, 46, 0.04);
}

.checkout-summary .summary-item:last-child {
    border-bottom: none;
}

.checkout-summary .summary-total {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    padding-top: 14px;
    margin-top: 10px;
    border-top: 2px solid rgba(26, 26, 46, 0.08);
}

/* ==========================================
   🎯 دکمه‌های اقدامات
========================================== */
.orders-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ==========================================
   📱 ریسپانسیو مدرن
========================================== */
@media (max-width: 768px) {
    .orders-stats {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
    }
    
    .stat-item {
        padding: 16px;
    }
    
    .stat-item .stat-number {
        font-size: 22px;
    }
    
    .order-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .order-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .orders-filters {
        flex-direction: column;
    }
    
    .orders-filters select,
    .orders-filters input {
        width: 100%;
    }
    
    .btn-create-order,
    .btn-view-cart {
        width: 100%;
        justify-content: center;
    }
    
    .page-header-orders {
        padding: 20px;
    }
    
    .page-header-orders h1 {
        font-size: 22px;
    }
    
    .orders-list-wrapper {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .orders-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-item .stat-number {
        font-size: 18px;
    }
    
    .order-item-row img {
        width: 40px;
        height: 40px;
    }
    
    .order-item-row .item-name {
        font-size: 13px;
    }
    
    .btn-checkout {
        font-size: 14px;
        padding: 14px 30px;
    }
    
    .order-card {
        padding: 16px;
    }
}

/* ==========================================
   🎨 دارک مود مدرن
========================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0f0f1a;
        --bg-white: #1a1a2e;
        --bg-card: #1a1a2e;
        --text-primary: #e8e8e8;
        --text-secondary: #aaaac0;
        --text-muted: #77778a;
        --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
        --shadow-xl: 0 12px 60px rgba(0, 0, 0, 0.6);
    }

    .orders-list-wrapper,
    .order-card,
    .stat-item,
    .checkout-summary,
    .page-header-orders,
    .breadcrumb-custom {
        background: var(--bg-card);
        border-color: rgba(255, 255, 255, 0.06);
    }

    .page-header-orders::before {
        background: linear-gradient(180deg, var(--silver), var(--primary-light));
    }

    .stat-item .stat-number {
        color: var(--silver-light);
    }

    .order-card:hover {
        border-color: rgba(192, 192, 192, 0.2);
    }

    .order-item-row .item-name {
        color: var(--text-primary);
    }

    .order-item-row .item-price {
        color: var(--silver-light);
    }

    .order-card-footer .order-total-price {
        color: var(--silver-light);
    }

    .orders-filters select,
    .orders-filters input {
        background: var(--bg-card);
        border-color: rgba(255, 255, 255, 0.08);
        color: var(--text-primary);
    }

    .orders-filters select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c0c0c0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    }

    .btn-detail {
        color: var(--silver-light);
        border-color: rgba(192, 192, 192, 0.3);
    }

    .btn-detail::before {
        background: linear-gradient(90deg, var(--primary-light), var(--primary));
    }

    .btn-detail:hover {
        color: var(--silver-light);
    }

    .btn-view-cart {
        color: var(--silver-light);
        border-color: rgba(192, 192, 192, 0.2);
    }

    .btn-view-cart:hover {
        background: rgba(192, 192, 192, 0.05);
        border-color: var(--silver);
    }

    .order-item-row:hover {
        background: rgba(255, 255, 255, 0.02);
    }

    .empty-state h3 {
        color: var(--text-primary);
    }

    .checkout-summary .summary-total {
        color: var(--silver-light);
        border-color: rgba(192, 192, 192, 0.15);
    }

    .tracking-code {
        background: rgba(255, 255, 255, 0.04);
    }

    .order-item-row .item-quantity {
        background: rgba(255, 255, 255, 0.04);
    }

    .order-card-header .order-id {
        color: var(--text-primary);
    }

    .order-card-header .order-date {
        color: var(--text-muted);
    }
}

/* ==========================================
   🆕 استایل نوع محصول
   ========================================== */
.order-type-badge {
    padding: 6px 16px;
    margin: 0 20px 10px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    border-right: 3px solid #D4AF37;
    display: inline-block;
}

.order-type-badge .type-label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

/* در کارت سفارش */
.order-card .order-item-detail {
    color: #6c757d;
    font-size: 13px;
    padding: 2px 8px;
    background: #f8f9fa;
    border-radius: 4px;
}