/* ================================
   GLOBAL SAFETY (VERY IMPORTANT)
================================ */
*, *::before, *::after {
    box-sizing: border-box;
}


/* ================================
   CUSTOM CART PAGE WRAPPER
================================ */
.custom-cart-page {
    margin-top: 5px;
    width: 100%;
    padding-inline: 20px;
    margin-bottom: 50px;
}

@media (min-width: 1400px) {
    .custom-cart-page {
        padding-inline: 40px;
    }
}

.custom-cart-inner {
    max-width: 1400px;
    margin-inline: auto;
    width: 100%;
}


/* ================================
   CART ITEMS LAYOUT
================================ */
.cart-items,
.cart-items-wrapper {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

@media (min-width: 1024px) {
    .cart-items {
        flex-direction: row;
        align-items: flex-start;
    }
}


/* ================================
   CART ITEM
================================ */
.cart-item {
    display: flex;
    gap: 16px;
}

.cart-item-contents {
    width: 100%;
    display: flex;
    gap: 20px;
}

.cart-item-container {
    display: flex;
    justify-content: space-between;
    align-items: center; /* final intended behavior */
    gap: 20px;
    flex: 1;
}


/* ================================
   LEFT SIDE (IMAGE + INFO + QTY)
================================ */
.cart-itemNqty {
    display: flex;
    gap: 20px;
    flex: 1;
    min-width: 0; /* CRITICAL */
}

@media (max-width: 700px) {
    .cart-itemNqty {
        flex-direction: column;
        gap: 10px;
    }
}

.cart-item-info-container {
    display: flex;
    gap: 20px;
    flex: 1;
    min-width: 0; /* VERY IMPORTANT */
}


/* ================================
   PRODUCT IMAGE (ALL TYPES)
================================ */
.cart-item-image,
.cb-main-image,
.cb-part-image {
    width: 96px;
    height: 96px;
    background: #f2f2f2;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img,
.cb-main-image img,
.cb-part-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* ================================
   PRODUCT INFO
================================ */
.cart-item-name {
        text-decoration: none;
        color: inherit;
}

.product-name{
    line-height: 1.1;


    margin-bottom: 8px;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    -webkit-font-smoothing: antialiased;

    min-width: 0;
    flex: 1;
}

.product-details{
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: black;
}






/* ================================
   CUSTOM BUILD STRUCTURE
================================ */
.custom-build-wrapper {
    margin-bottom: 40px;
}

.custom-build-main {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.cb-main-details h3 {
    margin: 0 0 10px;
}

.custom-build-parts {
    margin-top: 25px;
    margin-left: 40px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.custom-build-part {
    display: flex;
    gap: 15px;
    align-items: center;
}







/* ================================
   QUANTITY CONTROLS
================================ */
.cart-item-qty {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    align-self: flex-start;
    flex-shrink: 0;

    border: 1px solid #e5e5e5;
    border-radius: 5px;
    padding: 6px;
    height: 40px;
}

.cart-item-qty .qty-btn {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
}

.cart-item-qty .qty-value {
    min-width: 16px;
    text-align: center;
    font-weight: 500;
}

.qty-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ================================
   RIGHT SIDE (REMOVE + TOTAL)
================================ */
.cart-item-right {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cart-item-remove {
    align-self: flex-start;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #000;
    opacity: 0.6;
}

.cart-item-remove:hover {
    opacity: 1;
}

.cart-item-remove svg {
    display: block;
}

.cart-item-total {
    margin-left: auto;
    margin-top: auto;
    font-weight: 600;
    font-size: 16px;
    transition: transform 0.15s ease;
}

.cart-item-total.flash {
    transform: scale(1.05);
}


/* ================================
   EMPTY CART MESSAGE
================================ */
.cart-empty-message {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cart-empty-message[style*="block"] {
    opacity: 1;
}


/* ================================
   CART CHECKOUT
================================ */

.cart-checkout{
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: 1px solid black;
    padding-top: 40px;
}

.cart-summary-heading {
    font-size: 35px;
    font-weight: 300;
    margin-bottom: 12px;
}

.cart-checkout.is-hidden {
    display: none;
}


.cart-subtotal-wrapper, .cart-ordertotal-wrapper{
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
             "Helvetica Neue", Arial, system-ui, sans-serif;
}

.cart-ordertotalNvat{
    display: flex;
    flex-direction: column;
    
}

.cart-ordertotal-vat{
    font-size: 12px;
    color: grey;
    margin-left: auto;
}

.checkout-btn {
    display: inline-block;
    width: 100%;
    padding: 14px 18px;
    text-align: center;
    background: #000;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.checkout-btn:hover {
    opacity: 0.9;
}


@media (min-width: 1024px) {

    .cart-items-wrapper {
        flex: 7;
        max-width: none;
    }

    .cart-checkout {
        flex: 3;
        max-width: none;
        padding-top: 0;
        border: none;
    }

    .cart-checkout {
        flex: 0 0 26%;
        max-width: 26%;

        position: sticky;
        top: calc(var(--header-height) + 24px);

        align-self: flex-start;
        height: fit-content;
    }
}




/* Align part content to top of image */
.custom-build-part {
    align-items: flex-start;
}

/* Allow text column to shrink properly */
.custom-build-part .cb-part-details {
    flex: 1;
    min-width: 0;
}

/* CUSTOM BUILD PART TITLE */
.cb-part-title {
    font-size: 20px;       /* same as normal cart product */
    font-weight: 700;      /* same weight */
    line-height: 1.1;
    margin: 0;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;  /* force max 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

