﻿.store-receipt {
    width: 100%;
    min-width: 0;
    color: var(--store-text-main);
    background: var(--store-white);
}

    .store-receipt,
    .store-receipt *,
    .store-receipt *::before,
    .store-receipt *::after {
        box-sizing: border-box;
    }

/* Receipt header */

.receipt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    background: var(--store-white);
    border-bottom: 1px solid var(--store-main-color);
}

.receipt-header-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.75rem;
}

.receipt-header-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    aspect-ratio: 1;
    color: var(--store-white);
    background: linear-gradient( 14deg, var(--store-main-color), var(--store-main-color-dark) );
    border: 1px solid var(--store-white-25);
    border-radius: 0.8rem;
}

.receipt-title {
    margin: 0;
    color: var(--store-text-main);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.receipt-subtitle {
    display: block;
    margin-top: 0.1rem;
    color: var(--store-text-muted);
}

.receipt-order-number {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: flex-end;
    padding: 0.45rem 0.7rem;
    color: var(--store-text-muted);
    background: var(--store-white);
    border: 1px solid var(--store-main-color);
    border-radius: 0.7rem;
    font-size: 0.72rem;
    line-height: 1.2;
}

    .receipt-order-number strong {
        margin-top: 0.15rem;
        color: var(--store-main-color-dark);
        font-size: 0.95rem;
        font-weight: 900;
    }

/* Company */

.receipt-company-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.5rem;
    padding: 1.35rem 1.2rem;
    border-bottom: 1px solid var(--store-border);
}

.receipt-logo-area {
    min-width: 0;
}

.receipt-logo,
.receipt-logo img {
    display: block;
    width: auto !important;
    max-width: min(100%, 24rem) !important;
    height: auto !important;
    max-height: 6rem !important;
    object-fit: contain;
    object-position: left center;
}

.receipt-company-address {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin: 0;
    color: var(--store-text-muted);
    font-style: normal;
    line-height: 1.45;
    text-align: right;
}

.receipt-company-name {
    margin-bottom: 0.25rem;
    color: var(--store-text-main);
    font-weight: 900;
}

.receipt-company-link {
    color: var(--store-main-color-dark);
    font-size: 0.875rem;
    font-weight: 700;
    overflow-wrap: anywhere;
    text-decoration: none;
}

    .receipt-company-link:hover {
        text-decoration: underline;
    }

/* Customer and totals */

.receipt-details-section {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
    border-bottom: 1px solid var(--store-border);
}

.receipt-customer-section,
.receipt-summary-section {
    min-width: 0;
    padding: 1.25rem 1.2rem;
}

.receipt-summary-section {
    border-left: 1px solid var(--store-border);
}

.receipt-section-heading {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.8rem;
}

.receipt-section-icon {
    flex: none;
    color: var(--store-main-color);
}

.receipt-section-title {
    color: var(--store-text-main);
    font-weight: 900;
    line-height: 1.25;
}

.receipt-section-subtitle {
    display: block;
    margin-top: 0.05rem;
    color: var(--store-text-muted);
}

.receipt-customer-details {
    color: var(--store-text-muted);
    line-height: 1.5;
}

.receipt-customer-name {
    margin-bottom: 0.25rem;
    color: var(--store-text-main);
    font-weight: 850;
}

.receipt-contact-list {
    display: grid;
    gap: 0.3rem;
    margin-top: 0.8rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--store-border);
}

.receipt-contact-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

    .receipt-contact-row .mud-icon-root {
        flex: none;
        color: var(--store-main-color);
    }

    .receipt-contact-row .mud-typography {
        min-width: 0;
        color: var(--store-text-muted);
        overflow-wrap: anywhere;
    }

/* Summary */

.receipt-summary-list {
    display: grid;
}

.receipt-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 2.7rem;
    color: var(--store-text-muted);
    border-bottom: 1px solid var(--store-border);
}

    .receipt-summary-row strong {
        flex: none;
        color: var(--store-main-color-dark);
        font-weight: 850;
        white-space: nowrap;
    }

