/* shop/assets/css/receipt.css */

#receipt {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .07);
    font-family: 'Poppins', sans-serif;
}

/* ── HEADER ── */
.rc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px;
    background: #fff;
    border-bottom: 2px solid #e91e63;
}

.rc-logo-box {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rc-logo {
    max-width: 110px;
    max-height: 110px;
    object-fit: contain;
    display: block;
}

.rc-logo-text {
    font-size: 1.3rem;
    font-weight: 900;
    color: #1a1a2e;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.2;
}

.rc-title-block {
    flex: 1;
    text-align: center;
}

.rc-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.rc-order-code {
    font-size: 1.5rem;
    font-weight: 900;
    color: #e91e63;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.rc-order-date {
    font-size: .8rem;
    color: #888;
    letter-spacing: .5px;
}

.rc-qr-box {
    width: auto;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.rc-qr {
    width: 110px;
    height: 110px;
    border: 1px solid #eee;
    border-radius: 6px;
    display: block;
}

.rc-qr-label {
    font-size: .65rem;
    color: #aaa;
    text-align: center;
    letter-spacing: .4px;
    white-space: nowrap;
}

/* ── CLIENT INFO ── */
.rc-client-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid #eee;
    background: #fff;
}

.rc-info-cell {
    padding: 10px 20px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rc-info-cell:last-of-type {
    border-right: none;
}

.rc-info-wide {
    grid-column: span 2;
}

.rc-lbl {
    font-size: .68rem;
    font-weight: 700;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: .7px;
}

.rc-val {
    font-size: .88rem;
    font-weight: 600;
    color: #1a1a2e;
}

/* ── TABLE ── */
.rc-table-wrap {
    padding: 0;
    overflow-x: auto;
}

.rc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.rc-table th {
    background: #e91e63;
    color: #fff;
    padding: 11px 14px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    border: 1px solid #c2185b;
    white-space: nowrap;
}

.rc-table td {
    padding: 11px 14px;
    border: 1px solid #e8e8e8;
    color: #444;
    vertical-align: middle;
}

.rc-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.rc-table tbody tr:hover {
    background: #fff5f8;
}

.th-img,
.td-img {
    width: 64px;
    padding: 8px !important;
    text-align: center;
}

.th-center,
.td-center {
    text-align: center;
}

.th-right,
.td-right {
    text-align: right;
}

.prod-img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    display: block;
    margin: auto;
}

.prod-img-ph {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 1.1rem;
    margin: auto;
}

.td-name {
    font-weight: 600;
    color: #1a1a2e;
    min-width: 120px;
}

.td-total {
    font-weight: 700;
    color: #e91e63;
}

.dash {
    color: #ccc;
}

/* ── TOTALS ── */
.rc-totals-wrap {
    display: flex;
    justify-content: flex-end;
    padding: 16px 28px;
    border-top: 1px solid #eee;
    background: #fff;
}

.rc-totals {
    min-width: 260px;
}

.rc-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: .9rem;
    color: #555;
    font-weight: 500;
    border-bottom: 1px dashed #f0f0f0;
}

.rc-total-row:last-child {
    border-bottom: none;
}

.rc-grand {
    margin-top: 6px;
    padding-top: 10px;
    font-size: 1.15rem;
    font-weight: 900;
    color: #1a1a2e;
    border-top: 2px solid #e91e63 !important;
}

.rc-grand span:last-child {
    color: #e91e63;
    font-size: 1.2rem;
}

/* ── FOOTER ── */
.rc-footer {
    padding: 18px 28px;
    border-top: 1px solid #eee;
    text-align: center;
    background: #fff;
}

.rc-thank-msg {
    font-size: .88rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
    font-style: italic;
}

.rc-footer-badges {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.rc-badge {
    font-size: .78rem;
    color: #888;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 4px 12px;
    border-radius: 20px;
}

.rc-badge i {
    color: #e91e63;
}

/* RTL OVERRIDES */
[dir="rtl"] .rc-info-cell {
    border-right: none;
    border-left: 1px solid #eee;
    text-align: right;
}

[dir="rtl"] .rc-info-cell:first-child {
    border-left: 1px solid #eee;
}

[dir="rtl"] .rc-info-cell:nth-child(3) {
    border-left: none;
}

[dir="rtl"] .rc-val[dir="ltr"] {
    display: block;
    text-align: right;
    direction: ltr;
    unicode-bidi: embed;
}

[dir="rtl"] .rc-table th,
[dir="rtl"] .rc-table td {
    text-align: right;
}

[dir="rtl"] .th-center,
[dir="rtl"] .td-center {
    text-align: center;
}

[dir="rtl"] .td-right,
[dir="rtl"] .td-total {
    direction: ltr;
    unicode-bidi: embed;
    text-align: right;
}

[dir="rtl"] .rc-totals-wrap {
    direction: ltr;
    justify-content: flex-start;
}

[dir="rtl"] .rc-totals {
    direction: rtl;
}

[dir="rtl"] .rc-total-row span:last-child {
    direction: ltr;
    unicode-bidi: embed;
}

/* Responsive */
@media (max-width: 700px) {
    .rc-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 16px;
        gap: 12px;
    }

    .rc-logo-box {
        width: 90px;
        height: 90px;
    }

    .rc-qr-box {
        width: auto;
        min-width: 90px;
        height: auto;
    }

    .rc-logo {
        max-width: 90px;
        max-height: 90px;
    }

    .rc-qr {
        width: 90px;
        height: 90px;
    }

    .rc-order-code {
        font-size: 1.2rem;
    }

    .rc-client-grid {
        grid-template-columns: 1fr 1fr;
    }

    .rc-info-wide {
        grid-column: span 2;
    }

    .rc-info-cell {
        padding: 8px 12px;
    }

    .rc-table th,
    .rc-table td {
        padding: 8px 10px;
        font-size: .8rem;
    }

    .prod-img,
    .prod-img-ph {
        width: 40px;
        height: 40px;
    }

    .rc-totals-wrap {
        padding: 12px 16px;
    }

    .rc-totals {
        min-width: 0;
        width: 100%;
    }

    .rc-footer {
        padding: 14px 16px;
    }
}

/* Print Only */
@media print {
    #receipt {
        display: block !important;
        box-shadow: none;
        border: 1px solid #ddd;
        border-radius: 0;
        page-break-inside: avoid;
        width: 100% !important;
        margin: 0 !important;
    }

    .rc-header,
    .rc-table th,
    .rc-grand,
    .rc-table tbody tr:nth-child(even),
    .prod-img,
    .rc-qr {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .rc-table tr {
        page-break-inside: avoid;
    }

    @page {
        margin: 10mm;
        size: A4 portrait;
    }
}