/* ============================================
   CHECKOUT PAGE
   ============================================ */

.checkout-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0 40px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

/* Steps */
.checkout-step {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid var(--border-color);
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.step-header h2 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.step-content {
    padding: 24px;
}

/* Addresses */
.addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.address-card {
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.address-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.address-card.selected {
    border-color: var(--primary-color);
    background: #fff5f7;
}

.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.address-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.address-body {
    margin-bottom: 16px;
}

.address-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.address-row .label {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 70px;
}

.address-row .value {
    color: var(--text-primary);
}

.address-actions {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* Shipping Methods */
.shipping-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shipping-card {
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.shipping-card:hover {
    border-color: var(--primary-color);
}

.shipping-card.active {
    border-color: var(--primary-color);
    background: #fff5f7;
}

.shipping-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.method-name {
    font-weight: 600;
    font-size: 15px;
}

.method-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

.free-shipping-note {
    font-size: 12px;
    color: var(--success-color);
    font-weight: 500;
}

.method-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.method-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Coupon */
.coupon-section,
.notes-section {
    margin-bottom: 20px;
}

.section-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.coupon-input-group {
    display: flex;
    gap: 10px;
}

.coupon-input-group input {
    flex: 1;
}

/* Sidebar */
.checkout-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.order-summary {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.summary-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg-secondary);
}

.summary-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.item-qty {
    font-size: 12px;
    color: var(--text-muted);
}

.item-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 14px;
}

/* Totals */
.summary-totals {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

.total-row.discount {
    color: var(--success-color);
}

.total-row.final {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    padding-top: 10px;
    border-top: 2px dashed var(--border-color);
}

.total-row.final span:last-child {
    color: var(--primary-color);
    font-size: 18px;
}

/* Payment Info */
.payment-methods-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.payment-methods-info .info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.payment-methods-info .info-item:last-child {
    margin-bottom: 0;
}

.payment-methods-info svg {
    color: var(--success-color);
}

/* Radio Custom */
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 1024px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    
    .checkout-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .addresses-grid {
        grid-template-columns: 1fr;
    }
    
    .coupon-input-group {
        flex-direction: column;
    }
    
    .summary-items {
        max-height: 200px;
    }
}
/* ============================================
PAYMENT PAGE STYLES
============================================ */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-method-card {
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.payment-method-card:hover {
    border-color: var(--primary-color);
}

.payment-method-card.selected {
    border-color: var(--primary-color);
    background: #fff5f7;
}

.payment-method-card .address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.payment-method-card .address-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.payment-method-card .address-body {
    margin-bottom: 0;
}

.payment-method-card .address-body p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Radio Custom for Payment */
.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
}

input[type="radio"]:checked + .radio-custom {
    border-color: var(--primary-color);
}

input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* Order Summary Sidebar */
.checkout-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.order-summary {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.summary-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg-secondary);
}

.summary-totals {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

.total-row.discount {
    color: var(--success-color);
}

.total-row.final {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    padding-top: 10px;
    border-top: 2px dashed var(--border-color);
}

.total-row.final span:last-child {
    color: var(--primary-color);
    font-size: 18px;
}

.payment-methods-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.payment-methods-info .info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.payment-methods-info .info-item:last-child {
    margin-bottom: 0;
}

.payment-methods-info svg {
    color: var(--success-color);
}

/* Layout */
.checkout-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0 40px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

.checkout-main {
    /* Main content area */
}

/* Responsive */
@media (max-width: 1024px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    
    .checkout-sidebar {
        position: static;
    }
}
/* ============================================
TRACK ORDER PAGE
پیگیری سفارش
============================================ */
.track-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 0 50px;
}

.track-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.track-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--bg-secondary);
}

.track-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.track-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.track-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #fef2f4 0%, #ffe5e8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.track-form {
    max-width: 500px;
    margin: 0 auto 32px;
}

.track-form .form-control {
    text-align: center;
    font-size: 16px;
    letter-spacing: 1px;
    direction: ltr;
}

.track-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 24px;
}

