/*
 * /winkel/bestellingen — lijst van orders voor de huidige gebruiker.
 */
@import url('variables/webshop.css');

.layer__order-history {
    padding-block: var(--space-5);
    max-width: 48rem;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.order-history__head h1 {
    font-size: var(--fs-h1);
    line-height: var(--line-tight);
    margin: 0 0 var(--space-4);
}

.order-history__lookup {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-2);
    align-items: end;
    margin-bottom: var(--space-4);
}

.order-history__lookup input {
    border: var(--ws-input-border);
    border-radius: var(--ws-input-radius);
    padding: 0.5rem 0.7rem;
    font: inherit;
}

.order-history__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.order-history__item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: var(--ws-card-border);
    border-radius: var(--ws-card-radius);
    background: var(--color-bg-elev, #fff);
    align-items: center;
    transition: box-shadow .15s ease;
}

.order-history__item:hover {
    box-shadow: 0 2px 10px color-mix(in srgb, currentColor 10%, transparent);
}

.order-history__number {
    font-variant-numeric: tabular-nums;
}

.order-history__date {
    color: color-mix(in srgb, currentColor 60%, transparent);
    margin-left: var(--space-2);
    font-size: 0.85rem;
}

.order-history__count {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.15rem;
    color: color-mix(in srgb, currentColor 55%, transparent);
}

/* Status-badge — kleurt per orderstatus mee. */
.order-history__status {
    justify-self: start;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.order-history__status--paid {
    background: color-mix(in srgb, var(--ws-stock-in-color) 14%, transparent);
    color: var(--ws-stock-in-color);
}

.order-history__status--pending,
.order-history__status--draft {
    background: color-mix(in srgb, #c79b00 14%, transparent);
    color: #8a6d00;
}

.order-history__status--failed,
.order-history__status--cancelled,
.order-history__status--expired,
.order-history__status--refunded {
    background: color-mix(in srgb, var(--ws-price-sale-color) 12%, transparent);
    color: var(--ws-price-sale-color);
}

.order-history__item--paid    { border-left: 4px solid var(--ws-stock-in-color); }
.order-history__item--pending { border-left: 4px solid #c79b00; }
.order-history__item--failed,
.order-history__item--cancelled,
.order-history__item--expired { border-left: 4px solid var(--ws-price-sale-color); }

.order-history__item-total {
    font-weight: 700;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.order-history__actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
}

.order-history__reorder {
    margin: 0;
}

/* Mobiel: nummer + badge bovenin, totaal + acties eronder. */
@media (max-width: 40rem) {
    .order-history__item {
        grid-template-columns: 1fr auto;
        row-gap: var(--space-2);
    }
    .order-history__item-total {
        grid-column: 1;
    }
    .order-history__actions {
        grid-column: 2;
        justify-self: end;
    }
}

.order-history__empty {
    color: color-mix(in srgb, currentColor 60%, transparent);
    padding: var(--space-4) 0;
}
