﻿/* ============================================================ */
/* Checkout Page                                                 */
/* ============================================================ */

.checkout-page {
    padding: 20px 0 60px;
}

/* Pre-invoice header */
.preinvoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1a2233 0%, #2d3e5c 100%);
    color: #fff;
    padding: 16px 22px;
    border-radius: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.preinvoice-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.preinvoice-number,
.preinvoice-expire {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

    .preinvoice-number i {
        color: #ffd966;
    }

    .preinvoice-expire i {
        color: #ffd966;
    }

.countdown {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
    color: #ffd966;
}

    .countdown.warning {
        color: #f87171;
        background: rgba(248, 113, 113, 0.15);
    }

.preinvoice-header .btn-outline-secondary {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

    .preinvoice-header .btn-outline-secondary:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        border-color: rgba(255, 255, 255, 0.5);
    }

/* Layout */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

.checkout-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.checkout-sidebar {
    position: sticky;
    top: 20px;
}

/* Section */
.checkout-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 16px;
    color: #1a2233;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

    .section-title i {
        color: var(--color-primary);
    }

/* Order items */
.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-item-row {
    display: grid;
    grid-template-columns: 50px 1fr 120px;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
}

    .order-item-row:last-child {
        border-bottom: none;
    }

.order-item-image {
    width: 50px;
    height: 65px;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
}

    .order-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.order-item-title {
    font-size: 14px;
    color: #1a2233;
    font-weight: 500;
    text-decoration: none;
    display: block;
}

    .order-item-title:hover {
        color: var(--color-primary);
    }

.order-item-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.order-item-price {
    font-size: 14px;
    color: #dc2626;
    font-weight: 600;
    text-align: left;
}

/* Address display */
.address-display {
    font-size: 14px;
    color: #1a2233;
    line-height: 1.8;
}

    .address-display .address-name {
        font-weight: 600;
        margin-bottom: 4px;
    }

    .address-display .address-phone {
        font-size: 13px;
        color: #64748b;
        margin-bottom: 6px;
        display: block;
    }

    .address-display .address-text {
        color: #475569;
    }

/* Delivery display */
.delivery-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #1a2233;
    padding: 10px 14px;
    background: #f8f9fb;
    border-radius: 8px;
}

.delivery-days {
    font-size: 12px;
    color: #64748b;
}

/* Payment options */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.payment-option {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

    .payment-option:hover {
        border-color: #cbd5e1;
        background: #f8f9fb;
    }

    .payment-option.selected,
    .payment-option:has(input:checked) {
        border-color: var(--color-primary);
        background: rgba(212, 160, 23, 0.05);
    }

    .payment-option input {
        margin-top: 4px;
        accent-color: var(--color-primary);
    }

.payment-content {
    flex: 1;
}

.payment-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .payment-head i {
        color: var(--color-primary);
        font-size: 18px;
    }

.payment-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a2233;
}