.receipt-summary-total {
    min-height: 3.1rem;
    margin-top: 0.3rem;
    padding: 0.7rem 0.75rem;
    color: var(--store-main-color-dark);
    background: var(--store-main-color-pale);
    border-bottom: 0;
    border-radius: 0.6rem;
    font-weight: 850;
}

    .receipt-summary-total strong {
        font-size: 1.15rem;
        font-weight: 950;
    }

/* Items */

.receipt-items-section {
    padding: 1.25rem 1.2rem;
}

.receipt-items-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.receipt-items-eyebrow {
    color: var(--store-main-color-dark);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.receipt-items-title {
    margin-top: 0.1rem;
    color: var(--store-text-main);
    font-weight: 900;
    letter-spacing: -0.02em;
}

.receipt-item-count {
    display: inline-flex;
    flex: none;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    color: var(--store-main-color-dark);
    background: var(--store-main-color-pale);
    border: 1px solid var(--store-main-color-pale);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.receipt-items-table {
    overflow: hidden;
    background: var(--store-white);
    border: 1px solid var(--store-border);
    border-radius: 0.8rem;
}

.receipt-table-header,
.receipt-table-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(12rem, 1.35fr) minmax( 12rem, 1.25fr ) minmax(6rem, 0.5fr);
}

.receipt-table-header {
    color: var(--store-text-main);
    background: var(--store-white);
    border-bottom: 1px solid var(--store-border);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

    .receipt-table-header > div {
        padding: 0.8rem 0.85rem;
    }

.receipt-price-heading {
    text-align: right;
}

.receipt-table-row {
    border-bottom: 1px solid var(--store-border);
}

    .receipt-table-row:last-child {
        border-bottom: 0;
    }

.receipt-table-cell {
    min-width: 0;
    padding: 0.9rem 0.85rem;
    color: var(--store-text-muted);
    border-right: 1px solid var(--store-border);
    overflow-wrap: anywhere;
}

    .receipt-table-cell:last-child {
        border-right: 0;
    }

.receipt-gallery-name,
.receipt-student-name {
    color: var(--store-text-main);
    font-weight: 850;
}

.receipt-student-cell {
    display: grid;
    align-content: start;
    gap: 0.15rem;
}

.receipt-detail-text {
    display: block;
    color: var(--store-text-muted);
    line-height: 1.4;
}

.receipt-price-cell {
    text-align: right;
}

.receipt-item-price {
    color: var(--store-main-color-dark);
    font-weight: 900;
    white-space: nowrap;
}

/* Notices */

.receipt-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0 1.2rem 1rem;
    padding: 0.8rem 0.9rem;
    line-height: 1.45;
    border-radius: 0.6rem;
}

    .receipt-notice .mud-icon-root {
        flex: none;
        margin-top: 0.05rem;
    }

.receipt-school-notice {
    color: var(--store-main-color-dark);
    background: var(--store-main-color-pale);
    border-left: 0.25rem solid var(--store-main-color);
}

.receipt-gallery-notice {
    color: var(--store-text-main);
    background: var(--store-tan-soft);
    border-left: 0.25rem solid var(--store-tan);
}

/* Tablet */

@media (max-width: 959.98px) {
    .receipt-details-section {
        grid-template-columns: 1fr;
    }

    .receipt-summary-section {
        border-top: 1px solid var(--store-border);
        border-left: 0;
    }
}

/* Phone */

@media (max-width: 699.98px) {
    .receipt-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .receipt-order-number {
        align-items: flex-start;
    }

    .receipt-company-section {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding-inline: 0.9rem;
    }

    .receipt-company-address {
        align-items: flex-start;
        text-align: left;
    }

    .receipt-logo,
    .receipt-logo img {
        max-width: 100% !important;
        max-height: 5rem !important;
    }

    .receipt-customer-section,
    .receipt-summary-section {
        padding: 1rem 0.9rem;
    }

    .receipt-items-section {
        padding: 1rem 0.75rem;
    }

    .receipt-items-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
    }

    .receipt-table-header {
        display: none;
    }

    .receipt-table-body {
        display: grid;
        gap: 0.65rem;
        padding: 0.65rem;
        background: var(--store-white);
    }

    .receipt-table-row {
        display: block;
        overflow: hidden;
        background: var(--store-white);
        border: 1px solid var(--store-border);
        border-radius: 0.65rem;
    }

    .receipt-table-cell {
        display: grid;
        grid-template-columns: minmax(6rem, 0.4fr) minmax(0, 1fr);
        gap: 0.7rem;
        padding: 0.7rem;
        border-right: 0;
        border-bottom: 1px solid var(--store-border);
        text-align: left;
    }

        .receipt-table-cell:last-child {
            border-bottom: 0;
        }

        .receipt-table-cell::before {
            color: var(--store-text-muted);
            content: attr(data-label);
            font-size: 0.68rem;
            font-weight: 850;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

    .receipt-student-cell {
        grid-template-columns: minmax(6rem, 0.4fr) minmax(0, 1fr);
    }

        .receipt-student-cell::before {
            grid-row: 1 / 20;
        }

    .receipt-price-cell {
        text-align: left;
    }

    .receipt-notice {
        margin-inline: 0.75rem;
    }
}

@media (max-width: 399.98px) {
    .receipt-table-cell,
    .receipt-student-cell {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .receipt-student-cell::before {
        grid-row: auto;
    }
}
@media print {
    .receipt-page .receipt-card.printarea {
        position: relative !important;
    
        margin: 0 !important;
        background: var(--store-white) !important;
    }

    .receipt-card.printarea .store-receipt {
        margin-top: 0 !important;
        top: -5.5in !important;
    }
}
/* =========================================================
   Ink-friendly apparel receipt printing
   Add to StoreTheme.css or app.css
   ========================================================= */

@page {
    size: auto;
    margin: 0.35in;
}

@media print {
    html,
    body {
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        color: var(--store-text-main) !important;
        background: transparent !important;
        print-color-adjust: economy !important;
        -webkit-print-color-adjust: economy !important;
    }

    /* Hide screen-only content. */

    .printhide,
    .store-page-header,
    .receipt-section-header,
    .receipt-help,
    .receipt-actions,
    .receipt-print-button,
    .mud-appbar,
    .mud-drawer {
        display: none !important;
    }

    /* Reset the application and receipt page wrappers. */

    .mud-layout,
    .mud-main-content,
    .receipt-page,
    .receipt-container,
    .receipt-shell,
    .receipt-content-shell {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }

        .receipt-page::before,
        .receipt-page::after {
            display: none !important;
            content: none !important;
        }

        /* Only retain the printable receipt. */

        .receipt-content-shell > :not(.printarea) {
            display: none !important;
        }

    .receipt-card.printarea {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        color: var(--store-text-main) !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        outline: 0 !important;
        box-shadow: none !important;
    }

    /* Reset the ApparelReceiptComponent root. */

    .store-receipt {
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        color: var(--store-text-main) !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        print-color-adjust: economy !important;
        -webkit-print-color-adjust: economy !important;
    }

        /* Remove decorative shadows throughout the receipt. */

        .store-receipt,
        .store-receipt * {
            box-shadow: none !important;
            text-shadow: none !important;
        }

    /* Remove ink-heavy decorative backgrounds. */

    .receipt-header,
    .receipt-header-icon,
    .receipt-order-number,
    .receipt-summary-total,
    .receipt-table-header,
    .receipt-notice,
    .receipt-school-notice,
    .receipt-gallery-notice {
        color: var(--store-text-main) !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* The icon is decorative and unnecessary on paper. */

    .receipt-header-icon {
        display: none !important;
    }

    /* Keep links understandable without color. */

    .store-receipt a {
        color: var(--store-text-main) !important;
        text-decoration: underline !important;
    }

    /* Prevent important sections from splitting between pages. */

    .receipt-company-section,
    .receipt-customer-section,
    .receipt-summary-section,
    .receipt-summary-row,
    .receipt-table-row,
    .receipt-notice {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Allow a long item table to continue onto another page. */

    .receipt-items-table {
        break-inside: auto;
        page-break-inside: auto;
    }

    .receipt-table-header {
        display: table-header-group;
    }
}