/* =========================================================================
   LAVACASCADE — css/sections/cart.css
   The cart: server rows on the left (built by js/components/cart-page.js),
   sticky summary + checkout on the right, and the empty state.
   ========================================================================= */

/* =========================================
   LAYOUT
   ========================================= */
.cart {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: start;
    gap: var(--space-6);
}

.cart__items {
    display: grid;
    gap: var(--space-5);
    justify-items: start;
}

.cart__list {
    display: grid;
    gap: var(--space-3);
    width: 100%;
    padding: 0;
    list-style: none;
}

/* =========================================
   ONE CART ROW
   ========================================= */
.cart-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
}

.cart-item__block {
    width: 40px;
    height: 40px;
    background: var(--grad-molten);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 2px 0 rgba(255, 220, 180, 0.35), inset 0 -3px 0 rgba(80, 20, 0, 0.45);
}

.cart-item__name {
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--text-strong);
    overflow-wrap: anywhere;
}

.cart-item__meta {
    margin-top: 2px;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.cart-item__side {
    display: grid;
    justify-items: end;
    gap: var(--space-1);
}

.cart-item__price {
    font-weight: 700;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
}

.cart-item__price small {
    font-weight: 500;
    color: var(--text-muted);
}

/* =========================================
   SUMMARY
   ========================================= */
.cart__summary {
    position: sticky;
    top: calc(var(--header-h) + var(--space-5));
    display: grid;
    gap: var(--space-4);
}

.cart__summary-title {
    font-size: var(--fs-h3);
}

.cart__totals {
    display: grid;
    gap: var(--space-2);
}

.cart__totals div {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
}

.cart__totals dt {
    color: var(--text-muted);
}

.cart__totals dd {
    margin: 0;
    font-weight: 600;
    color: var(--text-strong);
}

.cart__total {
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}

.cart__total dd {
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
}

.cart__renew,
.cart__secure {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.cart__secure {
    display: flex;
    gap: var(--space-2);
}

.cart__secure .icon {
    width: 16px;
    height: 16px;
    color: var(--lava-400);
}

/* =========================================
   EMPTY STATE
   ========================================= */
.cart-empty {
    display: grid;
    justify-items: center;
    gap: var(--space-4);
    max-width: 520px;
    margin-inline: auto;
    padding-block: var(--space-8);
    text-align: center;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 960px) {
    .cart {
        grid-template-columns: 1fr;
    }

    /* relative, not static: the card's molten top line is positioned against it */
    .cart__summary {
        position: relative;
        top: auto;
    }
}

@media (max-width: 520px) {
    .cart-item {
        grid-template-columns: auto 1fr;
    }

    .cart-item__side {
        grid-column: 1 / -1;
        grid-template-columns: 1fr auto;
        align-items: center;
        justify-items: start;
    }
}
