/* MSC Backorder Checkout 0.2.2 — classic Woo/Neve checkout cleanup + backorder flow. */

.msc-bo-card {
    box-sizing: border-box;
    margin: 0 0 22px;
    padding: 22px;
    border: 1px solid rgba(0,0,0,.13);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.045);
}

.msc-bo-card h3 {
    margin: 3px 0 8px;
    font-size: 1.18rem;
    line-height: 1.3;
}

.msc-bo-card p { margin: 0; line-height: 1.5; }

.msc-bo-eyebrow,
.msc-bo-step {
    margin: 0 0 5px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
    opacity: .68;
}

.msc-bo-step {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.msc-bo-step small {
    font-size: .72rem;
    letter-spacing: .03em;
    opacity: .75;
}

.msc-bo-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 17px;
}

.msc-bo-summary > div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 9px;
    align-items: baseline;
    padding: 11px 13px;
    border-radius: 8px;
    background: rgba(0,0,0,.045);
}

.msc-bo-summary strong { grid-row: 1 / span 2; font-size: 1.3rem; }
.msc-bo-summary span { font-weight: 650; }
.msc-bo-summary small { opacity: .68; }
.msc-bo-summary-compact { margin-bottom: 15px; }

.msc-bo-options { display: grid; gap: 10px; }

.msc-bo-option {
    position: relative;
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    align-items: start;
    margin: 0;
    padding: 15px;
    border: 1px solid rgba(0,0,0,.16);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}

.msc-bo-option:hover { border-color: rgba(0,0,0,.38); box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.msc-bo-option:has(input:checked), .msc-bo-option.is-selected { border-color: #222; box-shadow: 0 0 0 1px #222; background: rgba(0,0,0,.018); }
.msc-bo-option input[type="radio"] { margin: 4px 0 0; width: 18px; height: 18px; }
.msc-bo-option-body, .msc-bo-option-title, .msc-bo-option-copy, .msc-bo-option-note { display: block; }
.msc-bo-option-title { margin-bottom: 3px; font-size: 1rem; font-weight: 750; }
.msc-bo-option-copy { line-height: 1.42; }
.msc-bo-option-note { margin-top: 5px; font-size: .82rem; line-height: 1.4; opacity: .64; }

.msc-bo-rate-hint {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 7px;
    background: rgba(0,0,0,.04);
    font-size: .84rem;
    line-height: 1.4;
}

/* ---------- Checkout cleanup ---------- */

.woocommerce-checkout form.checkout.woocommerce-checkout {
    align-items: flex-start;
}

/* Make the left column read like one clean customer-information form. */
.woocommerce-checkout #customer_details {
    box-sizing: border-box;
}

.woocommerce-checkout #customer_details .woocommerce-billing-fields,
.woocommerce-checkout #customer_details .woocommerce-shipping-fields,
.woocommerce-checkout #customer_details .woocommerce-additional-fields {
    margin-bottom: 20px;
}

.woocommerce-checkout #customer_details h3,
.woocommerce-checkout #order_review_heading {
    margin: 0 0 14px;
    font-size: 1.35rem;
    line-height: 1.25;
}

.woocommerce-checkout form.checkout.woocommerce-checkout .form-row {
    margin-bottom: 13px;
}

.woocommerce-checkout form.checkout.woocommerce-checkout .form-row label {
    margin-bottom: 5px;
    font-size: .9rem;
    font-weight: 600;
}

.woocommerce-checkout form.checkout.woocommerce-checkout input.input-text,
.woocommerce-checkout form.checkout.woocommerce-checkout textarea,
.woocommerce-checkout form.checkout.woocommerce-checkout select,
.woocommerce-checkout .select2-container .select2-selection--single {
    min-height: 44px;
    border: 1px solid rgba(0,0,0,.18);
    border-radius: 7px;
    background: #fff;
    box-shadow: none;
}

.woocommerce-checkout form.checkout.woocommerce-checkout input.input-text,
.woocommerce-checkout form.checkout.woocommerce-checkout textarea,
.woocommerce-checkout form.checkout.woocommerce-checkout select {
    padding: 9px 11px;
}

