.cart-page {
    padding-top: 28px;
    padding-bottom: 56px;
}

.cart-page:has(.cart-empty) {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--cart-page-top, 0px));
}

.cart-page:has(.cart-empty) > div:last-child,
#cart-contents:has(.cart-empty) {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 24px;
}

.cart-items {
    display: grid;
    gap: 16px;
}

.cart-item,
.cart-summary {
    border: 1px solid #eee;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 18px rgb(0 0 0 / 4%);
}

.cart-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 24px;
}

.cart-item-image {
    display: block;
    height: 120px;
    overflow: hidden;
    border-radius: 14px;
    background: #f6f6f6;
}

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

.cart-item-info h2 {
    font-size: 18px;
    overflow-wrap: anywhere;
}

.cart-item-info a {
    color: inherit;
    text-decoration: none;
}

.cart-item-info a:hover {
    color: var(--brand-red);
}

.cart-item-info p,
.cart-line-weight {
    margin: 0;
    color: #737373;
    font-size: 14px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-item-quantity {
    width: 144px;
    text-align: center;
}

.cart-line-weight {
    display: block;
    margin-top: 6px;
}

.cart-line-price {
    margin: 0;
    min-width: 100px;
    text-align: right;
    color: var(--brand-red);
    font-size: 22px;
    font-weight: 600;
}

.cart-line-price span {
    font-size: 14px;
}

.order-item-quantity {
    display: block;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f6f6f6;
    font-weight: 500;
}

.order-status {
    display: grid;
    gap: 4px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f6f6f6;
}

.order-status .checkout-hint {
    margin: 0;
}

.cart-remove {
    width: 40px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #737373;
}

.cart-remove:hover {
    background: #fff1f1;
    color: var(--brand-red);
}

.cart-summary {
    padding: 24px;
}

.cart-summary h2 {
    margin-bottom: 28px;
    font-size: 24px;
}

.cart-summary dl > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.cart-summary dt {
    color: #737373;
    font-weight: 400;
}

.cart-summary dd {
    margin: 0;
    text-align: right;
}

.cart-summary .cart-total {
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 24px;
}

.cart-total dd {
    color: var(--brand-red);
    font-weight: 600;
}

.cart-summary-note {
    padding: 14px;
    border-radius: 12px;
    background: #fff1f1;
    color: #a90000;
    font-size: 14px;
}

.cart-checkout {
    min-height: 48px;
    text-align: center;
    text-decoration: none;
}

.checkout-fields,
.checkout-order-items {
    padding: 28px;
    border: 1px solid #eee;
    border-radius: 20px;
    background: #fff;
}

.checkout-fields h2 {
    font-size: 24px;
}

.checkout-field {
    margin-bottom: 20px;
}

.checkout-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.checkout .form-control {
    min-height: 48px;
    border-radius: 12px;
    font-size: 16px;
}

.checkout .form-control:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgb(216 0 4 / 10%);
}

.checkout .form-control[readonly] {
    background: #f6f6f6;
    color: #737373;
}

.checkout-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.6;
}

.checkout-consent input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--brand-red);
    cursor: pointer;
}

.checkout-consent a {
    text-underline-offset: 3px;
}

.checkout-hint {
    margin-top: 8px;
    color: #737373;
    font-size: 13px;
}

.checkout-back {
    color: var(--brand-red);
    white-space: nowrap;
    font-size: 14px;
}

.checkout-contact-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.checkout-address {
    position: relative;
}

.address-suggestions {
    position: absolute;
    top: 82px;
    z-index: 10;
    width: 100%;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 28px rgb(0 0 0 / 12%);
}

.address-suggestions button {
    appearance: none;
    color: #111;
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid #eee;
    background: white;
    text-align: left;
}

.address-suggestions button:hover,
.address-suggestions button:focus-visible {
    background: #fff1f1;
    color: var(--brand-red);
}

.address-suggestions small {
    display: block;
    color: #737373;
}

.checkout-order-line {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-block: 14px;
    border-bottom: 1px solid #eee;
    color: #737373;
    font-size: .9rem;
}

.checkout-order-line strong {
    white-space: nowrap;
}

.checkout [disabled] {
    cursor: wait;
    opacity: .6;
}

@media (max-width: 575.98px) {
    .checkout-fields,
    .checkout-order-items {
        padding: 16px;
    }

    .checkout-contact-fields {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
}

.cart-empty {
    margin-block: auto;
    padding: 48px 16px;
    text-align: center;
}

.cart-empty > i {
    display: block;
    margin-bottom: 20px;
    font-size: 48px;
}

@media (max-width: 1399.98px) {
    .cart-item {
        grid-template-columns: 100px minmax(0, 1fr);
    }

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

    .cart-item-controls {
        grid-column: 1 / -1;
        justify-content: space-between;
    }
}

@media (max-width: 991.98px) {
    .cart-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575.98px) {
    .cart-item,
    .cart-summary {
        padding: 16px;
    }

    .cart-item-controls {
        flex-wrap: wrap;
        gap: 12px;
    }

    .cart-item-quantity {
        width: 128px;
    }

    .cart-line-price {
        min-width: 0;
        font-size: 18px;
    }
}
