/* =========================================================
   AFA / DATA RECEIPT — SEA BLUE & WHITE PROFESSIONAL STYLE
========================================================= */

:root {
    --sea-blue: #0ea5e9;
    --sea-blue-dark: #0284c7;
    --sea-blue-deep: #0369a1;
    --sea-blue-soft: #e0f2fe;
    --sea-blue-faint: #f0f9ff;

    --white: #ffffff;
    --text-dark: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-soft: #475569;

    --border-light: #dbeafe;
    --border-soft: #e2e8f0;

    --success: #16a34a;
    --success-soft: #dcfce7;

    --warning: #92400e;
    --warning-soft: #fef3c7;

    --danger: #b91c1c;
    --danger-soft: #fee2e2;

    --orange: #ea580c;
    --orange-soft: #ffedd5;

    --page-bg: #f6fbff;

    --shadow-sm: 0 8px 24px rgba(2, 132, 199, 0.08);
    --shadow-md: 0 20px 50px rgba(2, 132, 199, 0.10);
    --shadow-lg: 0 28px 70px rgba(2, 132, 199, 0.14);

    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;
}

/* ===============================
   RESET / BASE
================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: var(--page-bg);
    color: var(--text-dark);
}

/* ===============================
   WRAPPER
================================ */

.receipt-wrapper {
    width: 100%;
    min-height: 100vh;
    padding: 0 16px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* ===============================
   RECEIPT CARD
================================ */

.receipt-card {
    width: 100%;
    background: var(--white);
    border: 1px solid rgba(14, 165, 233, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.receipt-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(90deg, var(--sea-blue-deep), var(--sea-blue), #38bdf8);
}

.receipt-card.small-width {
    max-width: 760px;
    padding: 2rem;
}

/* ===============================
   LOGO BOX
================================ */

.logo-box {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.4rem;
    padding: 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--sea-blue-deep) 0%, var(--sea-blue-dark) 45%, var(--sea-blue) 100%);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.logo-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.10) 0%,
        rgba(255,255,255,0.04) 45%,
        rgba(255,255,255,0.02) 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.08);
    pointer-events: none;
}

.optina-logo {
    position: relative;
    z-index: 2;
    display: block;
    max-width: 165px;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0,0,0,0.20));
}

/* ===============================
   HEADER
================================ */

.receipt-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.header-left {
    text-align: center;
}

.receipt-subtitle {
    display: inline-block;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    font-weight: 600;
}

/* ===============================
   QR BOX
================================ */

.qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.35rem;
}

.qr-img-small {
    width: 118px;
    height: 118px;
    object-fit: contain;
    padding: 0.55rem;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.qr-label {
    margin-top: 0.65rem;
    margin-bottom: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 600;
}

/* ===============================
   TITLE
================================ */

.section-title-wrap {
    text-align: center;
    margin-bottom: 1.35rem;
    padding: 0.15rem 0 0.35rem;
}

.section-title-wrap h2 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.68rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f8fdff 0%, var(--sea-blue-soft) 100%);
    border: 1px solid var(--border-light);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.06);
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--sea-blue-deep);
}

/* ===============================
   SECTION BLOCKS
================================ */

.section {
    background: linear-gradient(180deg, #ffffff 0%, #fbfeff 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.15rem 1rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 8px 22px rgba(2, 132, 199, 0.04);
}

.section h3 {
    margin: 0 0 1rem;
    font-size: 0.96rem;
    line-height: 1.35;
    font-weight: 800;
    color: var(--text-dark);
}

/* ===============================
   DETAIL ROWS
================================ */

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.86rem 0;
    border-bottom: 1px solid #edf6fb;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row span {
    font-size: 0.84rem;
    color: var(--text-soft);
    font-weight: 600;
}

.detail-row strong {
    font-size: 0.84rem;
    color: var(--text-dark);
    font-weight: 800;
    text-align: right;
    word-break: break-word;
}

.total-row {
    margin-top: 0.45rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    border-bottom: none;
}

.total-row span,
.total-row strong {
    font-size: 0.96rem;
}

/* ===============================
   ITEMS
================================ */

.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.25rem;
}