.track-info h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.track-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.track-info li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.track-info li:last-child {
    border-bottom: none;
}

.track-info li strong {
    color: var(--text-primary);
    font-size: 14px;
}

.track-info li span {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

/* Order Progress */
.order-progress {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow-x: auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 80px;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

.progress-step.completed .step-icon {
    background: var(--success-color);
    border-color: var(--success-color);
}

.progress-step.active .step-icon {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.progress-step.completed .step-label,
.progress-step.active .step-label {
    color: var(--text-primary);
}

.progress-line {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    margin: 0 8px;
    margin-bottom: 30px;
    min-width: 30px;
    transition: all 0.3s;
}

.progress-line.completed {
    background: var(--success-color);
}

/* Current Status */
.current-status-card {
    background: linear-gradient(135deg, #fef2f4 0%, #ffe5e8 100%);
    border: 2px solid #ffe5e8;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.status-badge-large {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 16px;
}

.status-pending { background: #fff3cd; color: #f57c00; }
.status-processing { background: #dbeafe; color: #1565c0; }
.status-shipped { background: #f3e5f5; color: #7b1fa2; }
.status-delivered { background: #d1fae5; color: #059669; }
.status-cancelled { background: #fee2e2; color: #dc2626; }
.status-refunded { background: #fce4ec; color: #ad1457; }

.tracking-code {
    font-size: 14px;
    color: var(--text-secondary);
}

.tracking-code strong {
    color: var(--text-primary);
}

.tracking-code span {
    background: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    margin-right: 8px;
    font-weight: 600;
}

/* Track Details Grid */
.track-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.track-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.track-section .section-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

/* Track Items */
.track-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.track-item {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 16px;
    padding: 14px;
    background: white;
    border-radius: var(--radius-md);
    align-items: center;
}

.track-item .item-image {
    width: 70px;
    height: 70px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-item .no-image {
    font-size: 24px;
}

.track-item .item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.track-item .item-sku,
.track-item .item-qty {
    font-size: 12px;
    color: var(--text-secondary);
}

.track-item .item-price {
    text-align: left;
    min-width: 120px;
}

.track-item .unit-price {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.track-item .total-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Price Summary */
.price-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

.price-row.discount {
    color: var(--success-color);
}

.price-row.total {
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px dashed var(--border-color);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.price-row.total span:last-child {
    color: var(--primary-color);
}

/* Payment Status */
.payment-status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

.badge-warning { background: #fff3cd; color: #f57c00; }
.badge-success { background: #d1fae5; color: #059669; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #dbeafe; color: #2563eb; }

.payments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.payment-item {
    background: white;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.payment-gateway {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.payment-amount {
    color: var(--primary-color);
    font-weight: 700;
    margin: 4px 0;
}

.payment-date {
    color: var(--text-muted);
    font-size: 12px;
}

/* Shipping Info */
.shipping-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shipping-info .info-row {
    display: flex;
    gap: 12px;
    font-size: 14px;
}

.shipping-info .label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
}

.shipping-info .value {
    color: var(--text-primary);
    flex: 1;
}

/* Timeline */
.timeline {
    position: relative;
    padding-right: 20px;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
    padding-right: 30px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    right: 0;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--border-color);
}

.timeline-dot.success {
    background: var(--success-color);
    box-shadow: 0 0 0 2px var(--success-color);
}

.timeline-content {
    background: white;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
}

.timeline-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Track Actions */
.track-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .track-container {
        padding: 20px;
    }
    
    .track-details-grid {
        grid-template-columns: 1fr;
    }
    
    .track-item {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
    }
    
    .track-item .item-image {
        width: 60px;
        height: 60px;
        grid-row: span 2;
    }
    
    .track-item .item-price {
        grid-column: 2;
        text-align: right;
    }
    
    .order-progress {
        padding: 16px 8px;
    }
    
    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .step-label {
        font-size: 10px;
    }
    
    .track-actions {
        flex-direction: column;
    }
    
    .track-actions .btn {
        width: 100%;
    }
}