/* noveltydocuments — Receipt styles (screen + print) */

.receipt {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 56px 56px 64px;
    background: #fffdf9;
    color: #1f1d1a;
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(48, 38, 28, .08), 0 4px 12px rgba(48, 38, 28, .06);
    box-sizing: border-box;
}

.receipt--inline {
    margin: 32px auto;
}

/* ---------- Actions bar ------------------------------------------------- */
.receipt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 24px auto 8px;
    width: 100%;
    max-width: 1000px;
    padding: 0 8px;
}

.receipt-actions .btn {
    min-width: 180px;
}

/* ---------- Responsive tiers ------------------------------------------- */

/* Large desktop */
@media (min-width: 1400px) {
    .receipt {
        max-width: 1120px;
        padding: 64px 64px 72px;
    }
    .receipt-actions {
        max-width: 1120px;
    }
}

/* Small desktop / large tablet landscape */
@media (max-width: 1024px) {
    .receipt {
        max-width: 100%;
        padding: 44px 36px 48px;
    }
    .receipt-actions {
        max-width: 100%;
    }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .receipt {
        padding: 36px 28px 40px;
        border-radius: 14px;
    }
    .receipt-actions {
        padding: 0;
    }
}

/* ---------- Mobile: stack multi-column tables into single column ------- */
@media (max-width: 640px) {
    .receipt {
        padding: 24px 16px;
        border-radius: 12px;
    }

    /* Tighten cell padding across all tables */
    .receipt table th,
    .receipt table td {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    /* Header table: stack business info above "ORDER RECEIPT" */
    .receipt-head,
    .receipt-head tbody,
    .receipt-head tr,
    .receipt-head td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .receipt-head td:first-child {
        padding-right: 0 !important;
        margin-bottom: 16px;
        text-align: left !important;
    }
    .receipt-head td:last-child {
        text-align: left !important;
        padding-top: 16px;
        border-top: 1px dashed #e3dcd0;
    }
    .receipt-head td:first-child > div:first-child {
        font-size: 17pt !important;
    }
    .receipt-head td:last-child > div:first-child {
        font-size: 12pt !important;
    }

    /* Billed-to table: stack customer above payment */
    .receipt-billed,
    .receipt-billed tbody,
    .receipt-billed tr,
    .receipt-billed td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .receipt-billed td:first-child {
        padding-right: 0 !important;
        margin-bottom: 16px;
    }
    .receipt-billed td:last-child {
        padding-top: 16px;
        border-top: 1px dashed #e3dcd0;
    }

    /* Totals table: full width, no blank left cell */
    .receipt-totals,
    .receipt-totals tbody,
    .receipt-totals tr,
    .receipt-totals > tbody > tr > td {
        display: block !important;
        width: 100% !important;
    }
    .receipt-totals > tbody > tr > td:first-child {
        display: none !important;
    }

    /* Items table: readable wrapping */
    .receipt tbody td,
    .receipt thead th {
        word-break: break-word;
        white-space: normal !important;
    }
    .receipt tbody td:first-child {
        font-size: 10pt !important;
    }

    /* Actions: full-width stacked buttons */
    .receipt-actions {
        flex-direction: column;
        gap: 10px;
        padding: 0;
        margin: 20px 0 8px;
    }
    .receipt-actions .btn {
        min-width: 0;
        width: 100%;
    }
    
     .receipt-shell {
        margin: 0 auto;
    }
    .receipt-shell .receipt {
        border-radius: 12px;
    }
}

/* ---------- Print -------------------------------------------------------- */
@media print {
    body { background: #fff; }
    .site-header,
    .site-footer,
    .wa-float,
    .to-top,
    .toast,
    .skip-link,
    .receipt-actions,
    .no-print {
        display: none !important;
    }
    .receipt {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        max-width: none;
        width: 100%;
        margin: 0;
    }
    .receipt--inline {
        margin: 0;
    }

    /* Force side-by-side on paper regardless of viewport width */
    .receipt-head,
    .receipt-head tbody,
    .receipt-head tr {
        display: table !important;
        width: 100% !important;
    }
    .receipt-head tr { display: table-row !important; }
    .receipt-head td { display: table-cell !important; width: auto !important; }

    .receipt-billed,
    .receipt-billed tbody,
    .receipt-billed tr {
        display: table !important;
        width: 100% !important;
    }
    .receipt-billed tr { display: table-row !important; }
    .receipt-billed td { display: table-cell !important; width: auto !important; }

    .receipt-totals,
    .receipt-totals tbody,
    .receipt-totals tr {
        display: table !important;
        width: 100% !important;
    }
    .receipt-totals tr { display: table-row !important; }
    .receipt-totals td { display: table-cell !important; width: auto !important; }
    .receipt-totals > tbody > tr > td:first-child {
        display: table-cell !important;
    }

    @page {
        margin: 20mm;
    }
}
/* ---------- Thanks page shell ------------------------------------------ */
.thanks-page {
    background: var(--bg, #f7f4ef);
    padding: 8px 0 64px;
}

.thanks-page .thanks-inner {
    max-width: 900px;
}

.thanks-page h1 {
    margin-bottom: 12px;
}

.thanks-page .lede {
    margin-bottom: 8px;
}

/* Receipt paper inside the thanks page */
.receipt-shell {
    margin: 0 auto;
    width: 100%;
    max-width: 1000px;
}

.receipt-shell .receipt {
    margin: 0 auto;
}

/* ---------- Actions bar ------------------------------------------------- */
.receipt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 24px auto 28px;
    width: 100%;
    max-width: 1000px;
    padding: 0;
}

.receipt-actions .btn {
    min-width: 200px;
}

.thanks-back {
    text-align: center;
    margin: 32px 0 0;
    font-weight: 600;
}