.cart-table {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.cart-row {
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    align-items: center;
    gap: var(--space-sm);
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-sm);
}

.cart-row__image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.cart-row__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-row__name {
    font-weight: 700;
}

.cart-row__price {
    color: var(--color-text-light);
    font-size: 0.85rem;
}

.cart-row__quantity-form {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.cart-row__quantity-label {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.cart-row__quantity-input {
    width: 60px;
    padding: 4px 6px;
    text-align: center;
}

.cart-row__subtotal {
    font-weight: 700;
    color: var(--color-primary-dark);
    white-space: nowrap;
}

.cart-row__remove {
    color: var(--color-danger);
    font-size: 1.1rem;
}

.discount-panel {
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
}

.discount-panel__form {
    display: flex;
    gap: var(--space-sm);
}

.discount-panel__form .form-control {
    flex: 1;
}

.discount-panel__applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.cart-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
}

.cart-summary__lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.cart-summary__line {
    display: flex;
    justify-content: space-between;
}

.cart-summary__line--discount {
    color: var(--color-danger);
    font-weight: 700;
}

.cart-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-sm);
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--space-lg);
    align-items: start;
}

.checkout-form-wrapper {
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-md);
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 4px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.checkout-summary {
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-md);
    position: sticky;
    top: 90px;
}

.checkout-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--color-text-light);
}

.checkout-summary__total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-sm);
    margin-top: var(--space-sm);
    color: var(--color-primary-dark);
}

.checkout-summary__row--discount {
    color: var(--color-danger);
    font-weight: 700;
}

.discount-panel--checkout {
    box-shadow: none;
    padding: var(--space-sm) 0;
    margin-bottom: 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
}

.checkout-success {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

.checkout-success__icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
}

.checkout-success__items {
    text-align: right;
    margin: var(--space-md) 0;
}

@media (max-width: 900px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .cart-row {
        grid-template-columns: 60px 1fr;
        grid-template-areas:
            "image info"
            "image quantity"
            "image subtotal"
            "image remove";
    }

    /*
        The rule above names 5 grid areas, but nothing assigned any child
        to them - browsers ignore the names without a matching grid-area,
        so children fell back to implicit auto-placement (2 columns,
        filled row by row) instead of the intended "image column stays
        put, everything else stacks beside it" layout. Wiring these up so
        the mobile cart row actually renders as designed.
    */
    .cart-row__image { grid-area: image; }
    .cart-row__info { grid-area: info; }
    .cart-row__quantity-form { grid-area: quantity; }
    .cart-row__subtotal { grid-area: subtotal; }
    .cart-row__remove-form { grid-area: remove; }
}
