/* Classic WooCommerce/Avada only. No price or product-card rewrite. */
.dtfchef-layout-hidden { display: none !important; }
body.woocommerce-cart .shipping-coupon,
body.woocommerce-cart .woocommerce-shipping-calculator,
body.woocommerce-cart .coupon,
body.woocommerce-checkout:not(.woocommerce-order-received):not(.woocommerce-order-pay) .avada-myaccount-user,
body.woocommerce-checkout:not(.woocommerce-order-received):not(.woocommerce-order-pay) .woocommerce-form-coupon-toggle,
body.woocommerce-checkout:not(.woocommerce-order-received):not(.woocommerce-order-pay) form.checkout_coupon {
    display: none !important;
}
body.woocommerce-cart .dtfchef-cart-collaterals,
body.woocommerce-cart .dtfchef-cart-totals-wide {
    float: none !important; width: 100% !important; max-width: none !important; flex: 0 0 100% !important;
    min-width: 0; box-sizing: border-box; clear: both;
}
body.woocommerce-cart .dtfchef-cart-summary-grid {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 40px;
    align-items: start; width: 100%; box-sizing: border-box;
}
body.woocommerce-cart .dtfchef-cart-summary-grid::before,
body.woocommerce-cart .dtfchef-cart-summary-grid::after { display: none; }
body.woocommerce-cart .dtfchef-cart-summary-grid > * { min-width: 0; margin-top: 0; }
body.woocommerce-cart .dtfchef-cart-summary-grid > h2 { grid-column: 1 / -1; margin-bottom: 0; }
body.woocommerce-cart .dtfchef-cart-summary-grid > table { width: 100% !important; margin: 0; }
body.woocommerce-cart .dtfchef-cart-guarantee { align-self: start; }
body.woocommerce-cart .dtfchef-cart-guarantee .wc-gzd-legal-guarantee { margin: 0 !important; float: none !important; max-width: 100%; }
body.woocommerce-cart .dtfchef-cart-guarantee img,
body.woocommerce-cart .dtfchef-cart-guarantee svg { max-width: 100%; height: auto; }
body.woocommerce-cart .dtfchef-cart-summary-grid .wc-proceed-to-checkout { width: 100%; float: none; text-align: right; }
@media (min-width: 801px) {
    body.woocommerce-cart .dtfchef-cart-summary-grid.dtfchef-has-guarantee { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    body.woocommerce-cart .dtfchef-cart-summary-grid.dtfchef-has-guarantee > * { grid-column: 2; }
    body.woocommerce-cart .dtfchef-cart-summary-grid.dtfchef-has-guarantee > h2 { grid-column: 1 / -1; grid-row: 1; }
    body.woocommerce-cart .dtfchef-cart-summary-grid.dtfchef-has-guarantee > table { grid-row: 2; }
    body.woocommerce-cart .dtfchef-cart-summary-grid.dtfchef-has-guarantee > .dtfchef-cart-guarantee { grid-column: 1; grid-row: 2 / span 6; }
}
form.checkout .dtfchef-step-backbar { justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
form.checkout .dtfchef-edit-order { margin-left: auto; text-align: right; padding: 10px 0; }
form.checkout .dtfchef-coupon-row > td { padding: 24px 0 !important; text-align: left; }
form.checkout .dtfchef-coupon-panel { width: 100%; box-sizing: border-box; text-align: left; }
form.checkout .dtfchef-coupon-panel > label { display: block; margin-bottom: 12px; font-weight: 600; }
form.checkout .dtfchef-coupon-controls { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; }
form.checkout #dtfchef-coupon-code { flex: 1 1 200px; min-width: 0; width: auto; max-width: 100%; min-height: 46px; padding: 10px 12px; box-sizing: border-box; font-size: 16px; }
form.checkout .dtfchef-apply-coupon { min-height: 46px; white-space: normal; }
form.checkout .dtfchef-coupon-feedback:empty { display: none; }
form.checkout .dtfchef-coupon-feedback { margin-top: 12px; overflow-wrap: anywhere; }
form.checkout .dtfchef-coupon-error { color: #920506; }
form.checkout .dtfchef-apply-coupon:disabled { opacity: .65; cursor: wait; }
@media (max-width: 800px) {
    /* Avada's nested totals table must not impose its desktop min-content width. */
    form.checkout, form.checkout #order_review,
    form.checkout .woocommerce-checkout-review-order,
    form.checkout .woocommerce-content-box { min-width: 0 !important; max-width: 100%; box-sizing: border-box; }
    form.checkout table.woocommerce-checkout-review-order-table { width: 100% !important; min-width: 0 !important; table-layout: fixed; }
    form.checkout tr.awb-checkout-totals-wrapper > td {
        display: table-cell; width: 100% !important; min-width: 0 !important; padding-left: 0 !important; padding-right: 0 !important; box-sizing: border-box;
    }
    form.checkout table.awb-cart-totals-table,
    form.checkout table.awb-cart-totals-table > tbody,
    body.woocommerce-cart .cart_totals table,
    body.woocommerce-cart .cart_totals table > tbody { display: block; width: 100% !important; min-width: 0 !important; }
    form.checkout .awb-cart-totals-table > tbody > tr,
    form.checkout .woocommerce-checkout-review-order-table > tfoot > tr:not(.awb-checkout-totals-wrapper),
    body.woocommerce-cart .cart_totals table > tbody > tr {
        display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px;
        width: 100%; box-sizing: border-box; padding: 16px 0; align-items: start;
    }
    form.checkout .awb-cart-totals-table > tbody > tr > *,
    form.checkout .woocommerce-checkout-review-order-table > tfoot > tr:not(.awb-checkout-totals-wrapper) > *,
    body.woocommerce-cart .cart_totals table > tbody > tr > * {
        display: block; width: auto !important; min-width: 0 !important; max-width: 100%;
        padding: 0 !important; border: 0 !important; box-sizing: border-box; text-align: left;
    }
    form.checkout .awb-cart-totals-table > tbody > tr > td,
    form.checkout .woocommerce-checkout-review-order-table > tfoot > tr:not(.awb-checkout-totals-wrapper) > td,
    body.woocommerce-cart .cart_totals table > tbody > tr > td { text-align: right; }
    body.woocommerce-cart .cart_totals td::before { display: none !important; }
    form.checkout .awb-cart-totals-table > tbody > tr.shipping,
    form.checkout .woocommerce-checkout-review-order-table > tfoot > tr.shipping,
    body.woocommerce-cart .cart_totals table > tbody > tr.shipping { grid-template-columns: minmax(0, 1fr); }
    form.checkout .awb-cart-totals-table tr.shipping > td,
    form.checkout .woocommerce-checkout-review-order-table > tfoot > tr.shipping > td,
    body.woocommerce-cart .cart_totals tr.shipping > td { text-align: left; }
    form.checkout ul.woocommerce-shipping-methods,
    body.woocommerce-cart .cart_totals ul.woocommerce-shipping-methods { width: 100%; padding: 0; margin: 0; }
    form.checkout ul.woocommerce-shipping-methods > li,
    body.woocommerce-cart .cart_totals ul.woocommerce-shipping-methods > li { margin: 0 0 18px; white-space: normal; overflow-wrap: anywhere; text-align: left; }
    form.checkout ul.woocommerce-shipping-methods label,
    body.woocommerce-cart .cart_totals ul.woocommerce-shipping-methods label { display: inline; white-space: normal !important; }
    form.checkout .shipping .dtfchef-price-tax-note,
    body.woocommerce-cart .shipping .dtfchef-price-tax-note { text-align: left; }
    form.checkout .shop_table tr.order-total > th { font-size: 24px !important; }
    form.checkout .shop_table tr.order-total > td .amount { font-size: 28px !important; }
    form.checkout .dtfchef-coupon-row, form.checkout .dtfchef-coupon-row > td { width: auto !important; }
    body.woocommerce-cart .dtfchef-cart-guarantee { grid-row: auto; }
}
@media (max-width: 480px) {
    form.checkout .woocommerce-content-box { padding: 18px 14px !important; }
    form.checkout .dtfchef-coupon-controls { flex-direction: column; }
    form.checkout #dtfchef-coupon-code { flex-basis: auto; width: 100%; }
    form.checkout .dtfchef-apply-coupon { width: 100%; }
    form.checkout .dtfchef-step-backbar { font-size: 14px; }
    form.checkout .shop_table tr.dtfchef-included-tax > th,
    form.checkout .shop_table tr.dtfchef-included-tax > td,
    form.checkout .shop_table tr.dtfchef-included-tax > td .amount { font-size: 18px !important; }
}

/* dev.7: retain the spanning table cell. A block tfoot creates an anonymous
   table cell in column one and constrains the entire nested summary to it. */
@media (min-width: 801px) {
    body.woocommerce-cart .dtfchef-cart-summary-grid.dtfchef-has-guarantee > .dtfchef-cart-guarantee {
        width: 70%; justify-self: start;
    }
}
@media (max-width: 800px) {
    body.woocommerce-checkout form.checkout table.woocommerce-checkout-review-order-table > tfoot {
        display: table-footer-group !important;
    }
    body.woocommerce-checkout form.checkout table.woocommerce-checkout-review-order-table > tfoot > tr.awb-checkout-totals-wrapper {
        display: table-row !important; float: none !important;
    }
    body.woocommerce-checkout form.checkout table.woocommerce-checkout-review-order-table > tfoot > tr.awb-checkout-totals-wrapper > td {
        display: table-cell !important; float: none !important;
        width: 100% !important; padding: 0 !important;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table,
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody {
        width: 100% !important; max-width: none !important;
        min-width: 0 !important; margin: 0 !important; float: none !important;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody > tr {
        display: grid !important; grid-template-columns: minmax(0, 1fr) max-content;
        column-gap: 16px; padding: 20px 0 !important; margin: 0 !important;
        min-height: 0 !important; height: auto !important;
        border: 0; align-items: start;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody > tr > th,
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody > tr > td {
        display: block !important; float: none !important;
        width: auto !important; min-width: 0 !important; height: auto !important;
        margin: 0 !important; padding: 0 !important; border: 0 !important;
        text-indent: 0; line-height: 1.4 !important; white-space: normal !important;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody > tr > th {
        text-align: left !important; font-size: 20px !important; font-weight: 500 !important;
        overflow-wrap: anywhere;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody > tr > td {
        text-align: right !important; font-size: 18px !important;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody > tr > td::before {
        display: none !important;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody > tr.shipping {
        grid-template-columns: minmax(0, 1fr); row-gap: 14px;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody > tr.shipping > td {
        text-align: left !important;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table ul.woocommerce-shipping-methods > li {
        margin: 0 0 24px !important; padding: 0 !important;
        line-height: 1.5; font-size: 16px; text-align: left !important;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table ul.woocommerce-shipping-methods > li:last-child { margin-bottom: 0 !important; }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table .shipping-method-description {
        font-size: 16px !important; line-height: 1.5;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody > tr.dtfchef-included-tax,
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table > tbody > tr.order-total {
        border-top: 1px solid #dedbd5;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table tr.dtfchef-included-tax > td .amount {
        font-size: 18px !important; font-weight: 500 !important;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table tr.order-total > td .amount,
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table tr.order-total > td .amount bdi,
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table tr.order-total > td > strong {
        font-size: 22px !important; font-weight: 700 !important; line-height: 1.4 !important;
    }
    body.woocommerce-checkout form.checkout table.awb-cart-totals-table .dtfchef-price-tax-note {
        font-size: 14px !important; font-weight: 400 !important; margin-top: 4px !important;
    }
}
