.custom-cart-items {
    display: flex;
    flex-direction: column;
}

.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    padding: 30px 0;
    border-bottom: 1px solid #e5e5e5;
}

.cart-item:first-child {
    padding-top: 0;
}

.cart-item:last-child {
    border-bottom: none;
}
.cart-item-thumb {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    overflow: hidden;
}

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

.cart-item-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
    gap: 0 20px;
    min-height: 120px;
}

.cart-item-info {
    grid-column: 1;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    /* justify-content: space-between; */
}

.cart-item-name {
    color: #000;
    font-family: "Bebas Neue";
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    text-transform: uppercase;
    }

.cart-item-name:hover {
    color: #5c4a3d;
}

.cart-item-delivery {
    font-size: 14px;
    color: #333;
    margin: 4px 0 0 0;
    justify-content: flex-start !important;
}

.cart-item-delivery,
.cart-item-delivery strong {
    display: inline;
}

.cart-item-delivery strong {
    color: #333;
    font-weight: 600;
    margin-right: 5px;
}

.cart-item-qty {
    display: inline-flex;
    border: 1px solid #ccc;
    margin-top: 10px;
    width: fit-content;
}

/* Per-unit price line, shown under the line total when quantity >= 2 */
.cart-item-unit {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #777;
    margin-top: 2px;
}

.qty-btn {
    width: 32px;
    height: 34px;
    background: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #333;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #f5f5f5;
}

.qty-input {
    width: 40px;
    height: 34px;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    text-align: center;
    font-size: 14px;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.cart-item-end {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.remove-item {
    background: none;
    border: none;
    font-size: 22px;
    font-weight: 400;
    color: #d64545;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: opacity 0.2s;
}

.remove-item:hover {
    opacity: 0.7;
}

.cart-item-total {
    font-size: 16px;
    color: #333;
    font-weight: 400;
}

.cart-loader {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 9999;
}

.cart-loader.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-loader::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #5c4a3d;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty cart */
.custom-cart-empty {
    text-align: center;
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.custom-cart-empty p {
    color: #000;
    margin-bottom: 20px;
	font-family: "Bebas Neue";
    font-weight: normal;
    font-size: 40px;
}

.empty-cart-btn {
    display: inline-block;
    background: #007A4D !important;
    color: #fff !important;
    padding: 12px 60px;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: normal;
	transition: all 0.3s ease;
    font-family: "Bebas Neue";
    font-size: 24px;
}

.empty-cart-btn:hover {
    background: #000 !important;
    color: #fff !important;
	transition: all 0.3s ease;
}

.cart-item-options {
    margin: 6px 0 0 0;
}

.cart-item-options dl.variation {
    margin: 0;
    padding: 0;
}

.cart-item-options dl.variation dt,
.cart-item-options dl.variation dd {
    display: inline;
    margin: 0;
    color: #000;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-style: normal;
    line-height: normal;
}

.cart-item-options dl.variation dt {
    font-weight: 700;
}

.cart-item-options dl.variation dd {
    font-weight: 400;
}

/* Line break after each value to get one option per row */
.cart-item-options dl.variation dd::after {
    content: "";
    display: block;
}

.cart-item-options dl.variation dd p {
    margin: 0;
    padding: 0;
    display: inline;
    font: inherit;
    color: inherit;
}

.page-winkelwagen.cart-is-empty .dsm_icon_list.bullitpoints {
    display: none !important;
}

/* Mobile view (0 - 981px) */
@media (max-width: 981px) {
    /* 2 columns: bigger thumbnail + content. The remove button is pinned
       top-right with position:absolute, so it no longer claims a 3rd column
       and the photo gets more room. */
    .cart-item {
        display: grid;
        grid-template-columns: 110px 1fr;
        gap: 0 15px;
        padding: 20px 0;
        position: relative;
    }

    .cart-item-thumb {
        grid-column: 1;
        grid-row: 1;
        width: 110px;
        height: 110px;
    }

    .cart-item-content {
        grid-column: 2;
        grid-row: 1;
        /* dissolve the content wrapper so info-children and end-children
           live in one shared flex column */
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-height: 0;
    }

    /* info + end both become transparent so their children flow into
       .cart-item-content's flex column */
    .cart-item-info {
        display: contents;
    }

    .cart-item-end {
        display: contents;
    }

    /* Explicit vertical order: name -> options -> PRICE -> qty stepper */
    .cart-item-name   { order: 1; font-size: 19px; }
    .cart-item-options { order: 2; }
    .cart-item-total  { order: 3; font-size: 14px; color: #000; }
    .cart-item-qty    { order: 4; margin-top: 4px; }

    .cart-item-delivery { display: none; }

    /* Remove button out of flow, pinned to the top-right corner of the item */
    .remove-item {
        position: absolute;
        right: 0;
        font-size: 22px;
        line-height: 1;
        z-index: 2;
    }

    #ww-checkout-totals .et_pb_blurb:not(#cadeau-coupon) {
        display: none !important;
    }

    #ww-checkout-products .et_pb_blurb {
        display: block !important;
    }
}

/* Desktop/tablet landscape view (982px+) */
@media (min-width: 982px) {

    #ww-checkout-products .et_pb_blurb {
        display: none !important;
    }
    #ww-checkout-totals .et_pb_blurb {
        display: block !important;
    }

    body.page-winkelwagen-2,
    body.page-winkelwagen-2 #page-container {
        overflow: visible !important;
        overflow-x: clip !important;
    }

    .et_pb_row:has(#ww-checkout-totals) {
        align-items: flex-start !important;
    }

    #ww-checkout-totals.et_pb_column {
        position: sticky !important;
        top: 260px !important;
    }
}