.woocommerce-checkout form.checkout.woocommerce-checkout textarea { min-height: 100px; resize: vertical; }

/* The big Neve/plugin notice bars become quiet utility controls instead of visual roadblocks. */
.woocommerce-checkout .woocommerce-info {
    margin: 0 0 10px !important;
    padding: 11px 14px !important;
    min-height: 0 !important;
    border: 1px solid rgba(0,0,0,.13) !important;
    border-radius: 7px !important;
    background: rgba(0,0,0,.025) !important;
    color: inherit !important;
    box-shadow: none !important;
    font-size: .88rem;
    line-height: 1.35;
}

.woocommerce-checkout .woocommerce-info::before { display: none !important; }
.woocommerce-checkout .woocommerce-info a { color: inherit !important; font-weight: 650; }

/* Keep expanded login/coupon forms readable but compact. */
.woocommerce-checkout form.login,
.woocommerce-checkout form.checkout_coupon {
    margin: 0 0 14px !important;
    padding: 14px !important;
    border: 1px solid rgba(0,0,0,.12) !important;
    border-radius: 8px !important;
}

/* Right column: one continuous checkout rail, not a pile of unrelated boxes. */
.woocommerce-checkout #order_review {
    box-sizing: border-box;
    padding: 18px;
    border: 1px solid rgba(0,0,0,.11);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.035);
}

.woocommerce-checkout #order_review table.shop_table {
    margin-bottom: 12px;
    border: 0;
}

.woocommerce-checkout #order_review table.shop_table th,
.woocommerce-checkout #order_review table.shop_table td {
    padding: 10px 8px;
    border-left: 0;
    border-right: 0;
}

.woocommerce-checkout #order_review table.shop_table thead th {
    padding-top: 4px;
    font-size: .9rem;
}

.woocommerce-checkout #order_review table.shop_table .product-name { line-height: 1.35; }
.woocommerce-checkout #order_review table.shop_table .product-total { text-align: right; }

/* Multiple packages created by the split choice need clear section labels. */
.woocommerce-checkout #order_review tr.woocommerce-shipping-totals.shipping th {
    width: 38%;
    vertical-align: top;
    font-weight: 700;
}

.woocommerce-checkout #order_review ul#shipping_method,
.woocommerce-checkout #order_review ul.woocommerce-shipping-methods {
    margin: 0;
}

.woocommerce-checkout #order_review ul#shipping_method li,
.woocommerce-checkout #order_review ul.woocommerce-shipping-methods li {
    margin: 0 0 7px;
    line-height: 1.35;
}

.woocommerce-checkout #payment {
    margin-top: 14px;
    border: 1px solid rgba(0,0,0,.09);
    border-radius: 9px;
    background: rgba(0,0,0,.018);
    overflow: hidden;
}

.woocommerce-checkout #payment ul.payment_methods { padding: 12px 14px; }
.woocommerce-checkout #payment div.form-row.place-order { padding: 14px; }

.woocommerce-checkout #place_order {
    width: 100%;
    min-height: 50px;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 750;
}

/* Give the backorder decision enough visual priority without shouting. */
.woocommerce-checkout #msc-backorder-shipping-choice {
    margin-bottom: 16px;
}

/* Keep the right rail visible on roomy desktop screens while the customer fills the left form. */
@media (min-width: 1000px) {
    .woocommerce-checkout #order_review,
    .woocommerce-checkout #order_review_heading,
    .woocommerce-checkout #msc-backorder-shipping-choice {
        position: relative;
    }
}

@media (max-width: 768px) {
    .msc-bo-card { padding: 17px; }
    .msc-bo-summary { grid-template-columns: 1fr; }
    .woocommerce-checkout #order_review { padding: 12px; }
    .woocommerce-checkout .woocommerce-info { padding: 10px 12px !important; }
}

/* ---------- 0.2.2 Neve palette / dark-mode compatibility ----------
 * Neve switches its global CSS variables when its dark palette is active.
 * Keep MSC surfaces tied to those variables instead of hard-coding a white
 * background while inheriting Neve's flipped text color.
 */
