/* The classic WooCommerce cart must not inherit the captured theme's floats
   and responsive table rules. These selectors are limited to store pages. */
body.woocommerce-cart #content .sl-commerce-cart,
body.woocommerce-checkout #content .sl-commerce-checkout {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-column: 1 / -1;
}
body.woocommerce-cart #content .sl-commerce-cart .woocommerce {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}
body.woocommerce-cart #content .sl-commerce-cart .woocommerce:has(> form.woocommerce-cart-form) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 35%);
    gap: 24px;
    align-items: start;
    padding: 0 20px 40px;
}
body.woocommerce-cart #content .sl-commerce-cart .woocommerce:has(> form.woocommerce-cart-form) > * {
    grid-column: 1;
    min-width: 0;
}
body.woocommerce-cart #content .sl-commerce-cart .woocommerce:has(> form.woocommerce-cart-form) > .cart-collaterals {
    grid-column: 2;
    grid-row: 1 / span 3;
    width: 100%;
    float: none;
    margin: 0;
    min-width: 0;
}
body.woocommerce-cart #content .cart-collaterals .cart_totals,
body.woocommerce-cart #content .cart-collaterals .cross-sells {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px;
    box-sizing: border-box;
}
body.woocommerce-cart #content form.woocommerce-cart-form {
    display: block;
    float: none;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}
body.woocommerce-cart #content .woocommerce-cart-form__contents {
    display: table;
    width: 100%;
    table-layout: auto;
}
body.woocommerce-cart #content .woocommerce-cart-form__contents thead { display: table-header-group; }
body.woocommerce-cart #content .woocommerce-cart-form__contents tbody { display: table-row-group; }
body.woocommerce-cart #content .woocommerce-cart-form__contents tr { display: table-row; }
body.woocommerce-cart #content .woocommerce-cart-form__contents :is(th, td) {
    display: table-cell;
    float: none;
    position: static;
    width: auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
body.woocommerce-cart #content .woocommerce-cart-form__contents td::before { display: none; }
body.woocommerce-cart #content .cart_totals table.shop_table { display: table; width: 100%; }
body.woocommerce-cart #content .cart_totals tbody { display: table-row-group; }
body.woocommerce-cart #content .cart_totals tr { display: table-row; }
body.woocommerce-cart #content .cart_totals :is(th, td) { display: table-cell; }
body.woocommerce-cart #content .cart_totals td::before { display: none; }
body.woocommerce-cart #content .cart_totals :is(th, td) { overflow-wrap: normal; word-break: normal; }
body.woocommerce-cart #content .cart_totals .shipping th { width: 30%; }
body.woocommerce-cart #content .coupon { flex-wrap: wrap; }
body.woocommerce-cart #content .coupon #coupon_code { flex: 1 1 140px; width: auto; min-width: 0; }

/* Let WooCommerce keep its chosen gateway and AJAX updates. CSS also makes
   the selected method's existing fields readable before those scripts run. */
body.woocommerce-checkout #payment ul.payment_methods > li.wc_payment_method {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 8px 10px;
    align-items: start;
}
body.woocommerce-checkout #payment .wc_payment_method > input.input-radio {
    grid-column: 1;
    grid-row: 1;
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 4px 0 0;
    padding: 0;
}
body.woocommerce-checkout #payment .wc_payment_method > label {
    grid-column: 2;
    grid-row: 1;
    display: block;
    width: auto;
    float: none;
    margin: 0;
    line-height: 1.5;
}
body.woocommerce-checkout #payment .wc_payment_method > .payment_box {
    grid-column: 1 / -1;
    float: none;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}
body.woocommerce-checkout #payment .wc_payment_method > input:checked ~ .payment_box {
    display: block !important;
    height: auto !important;
    max-height: none;
    opacity: 1;
    visibility: visible;
    overflow: visible;
}
body.woocommerce-checkout #payment .wc_payment_method > input:not(:checked) ~ .payment_box { display: none !important; }
body.woocommerce-checkout #payment .payment_box p { display: block; color: inherit; }
body.woocommerce-checkout #payment .payment_box :is(img, iframe, video) { max-width: 100%; }

/* Follow the native checkbox before (or without) checkout JavaScript. This
   leaves order notes alone and never clears a saved shipping address. */
body.woocommerce-checkout .woocommerce-shipping-fields:has(#ship-to-different-address-checkbox:not(:checked)) .shipping_address {
    display: none !important;
}
body.woocommerce-checkout .woocommerce-shipping-fields:has(#ship-to-different-address-checkbox:checked) .shipping_address {
    display: block !important;
    height: auto !important;
    max-height: none;
    opacity: 1;
    visibility: visible;
}

/* Keep existing product copy readable; do not replace text or alter HTML. */
body.single-product #content .woocommerce-Tabs-panel--description {
    height: auto;
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
}
body.single-product #content .woocommerce-Tabs-panel--description > h2:first-child { display: block; }
body.single-product #content .woocommerce-product-details__short-description { max-height: none; overflow: visible; }

@media (max-width: 1100px) {
    body.woocommerce-cart #content .sl-commerce-cart .woocommerce:has(> form.woocommerce-cart-form) { grid-template-columns: minmax(0, 1fr); }
    body.woocommerce-cart #content .sl-commerce-cart .woocommerce:has(> form.woocommerce-cart-form) > .cart-collaterals { grid-column: 1; grid-row: auto; }
}
@media (max-width: 767px) {
    body.woocommerce-cart #content .sl-commerce-cart .woocommerce:has(> form.woocommerce-cart-form) { padding: 0 12px 30px; gap: 16px; }
    body.woocommerce-cart #content form.woocommerce-cart-form { padding: 12px; }
    body.woocommerce-cart #content .woocommerce-cart-form__contents thead { display: none; }
    body.woocommerce-cart #content .woocommerce-cart-form__contents :is(tbody, tr, td) { display: block; width: 100%; }
    body.woocommerce-cart #content .woocommerce-cart-form__contents tr.cart_item { position: relative; padding: 10px 0 18px; }
    body.woocommerce-cart #content .woocommerce-cart-form__contents td { text-align: right; min-height: 32px; }
    body.woocommerce-cart #content .woocommerce-cart-form__contents td[data-title]::before { display: inline; float: left; content: attr(data-title) ": "; font-weight: 600; }
    body.woocommerce-cart #content .woocommerce-cart-form__contents td.product-name { text-align: left; }
    body.woocommerce-cart #content .woocommerce-cart-form__contents td.product-name::before { display: none; }
    body.woocommerce-cart #content .woocommerce-cart-form__contents td.product-thumbnail { text-align: left; }
    body.woocommerce-cart #content .woocommerce-cart-form__contents td.product-thumbnail img { width: 60px; }
    body.woocommerce-cart #content .coupon > * { width: 100%; flex-basis: 100%; }
    body.woocommerce-checkout #content form.checkout { display: block; }
    body.woocommerce-checkout #content #order_review { margin-top: 24px; }
}
