.cart-dialog {
    width: min(560px, calc(100vw - 24px));
    max-height: 92dvh;
    margin: auto;
    padding: 0;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overscroll-behavior: contain;
}

.cart-dialog::backdrop {
    background: #20252b88;
}

.dialog-heading {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.dialog-heading h2, .cart-empty h3 {
    font-size: 23px;
}

.cart-empty {
    padding: 40px 20px;
    text-align: center;
}

.cart-empty > .icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 22px;
    color: var(--brand);
}

.cart-empty > .button {
    margin-top: 18px;
}

.mm-cart-dialog-items {
    padding-inline: 16px;
}

.mm-cart-dialog-status {
    padding: 16px 20px;
    font-size: 14px;
}

.mm-cart-dialog-error {
    color: var(--sale);
}

.cart-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    padding-block: 20px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.cart-item-image {
    width: 64px;
    height: 84px;
    display: grid;
    place-items: center;
}

.cart-item-image img {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-item-name {
    display: flex;
    align-items: flex-start;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
}

.cart-item-name:hover {
    color: var(--brand);
    text-decoration: underline;
}

.cart-item-price {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.cart-item-total {
    grid-column: 2;
    font-size: 16px;
    font-weight: 750;
}

.cart-remove {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--brand);
    background: transparent;
    border: 0;
    font-size: 13px;
    text-decoration: underline;
}

.mm-cart-quantity {
    display: inline-flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #8c929b;
    border-radius: 6px;
}

.mm-cart-quantity button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 6px;
    background: transparent;
    border: 0;
    font-size: 20px;
}

.mm-cart-quantity button:disabled, .cart-remove:disabled {
    opacity: .55;
}

.mm-cart-quantity input {
    appearance: textfield;
    width: 52px;
    min-width: 0;
    padding: 4px;
    color: var(--ink);
    background: #fff;
    border: 0;
    border-inline: 1px solid var(--line);
    font: inherit;
    text-align: center;
}

.mm-cart-quantity input::-webkit-inner-spin-button,
.mm-cart-quantity input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

.cart-summary {
    display: grid;
    gap: 10px;
    padding: 20px;
    background: var(--steel);
}

.cart-summary > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    overflow-wrap: anywhere;
}

.cart-summary strong {
    font-size: 23px;
}

.cart-summary > .button {
    width: 100%;
}

.cart-toast {
    position: fixed;
    z-index: 45;
    inset: auto 16px 16px;
    max-width: 500px;
    margin-left: auto;
    padding: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 40px #20252b25;
}

.cart-toast > span {
    color: var(--success);
}

.cart-toast p {
    flex: 1 1 105px;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.cart-toast.is-error > span, .cart-toast.is-error p {
    color: var(--sale);
}

.cart-toast .button {
    flex-shrink: 0;
    padding-inline: 10px;
    font-size: 13px;
}

@media (min-width: 700px) {
    .cart-item {
        grid-template-columns: 80px minmax(0, 1fr);
        gap: 12px 18px;
    }

    .cart-item-image {
        width: 80px;
        height: 100px;
    }

    .cart-toast {
        right: 24px;
        bottom: 24px;
    }
}
