/*======================================= Cart Page =============================================*/
.cart-container {
    display: block;
    position: relative;
    margin-top: 1rem;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
    border-radius: 5px;
    width: 70%;
    max-width: 100%;
    -webkit-box-shadow: 0 0 1px 1px rgba(0,0,0,0.15);
    box-shadow: 0 0 1px 1px rgba(0,0,0,0.15);
}

.cart-container .cart-product-container {
    position: relative;
    display: flex;
}

.cart-container .cart-product-container:first-child {
    margin-top: 1rem;
}

.mobile-footer-nav-container {
    grid-template-columns: repeat(2, 1fr) !important;
}

.cart-container {
    font-family: "montserrat", sans-serif;
    font-style: normal;
}

.cart-container {
    max-width: 1200px;
    margin: 2rem auto 0 auto;
    padding: 2rem;
}

.cart-items-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.cart-repeat-order-notice {
    display: none;
    margin-bottom: 1rem;
    border: 1px solid #c7dfac;
    border-radius: 8px;
    background: #f8fff1;
    padding: 0.95rem 1rem;
}

.cart-repeat-order-notice.show {
    display: block;
}

.cart-repeat-order-notice .repeat-banner {
    margin: 0;
    color: #245c2c;
    font-weight: 600;
}

.cart-repeat-order-notice .repeat-notes {
    margin: 0.65rem 0 0;
    padding-left: 1rem;
}

.cart-repeat-order-notice .repeat-notes li {
    margin: 0.2rem 0;
    color: #365c3b;
    font-size: 0.94rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr 150px 100px 120px;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.cart-item-meta {
    color: #666;
    font-size: 0.9rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.qty-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

.qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.qty-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    padding: 0.5rem;
    border-radius: 4px;
}

.cart-item-price {
    font-weight: 600;
    font-size: 1.1rem;
}

.remove-btn {
    padding: 0.5rem 1rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.remove-btn:hover {
    background: #c82333;
}

.cart-summary {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1.5rem;
    max-width: 400px;
    margin-left: auto;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.cart-summary-row.total {
    font-size: 1.3rem;
    font-weight: 700;
    border-bottom: none;
    padding-top: 1rem;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: #ffba00;
    color: #000;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.checkout-btn:hover {
    background: #000;
    color: #fff;
}

.empty-cart {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.cart-loader {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

@media (max-width: 1100px) {
    .page-container .cart-container {
        width: 100%;
        max-width: 26rem;
        margin-left: auto;
        margin-right: auto;
        padding: 0.75rem;
        box-sizing: border-box;
    }

    .cart-items-list {
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1.25rem;
    }

    .cart-item {
        display: grid;
        grid-template-columns: 3.5rem minmax(0, 1fr);
        column-gap: 0.75rem;
        row-gap: 0.65rem;
        align-items: start;
        padding: 1rem;
        text-align: left;
        overflow: visible;
    }

    .cart-item > :first-child {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        width: 3.5rem;
        flex-shrink: 0;
        margin: 0;
    }

    .cart-item-image {
        width: 3.5rem;
        height: 3.5rem;
        display: block;
    }

    .cart-item > .cart-item-details {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        width: auto;
        min-width: 0;
        max-width: 100%;
        text-align: left;
    }

    .cart-item-name {
        font-size: 0.92rem;
        line-height: 1.3;
    }

    .cart-item-meta {
        font-size: 0.78rem;
        line-height: 1.3;
    }

    .cart-item-details .combo-products-list {
        margin: 0.35rem 0 0;
        padding: 0.5rem 0 0;
        border-left: none;
        border-top: 1px solid #ececec;
        width: 100%;
        max-width: none;
        text-align: left;
    }

    .cart-item-details .combo-products-list > div {
        justify-content: flex-start;
        font-size: 0.82rem;
    }

    .cart-item-qty {
        grid-column: 1 / -1;
        justify-content: center;
        margin-top: 0.15rem;
        width: 100%;
    }

    .qty-btn {
        width: 28px;
        height: 28px;
    }

    .qty-input {
        width: 48px;
        padding: 0.35rem;
    }

    .cart-item-price {
        grid-column: 1 / -1;
        margin-top: 0;
        font-size: 1rem;
        width: 100%;
        text-align: center;
    }

    .remove-btn {
        grid-column: 1 / -1;
        margin-top: 0;
        width: auto;
        max-width: 100%;
        display: inline-flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.4rem 0.85rem;
        font-size: 0.9rem;
        justify-self: center;
    }

    .cart-item-qty, .cart-item-price, .remove-btn {
        grid-column: 1 / -1;
    }

    #cart-summary-container {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .cart-summary {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
        box-sizing: border-box;
    }

    .cart-summary-row {
        justify-content: center;
        gap: 0.35rem 0.85rem;
        flex-wrap: wrap;
        text-align: center;
    }

    .cart-summary-row.total {
        justify-content: center;
    }

    .cart-summary-row.cart-points-earn {
        flex-direction: column;
        align-items: center;
        gap: 0.35rem;
        border-bottom: none;
        padding-bottom: 0.35rem;
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .cart-summary-row.cart-points-earn span {
        text-align: center;
    }

    .checkout-btn {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
        width: 100%;
        max-width: 18rem;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
}

@media (max-width: 400px) {
    .page-container .cart-container {
        padding: 0.5rem;
    }

    .cart-item {
        grid-template-columns: 3rem minmax(0, 1fr);
        column-gap: 0.6rem;
        padding: 0.85rem 0.75rem;
    }

    .cart-item > :first-child {
        width: 3rem;
    }

    .cart-item-image {
        width: 3rem;
        height: 3rem;
    }

    .cart-item-name {
        font-size: 0.85rem;
        line-height: 1.25;
    }

    .cart-item-meta {
        font-size: 0.72rem;
    }

    .cart-item-qty {
        gap: 0.35rem;
    }

    .qty-btn {
        width: 24px;
        height: 24px;
    }

    .qty-input {
        width: 42px;
        padding: 0.25rem;
    }

    .remove-btn {
        font-size: 0.82rem;
        padding: 0.35rem 0.65rem;
    }

    .cart-summary {
        padding: 1.15rem;
    }
}

.cart-summary .cart-payflex-widget,
.cart-summary .mk-payflex-widget-note {
    margin-top: 0.75rem;
}

/* basics-fixes: inline cart messages, busy state (cart page only), PayFlex estimate */
.cart-inline-message { margin: 0 0 12px; padding: 10px 12px; border-radius: 6px; background: #fff7e6; color: #7a4b00; font-size: 0.95rem; }
.cart-inline-message[data-type="error"] { background: #fdecec; color: #8a1f1f; }
.cart-inline-message[hidden] { display: none; }
/* Scope busy styling to cart proceed buttons — never a bare .is-disabled (collides with checkout payment options) */
.checkout-btn.is-disabled,
.checkout-btn[aria-disabled="true"],
a[href$="checkout"].is-disabled,
a[href$="checkout"][aria-disabled="true"],
#cart-checkout-btn.is-disabled,
#cart-checkout-btn[aria-disabled="true"] {
    opacity: .6;
    pointer-events: none;
}
.mk-payflex-estimate { font-size: 0.95rem; margin: 6px 0; }
