/* ============================================================
   RECEIPT DESIGN - FULL CSS (WITH SINGLE-CARD SUPPORT)
============================================================ */

#receipt_content {
    width: 100% !important;
    max-width: 760px !important;
    margin: 100px auto !important;
    box-sizing: border-box !important;

    padding: 0 0 39px 0 !important;

    background: #ffffff !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #d1d5db !important;
    border-radius: 18px !important;

    overflow: hidden !important;

    display: grid !important;

    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;

    grid-template-areas:
        "header header"
        "message message"
        "download email" !important;

    column-gap: 24px !important;
    row-gap: 0 !important;

    text-align: left !important;

    font-family: Arial, Helvetica, sans-serif !important;
}

/* When duplicate email is disabled, adjust grid to single column layout for download card */
#receipt_content.single-card-mode {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
        "header"
        "message"
        "download" !important;
    max-width: 520px !important;
}


/* ============================================================
   HEADER
============================================================ */

#receipt_content > .custom-receipt-header {
    grid-area: header !important;

    width: 100% !important;
    min-height: 130px !important;

    margin: 0 !important;
    padding: 24px 24px !important;

    box-sizing: border-box !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;

    background: #f8fafc !important;

    border-bottom: 1px solid #d1d5db !important;

    text-align: center !important;
}

.custom-receipt-header-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    gap: 12px !important;
    margin-bottom: 6px !important;
}

#receipt_content .custom-receipt-check {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: #b5d334 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: bold !important;
}

#receipt_content .custom-receipt-header-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #111111 !important;
    text-align: left !important;
    white-space: nowrap !important;
}

#receipt_content .custom-receipt-subtitle {
    font-size: 13px !important;
    color: #4b5563 !important;
    text-align: center !important;
    margin-top: 4px !important;
}


/* Hide original elements */
#receipt_content > .receipt__line,
#receipt_content > .receipt__order-key,
#receipt_content > .receipt__order-email {
    display: none !important;
}


/* ============================================================
   MESSAGE
============================================================ */

#receipt_content > .custom-receipt-message {
    grid-area: message !important;

    width: auto !important;
    margin: 32px 32px 0 32px !important;
    padding: 0 0 0 15px !important;

    box-sizing: border-box !important;

    border-left: 2px solid #111111 !important;
    color: #111111 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    text-align: left !important;
}


/* ============================================================
   CARDS (DOWNLOAD & EMAIL) - EQUAL HEIGHT
============================================================ */

#receipt_content > .receipt__print,
#receipt_content > .receipt__send-email {
    position: relative !important;
    width: auto !important;
    
    height: 100% !important;
    min-height: unset !important;

    margin-top: 24px !important;
    padding: 24px !important;
    box-sizing: border-box !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: space-between !important;

    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    text-align: left !important;
}

#receipt_content > .receipt__print {
    grid-area: download !important;
    margin-left: 32px !important;
    margin-right: 0 !important;
}

#receipt_content.single-card-mode > .receipt__print {
    margin-right: 32px !important;
}

#receipt_content > .receipt__send-email {
    grid-area: email !important;
    margin-left: 0 !important;
    margin-right: 32px !important;
}


/* ============================================================
   CARD CONTENT
============================================================ */

#receipt_content .custom-receipt-card-icon {
   width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    margin-bottom: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #005890 !important;
    border-radius: 8px !important;
    color: #fff!important;
    font-size: 18px !important;
}
#receipt_content .custom-mat-field:focus-within .custom-mat-field-label, #receipt_content .custom-mat-field.has-value .custom-mat-field-label{
color: rgba(0, 0, 0, 0.6) !important;
}

#receipt_content .custom-receipt-card-title {
    margin: 0 0 8px 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #111111 !important;
}

#receipt_content .custom-receipt-card-description {
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: #4b5563 !important;
}


/* ============================================================
   BUTTONS & INPUTS FIX
============================================================ */

#receipt_content .receipt__send-email-row,
#receipt_content .receipt__send-email-input-wrapper {
    width: 100% !important;
    margin-top: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

#receipt_content .receipt__send-email-input {
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    outline: none !important;
    background: #ffffff !important;
    color: #111111 !important;
}

#receipt_content .download-receipt-button,
#receipt_content .receipt__send-email__button {
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    margin-top: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

#receipt_content .download-receipt-button {
    background: #e5e7eb !important;
    border: 1px solid #d1d5db !important;
    color: #111111 !important;
}

#receipt_content .receipt__send-email__button {
    background: #111111 !important;
    border: none !important;
    color: #ffffff !important;
    margin-top: 0 !important;
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 750px) {
    #receipt_content {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "header"
            "message"
            "download"
            "email" !important;
        gap: 3px;
        row-gap: 10px !important;
    }
    #receipt_content.single-card-mode {
        grid-template-areas:
            "header"
            "message"
            "download" !important;
    }

    #receipt_content > .receipt__print,
    #receipt_content > .receipt__send-email,
    #receipt_content > .custom-receipt-message {
        margin-left: 16px !important;
        margin-right: 16px !important;
    }

    #receipt_content .custom-receipt-header-title {
        white-space: normal !important;
        font-size: 18px !important;
    }
}

