/* صفحات السلة — الدفع — الحساب — الطلبات — المفضلة (ألوان من style.css :root) */

.commerce-page {
    background: var(--bg);
}

.commerce-page .page-header {
    background: var(--hover) !important;
    border-color: var(--border) !important;
}

.commerce-card {
    background: var(--white_color);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.25rem 1.5rem;
}

.commerce-card h2,
.commerce-card .h5 {
    color: var(--text);
    font-weight: 800;
}

.commerce-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

/* جدول السلة */
.cart-table-wrap {
    overflow-x: auto;
}

.cart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 520px;
}

.cart-table th {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
    text-align: right;
}

.cart-table td {
    padding: 1rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.cart-product-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-product-cell img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--hover);
}

.cart-product-title {
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
}

.cart-product-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.qty-stepper button {
    width: 34px;
    height: 36px;
    border: none;
    background: var(--hover);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.qty-stepper button:hover {
    background: var(--accent_light);
    color: var(--accent);
}

.qty-stepper input {
    width: 40px;
    border: none;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--white_color);
}

.price-accent {
    font-weight: 800;
    color: var(--accent);
}

.btn-remove-line {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-remove-line:hover {
    color: var(--danger);
}

/* كوبون */
.coupon-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.coupon-row .form-control {
    max-width: 220px;
    border-radius: var(--radius-sm);
    border-color: var(--border);
}

.btn-accent {
    background: var(--accent);
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-outline-accent {
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.btn-outline-accent:hover {
    background: var(--accent_light);
    color: var(--accent-hover);
}

.applied-coupon-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent_light);
    color: var(--accent);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ملخص */
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.summary-row.total {
    border-top: 2px dashed var(--border);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.summary-row.total .price-accent {
    font-size: 1.25rem;
}

/* شحن */
.shipping-info-box {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--hover);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.shipping-info-box i {
    font-size: 1.5rem;
    color: var(--accent);
}

/* Checkout */
.payment-option {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.payment-option:hover {
    border-color: var(--accent);
}

.payment-option.is-selected,
.payment-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent_light);
}

.payment-option input {
    margin-top: 0.35rem;
}

.mock-pay-panel {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--hover);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.mock-pay-panel.is-visible {
    display: block;
}

/* Orders */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
}

.status-pending { background: #FEF3C7; color: #92400E; }
.status-processing { background: #DBEAFE; color: #1E40AF; }
.status-shipped { background: #E0E7FF; color: #3730A3; }
.status-delivered { background: #D1FAE5; color: #065F46; }
.status-cancelled { background: #FEE2E2; color: #991B1B; }

.orders-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.orders-toolbar .form-select,
.orders-toolbar .form-control {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    max-width: 220px;
}

.order-row-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--white_color);
    transition: box-shadow 0.2s;
}

.order-row-card:hover {
    box-shadow: var(--shadow-soft);
}

/* Profile */
.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--dark-bg);
    color: var(--dark-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
}

/* Wishlist grid */
.wishlist-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white_color);
    height: 100%;
}

.wishlist-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--hover);
}

.wishlist-card .body {
    padding: 1rem;
}

.wishlist-remove {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--white_color);
    box-shadow: var(--shadow-soft);
    color: var(--danger);
    cursor: pointer;
}

[dir="rtl"] .wishlist-remove {
    left: auto;
    right: 10px;
}

/* Order detail timeline */
.od-timeline {
    position: relative;
    padding-right: 1.5rem;
}

.od-timeline::before {
    content: "";
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.od-timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.od-timeline-item::before {
    content: "";
    position: absolute;
    right: -23px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--white_color);
}

.od-timeline-item.is-done::before {
    background: var(--success);
}

.od-timeline-item.is-current::before {
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent_light);
}

/* طباعة الفاتورة */
.invoice-print-area {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }
    .invoice-print-area,
    .invoice-print-area * {
        visibility: visible;
    }
    .invoice-print-area {
        display: block !important;
        position: absolute;
        right: 0;
        top: 0;
        width: 100%;
        padding: 1.5rem;
        background: #fff;
    }
}

.invoice-box {
    max-width: 720px;
    margin: 0 auto;
    font-size: 14px;
    color: #111;
}

.invoice-box h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.invoice-table th,
.invoice-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: right;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
}

.btn-dark-commerce {
    background: var(--dark-bg);
    color: var(--dark-text);
    border: none;
    font-weight: 700;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.5rem;
}

.btn-dark-commerce:hover {
    background: var(--dark-bg-2);
    color: var(--dark-text);
}

.commerce-textarea {
    min-height: 100px;
    border-radius: var(--radius-sm);
    border-color: var(--border);
}