#ga-verder-met-bestellen,
#ga-verder-met-bestellen .et_pb_button_module_wrapper,
#ga-verder-met-bestellen .et_pb_button_module_wrapper a {
    width: 100% !important;
    display: block !important;
}

a#ga-verder-met-bestellen,
#ga-verder-met-bestellen .et_pb_button,
#ga-verder-met-bestellen .et_pb_button_module_wrapper a.et_pb_button {
    width: 100% !important;
    text-align: center !important;
}

#ww-checkout-totals .et_pb_text_inner p {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.cart-total-display {
    margin-left: auto !important;
}

* Verberg de H1 titel wanneer winkelwagen leeg is */
.et_pb_text:has(.custom-cart-empty) ~ .et_pb_post_title,
.et_pb_row:has(.custom-cart-empty) .et_pb_post_title,
body:has(.custom-cart-empty) .et_pb_post_title_0 {
    display: none !important;
}

body:has(.custom-cart-empty) #ww-checkout-totals {
    display: none !important;
}

body:has(.custom-cart-empty) #ww-checkout-products {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

body:has(.custom-cart-empty) #ww-checkout-products .et_pb_blurb {
    display: none !important;
}

body:has(.custom-cart-empty) .et_pb_row:has(#ww-checkout-products) {
    justify-content: center !important;
}

body:has(.custom-cart-empty) .et_pb_row_0 {
    display: none !important;
}

body:has(.custom-cart-empty) .custom-cart-empty {
    padding: 80px 20px;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body.cart-is-empty .et_pb_post_title_0 {
    display: none !important;
}

body.cart-is-empty #ww-checkout-totals {
    display: none !important;
}

body.cart-is-empty #ww-checkout-products {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

body.cart-is-empty #ww-checkout-products .et_pb_blurb {
    display: none !important;
}

body.cart-is-empty .et_pb_row_0 {
    display: none !important;
}

.custom-cart-empty .empty-subtitle {
    font-size: 12px;
    color: #000;
    margin-bottom: 30px;
    font-weight: 400;
	font-family: 'inter', sans-serif;
}

.empty-title {
	padding-bottom: 0px !important;
	line-height: 1.2em;
}

.variation-Typelevering {
    display: none !important;
}

/* Side-by-side layout for empty cart action buttons */
.empty-cart-buttons {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Force both buttons to the same width regardless of label length */
.empty-cart-buttons .empty-cart-btn {
    flex: 1 1 0;
    min-width: 280px;
    max-width: 280px;
    text-align: center;
    box-sizing: border-box;
    text-wrap: nowrap;
}


@media (max-width: 530px) {
    .cart-item-options dl.variation dt,
    .cart-item-options dl.variation dd {
        font-size: 12px;
    }

    .cart-item-thumb {
        width: 80px;
        height: 80px;
    }
    .cart-item {
        grid-template-columns: 80px 1fr auto;
    }

    .empty-cart-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        gap: 15px;
    }

    .empty-cart-buttons .empty-cart-btn {
        width: 100%;
        min-width: 100%;
        padding: 12px 20px;
    }
}

@media (max-width: 350px) {
    .page-winkelwagen #main-content .et_pb_row  {
        width: 90% !important;
    }
}
