/* ============================================================
   KeysCom — Coupon box styles (Phase 11)
   Append to wwwroot/css/storefront.css (or load separately).
   ============================================================ */

.cart-coupon {
    margin: 1rem 0;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.cart-coupon-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.cart-coupon-input-row {
    display: flex;
    gap: 0.5rem;
    /* Center-align so the input and button share a vertical centerline.
       Their intrinsic heights differ slightly (button padding 0.6rem vs
       input 0.55rem), and the default `stretch` was making the input
       grow without re-centering its text — leaving "Apply" looking
       dropped below the input baseline. */
    align-items: center;
    /* If the row gets squeezed on a very narrow viewport, the button drops
       to a new line instead of overflowing past the card edge. */
    flex-wrap: wrap;
}
.cart-coupon-input-row input {
    /* Fixed-ish width — wide enough for a generous coupon code (around
       18-22 uppercase chars at the current font size), narrow enough to
       leave the Apply button inside the summary card. The previous
       `flex: 1` made the input greedy: its 200px-ish min-content width
       refused to shrink past the available space, shoving the Apply
       button outside the card's right edge. */
    flex: 0 0 auto;
    width: 11rem;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    text-transform: uppercase;
}
.cart-coupon-input-row input:focus {
    outline: none;
    border-color: var(--c-accent, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.cart-coupon-error {
    margin-top: 0.5rem;
    color: #b91c1c;
    font-size: 0.85rem;
}
.cart-coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.92rem;
    color: #065f46;
}
.cart-coupon-applied strong { font-family: ui-monospace, monospace; }
.cart-coupon-remove {
    background: none;
    border: none;
    color: #b91c1c;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    text-decoration: underline;
}

/* Discount line in the order summary */
.summary-discount { color: #065f46; }

/* Estimated total line shown under a discount in the cart summary */
.summary-total-line {
    font-weight: 700;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}