.payment-desc {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

/* Bank info */
.bank-info-box {
    font-family: var(--font-primary);
    margin-top: 16px;
    padding: 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
}

.bank-info-title {
    font-family: var(--font-heading);
    font-size: 14px;
    color: #92400e;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bank-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bank-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 6px;
}

    .bank-info-row span {
        color: #92400e;
        min-width: 90px;
    }

    .bank-info-row strong {
        color: #1a2233;
        font-family: var(--font-primary), 'Courier New', monospace;
        letter-spacing: 1px;
        flex: 1;
    }
        .bank-info-row strong.bank-info-text {
            font-family: var(--font-primary);
            letter-spacing: normal;
        }
.btn-copy {
    background: none;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

    .btn-copy:hover {
        background: #fde68a;
    }

/* Tracking code */
.tracking-code-box {
    margin-top: 16px;
    padding: 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
}

    .tracking-code-box .form-label {
        font-size: 13px;
        color: #075985;
        font-weight: 600;
    }

/* Summary (reuse cart summary) */
.cart-summary {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cart-summary-title {
    font-family: var(--font-heading);
    font-size: 18px;
    color: #1a2233;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-primary);
    font-size: 14px;
    color: #475569;
}

.row-value {
    font-weight: 500;
    color: #1a2233;
}

.summary-discount .row-value,
.summary-wallet .row-value {
    color: #16a34a;
}

.summary-divider {
    border: none;
    border-top: 1px dashed #cbd5e1;
    margin: 12px 0;
}

.summary-total {
    font-size: 16px;
}

    .summary-total .row-label {
        font-weight: bold;
        color: #1a2233;
    }

    .summary-total .total-value {
        font-size: 20px;
        color: #dc2626;
    }

        .summary-total .total-value small {
            font-size: 12px;
            color: #64748b;
            font-weight: normal;
        }

.coupon-code-applied {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-right: 6px;
}

/* Checkout button */
.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 12px;
    cursor: pointer;
}

    .btn-checkout:hover:not(:disabled) {
        background: var(--color-primary-hover, #b8890f);
        color: #fff;
        transform: translateY(-2px);
    }

    .btn-checkout:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.summary-note {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

    .summary-note i {
        color: #16a34a;
    }

/* ═══════════════════════════════════════════════════════ */
/* Success Page                                           */
/* ═══════════════════════════════════════════════════════ */
.checkout-success-page {
    max-width: 800px;
    margin: 40px auto;
    text-align: center;
}

.success-icon {
    font-size: 80px;
    color: #16a34a;
    margin-bottom: 20px;
}

    .success-icon i {
        animation: pop 0.5s ease-out;
    }

@keyframes pop {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.checkout-success-page h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    color: #1a2233;
    margin: 0 0 8px;
}

.success-subtitle {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 24px;
}

.order-status-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 10px;
    border-right: 4px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    text-align: right;
}

.status-icon {
    font-size: 32px;
}

.status-title {
    font-size: 16px;
    font-weight: bold;
    color: #1a2233;
}

.status-time {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.order-detail-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    text-align: right;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

    .order-detail-section h3 {
        font-family: var(--font-heading);
        font-size: 15px;
        color: #1a2233;
        margin: 0 0 14px;
        padding-bottom: 8px;
        border-bottom: 1px solid #e5e7eb;
    }

.order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    font-size: 14px;
}

    .order-info-grid > div {
        color: #1a2233;
    }

    .order-info-grid span {
        color: #64748b;
        margin-left: 6px;
    }

    .order-info-grid .full-width {
        grid-column: 1 / -1;
    }

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 992px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-sidebar {
        position: static;
    }
}

@media (max-width: 600px) {
    .order-info-grid {
        grid-template-columns: 1fr;
    }

    .order-item-row {
        grid-template-columns: 40px 1fr;
    }

    .order-item-price {
        grid-column: 2 / 3;
        text-align: right;
    }

    .success-actions {
        flex-direction: column;
    }

        .success-actions .btn {
            width: 100%;
        }

    .preinvoice-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .preinvoice-info {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════════════════════ */
/* Invoice Items Table                                    */
/* ═══════════════════════════════════════════════════════ */
.invoice-items-table {
    overflow-x: auto;
}

.invoice-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 13px;
    font-family: var(--font-primary);
}

    .invoice-table thead {
        background: #f8f9fb;
        border-bottom: 2px solid var(--color-primary);
    }

        .invoice-table thead th {
            font-weight: 600;
            color: #1a2233;
            padding: 10px 8px;
            text-align: center;
            white-space: nowrap;
            font-size: 12px;
            border: none;
        }

    .invoice-table tbody tr {
        border-bottom: 1px dashed #e5e7eb;
        transition: background 0.2s;
    }

        .invoice-table tbody tr:hover {
            background: #f8f9fb;
        }

        .invoice-table tbody tr:last-child {
            border-bottom: none;
        }

    .invoice-table tbody td {
        padding: 10px 8px;
        text-align: center;
        vertical-align: middle;
        border: none;
        color: #1a2233;
    }

        .invoice-table tbody td:nth-child(3) {
            text-align: right;
            min-width: 180px;
        }

            .invoice-table tbody td:nth-child(3) a {
                color: #1a2233;
                text-decoration: none;
                font-weight: 500;
            }

                .invoice-table tbody td:nth-child(3) a:hover {
                    color: var(--color-primary);
                }

    .invoice-table .text-success {
        color: #16a34a !important;
    }

    .invoice-table .text-danger {
        color: #dc2626 !important;
    }

    .invoice-table small {
        font-size: 11px;
    }

/* Responsive */
@media (max-width: 768px) {
    .invoice-table {
        font-size: 11px;
    }

        .invoice-table thead th,
        .invoice-table tbody td {
            padding: 6px 4px;
        }
}

/* ═══════════════════════════════════════════════════════ */
/* صفحه ثبت کد پیگیری                                    */
/* ═══════════════════════════════════════════════════════ */
.checkout-verify-page {
    max-width: 700px;
    margin: 40px auto;
    padding: 20px;
}

.verify-header {
    text-align: center;
    margin-bottom: 30px;
}

.verify-icon {
    font-size: 4rem;
    color: #0d6efd;
    margin-bottom: 15px;
}

.verify-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.verify-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
}

.verify-form-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
}

    .verify-form-box h4 {
        margin-bottom: 20px;
        color: #0d6efd;
    }

.verify-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

    .verify-form-actions .btn {
        flex: 1;
    }

.verify-footer-note {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 20px;
}

.bank-info-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

    .bank-info-box h4 {
        margin-bottom: 15px;
        color: #856404;
    }

.bank-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #ffe69c;
}

    .bank-info-row:last-child {
        border-bottom: none;
    }

    .bank-info-row strong {
        flex: 1;
        font-family: monospace;
        font-size: 1.05rem;
    }

.btn-copy {
    background: transparent;
    border: 1px solid #ffc107;
    color: #856404;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-copy:hover {
        background: #ffc107;
        color: #fff;
    }
