.shop-cart { color: #212529; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.cart-heading h2 { margin: 0; }
.cart-items { display: grid; gap: 20px; align-content: start; min-width: 0; }
.cart-card, .cart-summary { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; min-width: 0; }
.cart-item-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "preview preview" "details details" "delivery delivery" "actions price"; gap: 12px 16px; }
.cart-preview { grid-area: preview; background: #f8f9fa; border-radius: 8px; padding: 0; text-align: center; }
.cart-preview:empty { display: none; }
.cart-preview a { display: block; }
.cart-preview img { width: 100%; height: 170px; object-fit: contain; }
.cart-details { grid-area: details; min-width: 0; overflow-wrap: anywhere; }
.cart-details h3 { font-weight: 700; line-height: 1.4; margin-bottom: 4px; }
.cart-details h3 a { color: inherit; }
.cart-details h3 a:hover { text-decoration: underline !important; }
.cart-specs { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; font-size: .85rem; line-height: 1.7; }
.cart-price { grid-area: price; min-width: 0; text-align: right; }
.cart-price p:last-child { margin-bottom: 0; }
.cart-price nobr { white-space: normal; }
.cart-actions { grid-area: actions; min-width: 0; }
.cart-actions > div { flex-direction: column; align-items: flex-start !important; }
.cart-actions > div > div { max-width: 100%; }
.cart-description { font-size: .95rem; font-weight: 400; }
.cart-description[data-expand-label] { display: block; white-space: pre-line; }
.cart-description.is-collapsed { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cart-description-toggle { display: block; padding: 0; border: 0; background: transparent; color: #075bb5; text-decoration: underline; font-size: .85rem; }
.cart-description-toggle[hidden] { display: none; }
.cart-delivery { grid-area: delivery; font-size: .85rem; border-bottom: 1px solid #e5e7eb; padding-bottom: 12px; }
.cart-delivery p { margin: 0; }
.cart-price .text-dark { display: block; font-size: .8rem; }
.cart-price .text-dark > strong { display: block; font-size: 1.1rem; }
.cart-price .text-dark > nobr { display: block; }
.cart-price .price-label { display: block; }
.cart-price .price-value { display: block; font-size: 1.25rem; font-weight: 700; }
.cart-price p:first-of-type > br { display: none; }
.cart-price .text-dark + br + .text-dark { margin-top: 6px; }
.cart-price .h4, .cart-price strong { font-weight: 700; }
.cart-price .h4 { font-size: 1.25rem; }
.cart-field-label { display: block; font-size: .85rem; color: #6c757d; margin-bottom: 6px; }
.cart-quantity { width: 152px; max-width: 100%; }
.cart-quantity input::-webkit-inner-spin-button, .cart-quantity input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cart-quantity input { -moz-appearance: textfield; }
.cart-quantity .form-control { min-height: 44px; }
.cart-actions .btn { min-height: 44px; }
.cart-actions .confirmation { min-width: 44px; }
.cart-summary { align-self: start; }
.cart-summary:empty { display: none; }
.cart-summary .cart-total { border-top: 1px solid #e5e7eb; padding-top: 20px; margin-top: 20px; font-size: 1.1rem; }
.cart-total strong { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.cart-total .h3 { margin: 0 0 0 auto; font-weight: 700; }
.cart-extra { min-width: 0; }
.shop-cart input:focus-visible, .shop-cart a:focus-visible, .shop-cart button:focus-visible { outline: 3px solid #ffc107; outline-offset: 3px; }
@media (min-width: 992px) {
    .cart-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 40%); gap: 24px; }
    .cart-heading, .cart-extra { grid-column: 1 / -1; }
}

.cart-quantity { border: 1px solid #dee2e6; border-radius: .375rem; overflow: hidden; flex-wrap: nowrap; background: #f8f9fa; }
.cart-quantity > .btn { border: 0; border-radius: 0; margin: 0 !important; width: 44px !important; flex: 0 0 44px; padding: 0; color: #495057; background: #f8f9fa; }
.cart-quantity > .form-control { border: 0; border-inline: 1px solid #dee2e6; border-radius: 0; margin: 0 !important; min-width: 0; width: auto !important; flex: 1 1 0; padding-inline: 2px; background: #fff !important; }
.cart-quantity > .btn:disabled { opacity: 1; color: #868e96; background: #f8f9fa; }
.cart-summary [aria-disabled="true"] { opacity: .65; cursor: wait; }


.cart-actions .cart-remove { display: inline-flex; align-items: center; gap: 8px; padding: 6px 2px; border: 0; background: transparent; color: #6c757d; font-size: .85rem; box-shadow: none; }
.cart-remove span { text-decoration: underline; text-underline-offset: 2px; }
.cart-actions .cart-remove:hover { color: #212529; background: transparent; }
.cart-actions .cart-remove:disabled { opacity: .6; }
.cart-quantity > .btn:not(:disabled):hover { background: #e9ecef; }

.cart-price .price-unit > strong, .cart-price .price-unit .h4 { font-size: 1.1rem; font-weight: 400; }

/* Desktop: image and details above the shared quantity/price section. */
@media (min-width: 992px) {
    body { overflow-x: clip; overflow-y: visible; }
    .cart-summary { position: sticky; top: 96px; max-height: calc(100dvh - 112px); overflow-y: auto; }
    .cart-item-layout {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-template-areas: "preview preview details details details details" "preview preview delivery delivery delivery delivery" "divider divider divider divider divider divider" "actions actions actions price price price";
        grid-template-rows: auto 1fr auto auto;
    }
    .cart-item-layout::after { content: ""; grid-area: divider; border-top: 1px solid #e5e7eb; }
    .cart-preview { align-self: start; }
    .cart-preview img { height: 170px; }
    .cart-quantity { width: 124px; }
    .cart-quantity > .btn { width: 36px !important; flex-basis: 36px; min-height: 36px; }
    .cart-quantity > .form-control { min-height: 36px; padding-block: 4px; }
    .cart-delivery { border-bottom: 0; padding-bottom: 0; }
    .cart-item-layout:not(:has(.cart-preview)) { grid-template-areas: "details details details details details details" "delivery delivery delivery delivery delivery delivery" "divider divider divider divider divider divider" "actions actions actions price price price"; }
}

.cart-group-heading { display: grid; gap: 12px; padding-bottom: 16px; }
.cart-group-heading .cart-delivery { border: 0; padding: 0; grid-area: auto; }
.cart-group-heading .cart-details { grid-area: auto; }
.cart-group-design { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding-block: 16px; border-top: 1px solid #e5e7eb; align-items: start; }
.cart-group-design .cart-preview { grid-area: auto; width: 100%; max-width: 220px; }
.cart-group-design .cart-actions { grid-area: auto; }
.cart-group-footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #e5e7eb; padding-top: 16px; }
.cart-group-quantity { font-size: 1.1rem; }
@media (min-width: 992px) {
    .cart-group-heading { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 575.98px) {
    .cart-group-design .cart-quantity { width: 124px; }
    .cart-group-design .cart-quantity > .btn { width: 36px !important; flex-basis: 36px; }
    .cart-group-design .cart-preview img { height: 130px; }
}
