﻿/* WebOrders.Web/wwwroot/css/cart.css */

.wo-cart-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.wo-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    color: #111827;
}

/* ── Two-column grid (lines + summary) ─────────────────────────────── */
.wo-cart-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 880px) {
    .wo-cart-grid { grid-template-columns: 1fr; }
}

/* ── Cart lines ─────────────────────────────────────────────────────── */
.wo-cart-lines {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.wo-cart-line {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.wo-cart-line:last-child { border-bottom: 0; }

.wo-cart-line-name {
    font-weight: 600;
    color: #111827;
}

.wo-cart-line-mods {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

.wo-cart-line-notes {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.2rem;
    font-style: italic;
}

/* Qty stepper — reuses the same pill style as the item-detail modal */
.wo-cart-line-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.wo-cart-line-qty-val {
    min-width: 2.4rem;
    text-align: center;
    font-weight: 600;
    color: #111827;
    padding: 0 0.4rem;
}

.wo-cart-line-price {
    font-weight: 700;
    min-width: 4.5rem;
    text-align: right;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.wo-cart-line-remove {
    background: transparent;
    border: 0;
    padding: 0.35rem;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.wo-cart-line-remove:hover {
    color: #dc2626;
    background: #fef2f2;
}

@media (max-width: 520px) {
    .wo-cart-line {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "info  remove"
            "qty   price";
        gap: 0.6rem 1rem;
    }
    .wo-cart-line-info   { grid-area: info; }
    .wo-cart-line-qty    { grid-area: qty; justify-self: start; }
    .wo-cart-line-price  { grid-area: price; }
    .wo-cart-line-remove { grid-area: remove; align-self: start; }
}

/* ── Summary sidebar ────────────────────────────────────────────────── */
.wo-cart-summary {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    position: sticky;
    top: 6rem;
}

.wo-cart-summary-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.wo-cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
}

.wo-cart-summary-note {
    color: #6b7280;
    font-size: 0.8rem;
    padding: 0.3rem 0 0.5rem;
    line-height: 1.4;
}

.wo-cart-summary-total {
    border-top: 1px solid #f3f4f6;
    margin-top: 0.5rem;
    padding-top: 0.85rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #111827;
}

.wo-cart-checkout,
.wo-cart-continue {
    display: block;
    width: 100%;
    margin-top: 0.65rem;
    text-align: center;
    padding: 0.85rem 1rem;
    text-decoration: none;
}

/* ── Flash messages ─────────────────────────────────────────────────── */
.wo-flash {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.wo-flash-ok  { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.wo-flash-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Suggestive selling card ("you might also like") ─────────────── */
.wo-suggestion-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    padding: 12px 14px;
    border: 1px solid var(--wo-accent, #1a7f64);
    border-left-width: 4px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--wo-accent, #1a7f64) 6%, #fff);
}

.wo-suggestion-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.wo-suggestion-body {
    flex: 1;
    min-width: 0;
}

.wo-suggestion-headline {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--wo-accent, #1a7f64);
    font-weight: 600;
}

.wo-suggestion-item {
    font-size: 15px;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wo-suggestion-add button {
    white-space: nowrap;
}

.wo-suggestion-dismiss button {
    border: 0;
    background: none;
    font-size: 20px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px 6px;
}

    .wo-suggestion-dismiss button:hover {
        color: #333;
    }

@media (max-width: 560px) {
    .wo-suggestion-card {
        flex-wrap: wrap;
    }

    .wo-suggestion-add {
        width: 100%;
    }

        .wo-suggestion-add button {
            width: 100%;
        }
}

/* ── QR dine-in: join-or-start prompt ─────────────────────────────────
   Shown only when the table's open check is claimed by another device.
   Deliberately not styled as an error: joining a shared check is the
   common, correct case — the prompt exists to catch the minority where
   the previous party's check was never settled. */

.wo-flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.wo-qr-join {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
}

.wo-qr-join-title {
    font-size: .92rem;
    color: #1e40af;
    margin-bottom: 8px;
}

.wo-qr-join-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: .95rem;
}

    .wo-qr-join-opt input {
        width: 18px;
        height: 18px;
        flex: 0 0 auto;
    }
