/* ===============================
   PAGE & CONTAINER
================================ */

.receipt-page {
    min-height: 70vh;
    padding: 2.5rem 1rem;
    display: flex;
    justify-content: center;
    background: #f8fafc;
    box-sizing: border-box;
}

.receipt-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

/* ===============================
   CARD
================================ */

.receipt-card {
    width: 100%;
    max-width: 920px;
    background: #ffffff;
    border-radius: 24px;
    padding: 2.2rem;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    border: 1px solid #eef2f7;
}

/* ===============================
   LOGO BOX
================================ */

.logo-box {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.4rem;
    padding: 1rem 0.95rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #334155 100%);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.logo-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(109, 40, 217, 0.22) 0%,
        rgba(124, 58, 237, 0.14) 35%,
        rgba(245, 158, 11, 0.12) 100%
    );
    pointer-events: none;
}

.logo-box::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    top: -90px;
    right: -70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    filter: blur(2px);
    pointer-events: none;
}

.optina-logo {
    position: relative;
    z-index: 2;
    display: block;
    max-width: 170px;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
}

/* ===============================
   HEADER
================================ */

.receipt-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.receipt-subtitle {
    display: inline-block;
    font-size: 0.88rem;
    color: #64748b;
    text-align: center;
    line-height: 1.5;
    font-weight: 500;
}

/* ===============================
   QR
================================ */

.qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.qr-img-small {
    width: 118px;
    height: 118px;
    object-fit: contain;
    padding: 0.55rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}

.qr-label {
    margin-top: 0.6rem;
    margin-bottom: 0;
    font-size: 0.82rem;
    color: #64748b;
    text-align: center;
}

/* ===============================
   RECEIPT TITLE
================================ */

.section-title-wrap {
    text-align: center;
    margin-bottom: 1.4rem;
    padding: 0.2rem 0 0.35rem;
}

.section-title-wrap h2 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #0f172a;
    text-transform: uppercase;
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

/* ===============================
   SECTION BLOCKS
================================ */

.section {
    background: #fbfcfe;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 1.15rem 1.15rem 1rem;
    margin-bottom: 1.2rem;
}

.section h3 {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 800;
    color: #1e293b;
}

/* ===============================
   DETAIL ROWS
================================ */

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.82rem 0;
    border-bottom: 1px solid #edf2f7;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row span {
    font-size: 0.84rem;
    color: #475569;
    font-weight: 500;
}

.detail-row strong {
    font-size: 0.84rem;
    color: #0f172a;
    font-weight: 800;
    text-align: right;
}

.total-row {
    margin-top: 0.4rem;
    padding-top: 1rem;
    border-top: 1px solid #dbe4ee;
    border-bottom: none;
}

.total-row span,
.total-row strong {
    font-size: 0.95rem;
}

/* ===============================
   ITEMS
================================ */

.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.2rem;
}

.item-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0.9rem 1rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

/* ===============================
   BADGES
================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    line-height: 1;
    white-space: nowrap;
}

/* PAYMENT STATUS */
.payment-status.success {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

.payment-status.pending {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.payment-status.failed {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* ORDER STATUS */
.order-status.pending {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fdba74;
}

.order-status.process {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.order-status.in-progress {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
}

.order-status.completed {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

/* ===============================
   NOTE
================================ */

.receipt-note-box {
    background: #fffdf7;
    border: 1px solid #f6e7b8;
}

.receipt-note {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.65;
    color: #475569;
}

/* ===============================
   CREDIT
================================ */

.receipt-credit {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
}

.receipt-credit strong {
    color: #0f172a;
}

/* ===============================
   ACTIONS
================================ */

.actions {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    margin-top: 1.4rem;
    flex-wrap: wrap;
}

.btn-print,
.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.8rem 1.4rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 800;
    transition: 0.2s ease;
}

.btn-print {
    background: #0f172a;
    color: #ffffff;
}

.btn-print:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.btn-download {
    background: #6d28d9;
    color: #ffffff;
}

.btn-download:hover {
    background: #5b21b6;
    transform: translateY(-1px);
}

/* ===============================
   HELPERS
================================ */

.text-right {
    text-align: right !important;
}

.right {
    text-align: right;
}

.muted {
    color: #64748b;
}

.small {
    font-size: 0.82rem;
}

/* ===============================
   MOBILE
================================ */

@media (max-width: 768px) {
    .receipt-page {
        padding: 1.3rem 0.8rem;
    }

    .receipt-card {
        padding: 1.3rem 0.95rem;
        border-radius: 18px;
    }

    .logo-box {
        margin-bottom: 1.15rem;
        padding: 0.95rem 0.8rem;
        border-radius: 16px;
    }

    .optina-logo {
        max-width: 145px;
    }

    .qr-img-small {
        width: 104px;
        height: 104px;
    }

    .section-title-wrap {
        margin-bottom: 1.1rem;
    }

    .section-title-wrap h2 {
        font-size: 0.92rem;
        padding: 0.5rem 0.85rem;
    }

    .section {
        padding: 1rem 0.95rem 0.9rem;
        border-radius: 16px;
    }

    .detail-row {
        gap: 0.8rem;
    }

    .detail-row span,
    .detail-row strong {
        font-size: 0.8rem;
    }

    .status-badge {
        min-width: 96px;
        font-size: 10px;
        padding: 7px 12px;
    }
}

@media (max-width: 560px) {
    .receipt-card {
        padding: 1.15rem 0.85rem;
        border-radius: 16px;
    }

    .receipt-subtitle {
        font-size: 0.8rem;
    }

    .section-title-wrap h2 {
        font-size: 0.86rem;
        letter-spacing: 0.03em;
    }

    .section h3 {
        font-size: 0.9rem;
    }

    .detail-row {
        align-items: flex-start;
        flex-direction: row;
    }

    .detail-row span {
        max-width: 48%;
        font-size: 0.78rem;
    }

    .detail-row strong {
        max-width: 52%;
        font-size: 0.78rem;
        word-break: break-word;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-print,
    .btn-download {
        width: 100%;
    }
}

/* ===============================
   PRINT
================================ */

@media print {
    body {
        background: #ffffff !important;
    }

    .receipt-page {
        padding: 0;
        background: #ffffff !important;
    }

    .receipt-container {
        max-width: 100%;
    }

    .receipt-card {
        box-shadow: none !important;
        border-radius: 0;
        border: none;
        max-width: 100%;
        padding: 0;
    }

    .logo-box {
        box-shadow: none;
        border-radius: 12px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .actions {
        display: none !important;
    }
}