.commerce-cart-page {
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
    padding: clamp(1rem, 3vw, 2rem);
    box-sizing: border-box;
    container: commerce-cart / inline-size;
}

.commerce-cart {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
    color: #273449;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.commerce-cart *, .commerce-cart *::before, .commerce-cart *::after {
    box-sizing: border-box;
}

.commerce-cart__header, .commerce-cart__empty { grid-column: 1 / -1; }
.commerce-cart h1, .commerce-cart h2, .commerce-cart h3 { font-family: inherit; color: inherit; }
.commerce-cart h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; line-height: 1.25; }
.commerce-cart h2, .commerce-cart legend { margin: 0 0 1rem; padding: 0; font-size: 1.125rem; font-weight: 650; line-height: 1.4; }
.commerce-cart h3 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.5; }
.commerce-cart p { margin: 0 0 1rem; }
.commerce-cart p:last-child { margin-bottom: 0; }
.commerce-cart a { color: #6d28d9; }
.commerce-cart a:hover { color: #4c1d95; text-decoration: underline; }
.commerce-cart__form { display: grid; gap: 1.25rem; min-width: 0; margin: 0; }

.commerce-cart__panel, .commerce-cart__empty {
    min-width: 0;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 2px 6px rgb(15 23 42 / 3%);
}

.commerce-cart__items { min-width: 0; }
.commerce-cart-item { min-width: 0; padding-block: 1.25rem; }
.commerce-cart-item:first-child { padding-top: 0; }
.commerce-cart-item:last-child { padding-bottom: 0; }
.commerce-cart-item + .commerce-cart-item { border-top: 1px solid #e2e8f0; }
.commerce-cart-item__product { display: flex; align-items: flex-start; gap: 1rem; min-width: 0; }
.commerce-cart-item__description { flex: 1; min-width: 0; }
.commerce-cart-item__image { display: block; flex: 0 0 clamp(3.5rem, 10vw, 5rem); }
.commerce-cart-item__image img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: .625rem; background: #f8fafc; }
.commerce-cart-item__attributes { margin: .5rem 0 0; padding: 0; list-style: none; font-size: .875rem; color: #64748b; }
.commerce-cart-item__free { display: inline-block; margin-top: .5rem; padding: .15rem .6rem; border-radius: 1rem; background: #f3e8ff; color: #6b21a8; font-size: .8125rem; font-weight: 600; }
.commerce-cart-item__details { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem 2rem; margin-top: 1.25rem; }
.commerce-cart-item__quantity { flex: 0 1 9rem; min-width: 0; }
.commerce-cart-item label, .commerce-cart-item dt { display: block; margin: 0 0 .4rem; color: #64748b; font-size: .8125rem; font-weight: 500; }
.commerce-cart-item__stepper { display: flex; width: 9rem; max-width: 100%; border: 1px solid #cbd5e1; border-radius: .625rem; overflow: hidden; }
.commerce-cart-item__stepper button { flex: 0 0 2.75rem; border: 0; background: #f8fafc; color: #334155; font-size: 1.25rem; cursor: pointer; }
.commerce-cart-item__stepper input { min-width: 0; width: 100%; height: 2.75rem; padding: .25rem; border: 0; border-inline: 1px solid #e2e8f0; border-radius: 0; background: #fff; color: #273449; text-align: center; font: inherit; font-size: 1rem; appearance: textfield; }
.commerce-cart-item__stepper input::-webkit-inner-spin-button, .commerce-cart-item__stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.commerce-cart-item__actions { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.commerce-cart-item__actions button { min-height: 2.75rem; padding: .25rem 0; border: 0; background: transparent; color: #6d28d9; font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; }
.commerce-cart-item__actions .commerce-cart-item__remove { color: #64748b; }
.commerce-cart-item__actions button:hover { text-decoration: underline; }
.commerce-cart-item__prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 1 1 12rem; gap: 1rem; margin: 0; }
.commerce-cart-item__prices dd { margin: 0; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.commerce-cart-item__prices del { display: block; color: #64748b; font-size: .8125rem; }
.commerce-cart-item__total { font-weight: 700; }
.commerce-cart__muted { color: #64748b; font-size: .875rem; }
.commerce-cart-notice { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: .625rem; background: #fff7ed; color: #9a3412; overflow-wrap: anywhere; }
.commerce-cart-item .commerce-cart-notice { margin: .5rem 0 0; }

.commerce-cart__totals { margin: 0 0 1.25rem; }
.commerce-cart__totals > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; padding-block: .5rem; }
.commerce-cart__totals dt { font-weight: 400; }
.commerce-cart__totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.commerce-cart__totals .commerce-cart__total { margin-top: .75rem; padding-top: 1rem; border-top: 1px solid #e2e8f0; font-size: 1.125rem; }
.commerce-cart__total dt { font-weight: 700; }
.commerce-cart__checkout { display: grid; gap: 1rem; min-width: 0; }
.commerce-cart__checkout form { margin: 0; }
.commerce-cart__checkout .row { display: block; margin: 0; }
.commerce-cart__checkout .col { width: 100%; min-width: 0; padding: 0; }
.commerce-cart__checkout-provider { min-width: 0; text-align: center; font-size: .8125rem; color: #64748b; }
.commerce-cart__checkout-provider img { display: block; max-width: 100%; height: auto; margin: .75rem auto 0; }
.commerce-cart .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; max-width: 100%; margin: 0; padding: .75rem 1rem; border: 1px solid transparent; border-radius: .625rem; background: #6d28d9; color: #fff; box-shadow: none; font-size: .875rem; font-weight: 600; line-height: 1.4; text-transform: none; white-space: normal; text-decoration: none; }
.commerce-cart .btn:hover { background: #5b21b6; color: #fff; text-decoration: none; }
.commerce-cart .btn:disabled { opacity: .5; cursor: not-allowed; }
.commerce-cart__checkout .btn { width: 100%; }
.commerce-cart .material-icons { flex-shrink: 0; }
.commerce-cart :is(a, button, input, select):focus-visible { outline: 2px solid #7c3aed; outline-offset: 3px; }
.commerce-cart-item__stepper:focus-within { outline: 2px solid #7c3aed; outline-offset: 2px; }

.commerce-cart fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.commerce-cart .shipping-info > p { color: #64748b; font-size: .875rem; }
.commerce-cart__delivery-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; }
.commerce-cart .form-group { margin: 0 0 1rem; padding: 0; }
.commerce-cart .shipping-info label, .commerce-cart-coupon label { display: block; margin: 0 0 .5rem; color: #334155; font-size: .875rem; font-weight: 500; }
.commerce-cart .form-control { display: block; width: 100%; min-width: 0; height: 2.875rem; padding: .625rem .75rem; border: 1px solid #cbd5e1; border-radius: .625rem; background: #fff; color: #273449; box-shadow: none; font-size: 1rem; line-height: 1.5; }
.commerce-cart select.form-control { appearance: auto; padding-right: 1.75rem; }
.commerce-cart-shipping-option { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .75rem; padding: .875rem; border: 1px solid #e2e8f0; border-radius: .625rem; cursor: pointer; font-size: .9375rem; }
.commerce-cart-shipping-option input { flex: 0 0 1.125rem; width: 1.125rem; height: 1.125rem; margin: .125rem 0 0; accent-color: #6d28d9; }
.commerce-cart-shipping-option:has(input:checked) { border-color: #8b5cf6; background: #faf5ff; }
.commerce-cart .estimate-shipping { width: 100%; }
.commerce-cart-coupon { padding-bottom: 1rem; border-bottom: 1px solid #e2e8f0; }
.commerce-cart-coupon__fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: .5rem; }
/* Material Design wraps the input after loading; its floating-label padding offsets this row. */
.commerce-cart-coupon__fields > .bmd-form-group { min-width: 0; margin: 0; padding: 0; }
.commerce-cart-coupon__fields .form-control { width: 100%; min-width: 0; height: 2.875rem; margin: 0; }
.commerce-cart-coupon__fields .btn { width: auto; min-width: 5rem; height: 2.875rem; min-height: 2.875rem; padding: 0 1rem; white-space: nowrap; }
.commerce-cart-coupon .commerce-cart-notice { margin-top: .75rem; }

@container commerce-cart (min-width: 56rem) {
    .commerce-cart { grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.5rem; }
    .commerce-cart__summary { position: sticky; top: 1.5rem; }
    .commerce-cart .estimate-shipping { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .commerce-cart * { transition: none; }
}