.woocommerce-cart,
.woocommerce-checkout {
    --msc-bo-surface: var(--nv-site-bg, #fff);
    --msc-bo-soft-surface: var(--nv-light-bg, #f6f6f6);
    --msc-bo-text: var(--nv-text-color, #202124);
    --msc-bo-muted: color-mix(in srgb, var(--msc-bo-text) 66%, transparent);
    --msc-bo-border: color-mix(in srgb, var(--msc-bo-text) 18%, transparent);
    --msc-bo-border-strong: color-mix(in srgb, var(--msc-bo-text) 48%, transparent);
}

/* Fallbacks for browsers without color-mix(). */
@supports not (color: color-mix(in srgb, black 50%, white)) {
    .woocommerce-cart,
    .woocommerce-checkout {
        --msc-bo-muted: #666;
        --msc-bo-border: rgba(127,127,127,.28);
        --msc-bo-border-strong: rgba(127,127,127,.58);
    }
}

.msc-bo-card,
.msc-bo-option,
.woocommerce-checkout #order_review {
    background: var(--msc-bo-surface);
    color: var(--msc-bo-text);
    border-color: var(--msc-bo-border);
}

.msc-bo-card h3,
.msc-bo-card p,
.msc-bo-card span,
.msc-bo-card strong,
.msc-bo-card small,
.woocommerce-checkout #order_review table.shop_table,
.woocommerce-checkout #order_review table.shop_table th,
.woocommerce-checkout #order_review table.shop_table td,
.woocommerce-checkout #order_review .woocommerce-shipping-totals,
.woocommerce-checkout #order_review .woocommerce-shipping-totals label,
.woocommerce-checkout #order_review .order-total,
.woocommerce-checkout #order_review .cart-subtotal {
    color: inherit;
}

.msc-bo-summary > div,
.msc-bo-rate-hint,
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout #payment {
    background: var(--msc-bo-soft-surface) !important;
    color: var(--msc-bo-text) !important;
    border-color: var(--msc-bo-border) !important;
}

.msc-bo-eyebrow,
.msc-bo-step,
.msc-bo-summary small,
.msc-bo-option-note,
.woocommerce-checkout #order_review .woocommerce-shipping-contents {
    color: var(--msc-bo-muted);
    opacity: 1;
}

.msc-bo-option:hover {
    border-color: var(--msc-bo-border-strong);
}

.msc-bo-option:has(input:checked),
.msc-bo-option.is-selected {
    border-color: var(--msc-bo-text);
    box-shadow: 0 0 0 1px var(--msc-bo-text);
    background: color-mix(in srgb, var(--msc-bo-text) 3%, var(--msc-bo-surface));
}

.woocommerce-checkout form.checkout.woocommerce-checkout input.input-text,
.woocommerce-checkout form.checkout.woocommerce-checkout textarea,
.woocommerce-checkout form.checkout.woocommerce-checkout select,
.woocommerce-checkout .select2-container .select2-selection--single,
.woocommerce-checkout form.login,
.woocommerce-checkout form.checkout_coupon {
    background: var(--msc-bo-surface) !important;
    color: var(--msc-bo-text) !important;
    border-color: var(--msc-bo-border) !important;
}

.woocommerce-checkout form.checkout.woocommerce-checkout input.input-text::placeholder,
.woocommerce-checkout form.checkout.woocommerce-checkout textarea::placeholder {
    color: var(--msc-bo-muted);
    opacity: .85;
}

/* Keep the two virtual shipment rows visually distinct without adding another box. */
.woocommerce-checkout #order_review tr.woocommerce-shipping-totals.shipping + tr.woocommerce-shipping-totals.shipping th,
.woocommerce-checkout #order_review tr.woocommerce-shipping-totals.shipping + tr.woocommerce-shipping-totals.shipping td {
    padding-top: 17px;
}

.woocommerce-checkout #order_review .woocommerce-shipping-contents {
    display: block;
    margin-top: 7px;
    font-size: .76rem;
    line-height: 1.35;
}