.item-card {
    background: linear-gradient(180deg, #ffffff 0%, var(--sea-blue-faint) 100%);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.05);
}

/* ===============================
   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: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.payment-status.pending {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: #fcd34d;
}

.payment-status.failed {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #fca5a5;
}

/* ORDER STATUS */
.order-status.pending {
    background: #fff7ed;
    color: var(--orange);
    border-color: #fdba74;
}

.order-status.process {
    background: var(--sea-blue-dark);
    color: var(--white);
    border-color: var(--sea-blue-dark);
}

.order-status.in-progress {
    background: var(--sea-blue-deep);
    color: var(--white);
    border-color: var(--sea-blue-deep);
}

.order-status.completed {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

/* ===============================
   NOTE BOX
================================ */

.receipt-note-box {
    background: linear-gradient(180deg, #fffef8 0%, #fffdf4 100%);
    border: 1px solid #f7e8b0;
}

.receipt-note {
    margin: 0;
    font-size: 0.83rem;
    line-height: 1.7;
    color: var(--text-soft);
    font-weight: 500;
}

/* ===============================
   CREDIT
================================ */

.receipt-credit {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.receipt-credit strong {
    color: var(--sea-blue-deep);
    font-weight: 800;
}

/* ===============================
   ACTIONS
================================ */

.actions {
    display: flex;
    gap: 0.95rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1.45rem;
}

.btn-print,
.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.85rem 1.45rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn-print {
    background: linear-gradient(135deg, var(--sea-blue-deep), var(--sea-blue-dark));
    color: var(--white);
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.18);
}

.btn-print:hover {
    background: linear-gradient(135deg, var(--sea-blue-dark), var(--sea-blue));
    transform: translateY(-2px);
}

.btn-download {
    background: var(--white);
    color: var(--sea-blue-deep);
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.08);
}

.btn-download:hover {
    background: var(--sea-blue-faint);
    transform: translateY(-2px);
}

/* ===============================
   HELPERS
================================ */

.text-right {
    text-align: right !important;
}

.right {
    text-align: right;
}

.muted {
    color: var(--text-muted) !important;
}

.small {
    font-size: 0.82rem;
}

/* ===============================
   TABLET
================================ */

@media (max-width: 768px) {
    .receipt-wrapper {
        padding: 0 12px 40px;
    }

    .receipt-card.small-width {
        padding: 1.35rem 1rem;
        border-radius: 18px;
    }

    .logo-box {
        margin-bottom: 1.15rem;
        padding: 0.95rem 0.85rem;
        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.9rem;
        padding: 0.56rem 0.9rem;
    }

    .section {
        padding: 1rem 0.95rem 0.92rem;
        border-radius: 16px;
    }

    .detail-row span,
    .detail-row strong {
        font-size: 0.8rem;
    }

    .status-badge {
        min-width: 98px;
        font-size: 10px;
        padding: 7px 12px;
    }
}

/* ===============================
   MOBILE
================================ */

@media (max-width: 560px) {
    .receipt-wrapper {
        padding: 0 10px 32px;
    }

    .receipt-card.small-width {
        padding: 1.1rem 0.85rem;
        border-radius: 16px;
    }

    .receipt-subtitle {
        font-size: 0.8rem;
    }

    .section-title-wrap h2 {
        font-size: 0.84rem;
        letter-spacing: 0.03em;
    }

    .section h3 {
        font-size: 0.9rem;
    }

    .detail-row {
        align-items: flex-start;
        flex-direction: row;
        gap: 0.8rem;
    }

    .detail-row span {
        max-width: 46%;
        font-size: 0.78rem;
    }

    .detail-row strong {
        max-width: 54%;
        font-size: 0.78rem;
    }

    .items-list {
        gap: 0.75rem;
    }

    .item-card {
        padding: 0.85rem 0.9rem;
        border-radius: 14px;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .btn-print,
    .btn-download {
        width: 100%;
    }
}

/* ===============================
   EXTRA SMALL
================================ */

@media (max-width: 380px) {
    .section-title-wrap h2 {
        font-size: 0.78rem;
        padding: 0.54rem 0.78rem;
    }

    .detail-row span,
    .detail-row strong {
        font-size: 0.74rem;
    }

    .status-badge {
        min-width: 90px;
        font-size: 9px;
    }
}

/* ===============================
   PRINT
================================ */

@media print {
    html,
    body {
        background: #ffffff !important;
    }

    .receipt-wrapper {
        padding: 0 !important;
        min-height: auto !important;
    }

    .receipt-card,
    .receipt-card.small-width {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }

    .receipt-card::before {
        display: none !important;
    }

    .logo-box {
        box-shadow: none !important;
        border-radius: 12px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .section,
    .item-card,
    .section-title-wrap h2,
    .status-badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .actions,
    .no-print {
        display: none !important;
    }
}