/* MLP Cross-Sell — scoped to this plugin; grid adapts to its own available width.
   In BeTheme, the product recommendation is often inside a 50%-width summary.
   Three fixed grid columns therefore made one recommendation ~180px wide. */
.mlpcs-block {
    --mlpcs-ink: #162a4d;
    --mlpcs-muted: #686c79;
    --mlpcs-edge: #e8e4ed;
    --mlpcs-action: #cda9eb;
    --mlpcs-action-hover: #b98ddf;
    --mlpcs-surface: #fff;
    width: 100%;
    min-width: 0;
    margin: 28px 0;
    color: var(--mlpcs-ink);
    container-type: inline-size;
}
.mlpcs-block *, .mlpcs-block *::before, .mlpcs-block *::after { box-sizing: border-box; }
.mlpcs-heading { margin: 0 0 15px; }
.mlpcs-subtitle { margin: 6px 0 0; color: var(--mlpcs-muted); font-size: .88rem; line-height: 1.5; }
.mlpcs-subtitle p { margin: 0 0 6px; }
.mlpcs-subtitle p:last-child { margin-bottom: 0; }
.mlpcs-block .mlpcs-subtitle a, .mlpcs-block .mlpcs-card-pitch a { color: var(--mlpcs-action-hover); text-decoration: underline; }
.mlpcs-block .mlpcs-card-pitch p { margin: 0 0 5px; }
.mlpcs-block .mlpcs-card-pitch p:last-child { margin-bottom: 0; }
.mlpcs-block .mlpcs-card-pitch ul, .mlpcs-block .mlpcs-card-pitch ol { margin: 0 0 6px 18px; padding: 0; }
.mlpcs-block .mlpcs-card-pitch li { margin: 0 0 2px; }
.mlpcs-heading h2 { margin: 0; font-size: clamp(1.2rem, 1.45vw, 1.6rem); font-weight: 600; line-height: 1.3; color: inherit; }
/* A lone card fills the whole available width, including a narrow product summary. */
.mlpcs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: stretch; }
.mlpcs-card {
    display: grid;
    grid-template-columns: minmax(118px, 35%) minmax(0, 1fr);
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--mlpcs-edge);
    border-radius: 14px;
    background: var(--mlpcs-surface);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(22, 42, 77, .04);
}
.mlpcs-card-image { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 16px; background: #faf8fd; }
.mlpcs-card-image img { display: block; width: 100%; max-width: 100%; height: auto; max-height: 170px; object-fit: contain; }
.mlpcs-card-content { display: flex; flex-direction: column; min-width: 0; padding: 16px 17px; gap: 0; }
.mlpcs-card h3 { margin: 0 0 8px; font-size: .96rem; line-height: 1.4; font-weight: 600; overflow-wrap: break-word; }
.mlpcs-card h3 a { color: var(--mlpcs-ink); text-decoration: none; }
.mlpcs-card h3 a:hover { text-decoration: underline; }
.mlpcs-card-pitch { margin: 0 0 11px; color: var(--mlpcs-muted); font-size: .84rem; line-height: 1.45; }
.mlpcs-card-prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; margin: auto 0 12px; }
.mlpcs-card-prices .woocommerce-Price-amount { white-space: nowrap; }
/* All catalogue/original prices use the MLP violet, including WooCommerce prices. */
.mlpcs-block .mlpcs-card-prices .mlpcs-was { color: var(--mlpcs-action); font-size: .9rem; }
.mlpcs-block .mlpcs-card-prices .mlpcs-was del { color: inherit; }
.mlpcs-block .mlpcs-card-prices .mlpcs-now { color: var(--mlpcs-action); font-size: 1.02rem; font-weight: 700; line-height: 1.45; }
.mlpcs-block .mlpcs-card-prices .woocommerce-Price-amount,
.mlpcs-block .mlpcs-card-prices .woocommerce-Price-currencySymbol { color: var(--mlpcs-action); }
.mlpcs-offer-note { display: block; width: 100%; font-size: .78rem; line-height: 1.4; color: #72617e; }
.mlpcs-add-form { margin: 0; padding: 0; min-width: 0; }
.mlpcs-variation-label { display: block; margin: 0 0 6px; color: var(--mlpcs-ink); font-weight: 500; font-size: .79rem; }
.mlpcs-add-form select { display: block; width: 100%; max-width: 100%; min-height: 39px; margin: 0 0 9px; padding: 7px 10px; border: 1px solid #d4ccdf; border-radius: 8px; background: white; color: var(--mlpcs-ink); font-size: .83rem; line-height: 1.3; }
.mlpcs-block .mlpcs-add-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    margin: 0;
    border: 1px solid var(--mlpcs-action);
    border-radius: 9px;
    background: var(--mlpcs-action);
    color: var(--mlpcs-ink) !important;
    text-align: center;
    text-decoration: none !important;
    font-family: inherit;
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.3;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}
.mlpcs-block .mlpcs-add-button:hover, .mlpcs-block .mlpcs-add-button:focus { background: var(--mlpcs-action-hover); border-color: var(--mlpcs-action-hover); color: var(--mlpcs-ink) !important; }
.mlpcs-block .mlpcs-add-button:disabled { opacity: .55; cursor: not-allowed; }
.mlpcs-feedback { margin: 7px 0 0; font-size: .78rem; line-height: 1.4; }
.mlpcs-feedback:empty { display: none; }
.mlpcs-feedback.is-success { color: #276c49; }
.mlpcs-feedback.is-error { color: #b23232; }
/* The cart sidebar can be narrower than a full product listing, even on desktop. */
@container (max-width: 300px) {
    .mlpcs-card { grid-template-columns: minmax(0, 1fr); }
    .mlpcs-card-image { min-height: 135px; max-height: 160px; padding: 13px; }
    .mlpcs-card-image img { max-height: 130px; }
    .mlpcs-card-content { padding: 14px 16px 15px; }
}
@media (max-width: 700px) {
    .mlpcs-block { margin: 22px 0; }
    .mlpcs-heading { margin-bottom: 12px; }
    .mlpcs-cards { gap: 12px; }
}


/* v1.0.2 — BeTheme classic cart: the cart table and the recommendation panel
   share the left column, while the existing cart totals stay on the right.
   No global WooCommerce/cart layout modifications on pages without MLP offers. */
.woocommerce-cart .mfn-be-cart .woocommerce > .mlpcs-cart-main {
    min-width: 0;
}
.woocommerce-cart .mfn-be-cart .woocommerce > .mlpcs-cart-main > form.woocommerce-cart-form {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
@media (min-width: 901px) {
    .woocommerce-cart .mfn-be-cart .woocommerce:has(> .mlpcs-cart-main) {
        display: grid !important;
        grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
        column-gap: 32px;
        row-gap: 0;
        align-items: start;
    }
    .woocommerce-cart .mfn-be-cart .woocommerce > .woocommerce-notices-wrapper {
        grid-column: 1 / -1;
    }
    .woocommerce-cart .mfn-be-cart .woocommerce > .mlpcs-cart-main {
        grid-column: 1;
        width: 100% !important;
        max-width: none !important;
        float: none !important;
    }
    .woocommerce-cart .mfn-be-cart .woocommerce > .cart-collaterals {
        grid-column: 2;
        width: 100% !important;
        max-width: none !important;
        float: none !important;
        margin: 0;
        min-width: 0;
    }
    .woocommerce-cart .mfn-be-cart .woocommerce > .cart-collaterals .cart_totals {
        width: 100% !important;
        max-width: none !important;
        float: none !important;
    }
}
@media (max-width: 900px) {
    .woocommerce-cart .mfn-be-cart .woocommerce:has(> .mlpcs-cart-main) {
        display: block !important;
    }
    .woocommerce-cart .mfn-be-cart .woocommerce > .mlpcs-cart-main,
    .woocommerce-cart .mfn-be-cart .woocommerce > .cart-collaterals {
        display: block;
        width: 100% !important;
        max-width: none !important;
        float: none !important;
        clear: both;
    }
    .woocommerce-cart .mfn-be-cart .woocommerce > .cart-collaterals .cart_totals {
        width: 100% !important;
        max-width: none !important;
        float: none !important;
    }
}

/* Keep the selected-variation promo layout compact until selection. */
.mlpcs-block .mlpcs-was:empty, .mlpcs-block .mlpcs-offer-note[hidden] { display:none !important; }

.mlpcs-block .mlpcs-offer-badge { color: #162a4d; background: #f0e5fa; border-radius: 5px; padding: 2px 6px; font-size: .78rem; font-weight: 600; }
.mlpcs-block .mlpcs-offer-badge:empty { display: none; }
