/* COMITPRO Divi Shop Flow - frontend cart styling */


/* Dynamic cart updates are automatic: keep the native WooCommerce Update cart button hidden. */
body.comitpro-dsf-dynamic-cart-update .woocommerce-cart-form button[name="update_cart"],
body.comitpro-dsf-dynamic-cart-update .woocommerce-cart-form input[name="update_cart"],
body.comitpro-dsf-dynamic-cart-update .woocommerce-cart-form .button[name="update_cart"] {
    display: none !important;
    visibility: hidden !important;
}

body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: stretch !important;
    column-gap: 10px !important;
    row-gap: 0 !important;
    width: 100% !important;
    max-width: 620px !important;
    float: none !important;
    clear: both !important;
}

body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon label {
    display: none !important;
}

body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon .input-text,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon input[name="coupon_code"] {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon .button,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon button[name="apply_coupon"] {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    white-space: nowrap !important;
    margin: 0 !important;
}

body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon .woocommerce-error,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon .woocommerce-message,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon .woocommerce-info,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon ul.woocommerce-error,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon div.woocommerce-error,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon .woocommerce-notices-wrapper,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon + .woocommerce-error,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon + .woocommerce-message,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon + .woocommerce-info,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon + .woocommerce-notices-wrapper {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin: 8px 0 0 0 !important;
    clear: both !important;
}

body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon .woocommerce-error li,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon .woocommerce-message li,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon .woocommerce-info li,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon + .woocommerce-error li,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon + .woocommerce-message li,
body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon + .woocommerce-info li {
    margin: 0 !important;
}

@media (max-width: 480px) {
    body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon {
        grid-template-columns: minmax(0, 1fr) auto !important;
        max-width: none !important;
    }

    body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon .button,
    body.comitpro-dsf-coupon-row .woocommerce-cart-form .coupon button[name="apply_coupon"] {
        min-width: 0 !important;
    }
}

/* Quantity input width fix: keep 2, 3, 4+ digit quantities visible in Divi/Woo cart modules. */
body.woocommerce-cart .woocommerce-cart-form .quantity,
body.woocommerce-cart .woocommerce-cart-form td.product-quantity .quantity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

body.woocommerce-cart .woocommerce-cart-form .quantity input.qty,
body.woocommerce-cart .woocommerce-cart-form td.product-quantity input.qty,
body.woocommerce-cart .woocommerce-cart-form input.qty {
    width: auto !important;
    min-width: 5.5em !important;
    max-width: none !important;
    box-sizing: border-box !important;
    text-align: center !important;
    padding-left: 0.65em !important;
    padding-right: 0.65em !important;
}

/* Checkout validation cleanup: keep field errors close to their fields and keep important global errors visible. */
body.woocommerce-checkout .comitpro-dsf-field-error,
body.woocommerce-checkout .form-row .woocommerce-error,
body.woocommerce-checkout .form-row ul.woocommerce-error,
body.woocommerce-checkout .form-row div.woocommerce-error,
body.woocommerce-checkout .form-row.woocommerce-invalid-required-field > .woocommerce-error,
body.woocommerce-checkout .form-row.woocommerce-invalid-required-field > ul.woocommerce-error,
body.woocommerce-checkout .form-row.woocommerce-invalid-required-field > div.woocommerce-error,
body.woocommerce-checkout .form-row.woocommerce-invalid-required-field .comitpro-dsf-field-error {
    display: block !important;
    margin: 4px 0 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #d63638 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
    list-style: none !important;
}

body.woocommerce-checkout .form-row .woocommerce-error li,
body.woocommerce-checkout .form-row.woocommerce-invalid-required-field > .woocommerce-error li,
body.woocommerce-checkout .form-row.woocommerce-invalid-required-field > ul.woocommerce-error li,
body.woocommerce-checkout .form-row.woocommerce-invalid-required-field > div.woocommerce-error li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

body.woocommerce-checkout .comitpro-dsf-hidden-checkout-duplicate,
body.woocommerce-checkout .woocommerce-NoticeGroup-checkout .comitpro-dsf-hidden-checkout-duplicate {
    display: none !important;
}

body.woocommerce-checkout .comitpro-dsf-empty-checkout-notices,
body.woocommerce-checkout .woocommerce-error.comitpro-dsf-empty-checkout-notices,
body.woocommerce-checkout .woocommerce-NoticeGroup-checkout.comitpro-dsf-empty-checkout-notices,
body.woocommerce-checkout .woocommerce-NoticeGroup-checkout .woocommerce-error.comitpro-dsf-empty-checkout-notices {
    display: none !important;
}

body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .woocommerce-error,
body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .woocommerce-error li,
body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper .comitpro-dsf-field-error {
    color: #d63638 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
}


/* Checkout global error notice cleanup: keep important errors visible without the large colored box. */
body.woocommerce-checkout .woocommerce-NoticeGroup-checkout,
body.woocommerce-checkout .woocommerce-NoticeGroup-checkout .woocommerce-error,
body.woocommerce-checkout form.checkout > .woocommerce-error,
body.woocommerce-checkout form.checkout > .woocommerce-NoticeGroup,
body.woocommerce-checkout form.checkout > .woocommerce-NoticeGroup .woocommerce-error,
body.woocommerce-checkout form.checkout .woocommerce-NoticeGroup-checkout,
body.woocommerce-checkout form.checkout .woocommerce-NoticeGroup-checkout .woocommerce-error,
body.woocommerce-checkout .woocommerce-notices-wrapper .woocommerce-error,
body.woocommerce-checkout #order_review .woocommerce-error,
body.woocommerce-checkout .woocommerce-checkout-review-order .woocommerce-error {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #d63638 !important;
    margin: 8px 0 14px 0 !important;
    padding: 0 !important;
}

body.woocommerce-checkout .woocommerce-NoticeGroup-checkout .woocommerce-error::before,
body.woocommerce-checkout form.checkout > .woocommerce-error::before,
body.woocommerce-checkout form.checkout > .woocommerce-NoticeGroup .woocommerce-error::before,
body.woocommerce-checkout .woocommerce-notices-wrapper .woocommerce-error::before,
body.woocommerce-checkout #order_review .woocommerce-error::before,
body.woocommerce-checkout .woocommerce-checkout-review-order .woocommerce-error::before {
    display: none !important;
    content: none !important;
}

body.woocommerce-checkout .woocommerce-NoticeGroup-checkout .woocommerce-error li,
body.woocommerce-checkout form.checkout > .woocommerce-error li,
body.woocommerce-checkout form.checkout > .woocommerce-NoticeGroup .woocommerce-error li,
body.woocommerce-checkout .woocommerce-notices-wrapper .woocommerce-error li,
body.woocommerce-checkout #order_review .woocommerce-error li,
body.woocommerce-checkout .woocommerce-checkout-review-order .woocommerce-error li {
    background: transparent !important;
    border: 0 !important;
    color: #d63638 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    list-style: none !important;
}


/* Checkout required-field override for Divi checkout modules on custom pages. */
form.checkout .comitpro-dsf-field-error,
.woocommerce-checkout .comitpro-dsf-field-error,
form.checkout .form-row .comitpro-dsf-field-error,
.woocommerce-checkout .form-row .comitpro-dsf-field-error {
    display: block !important;
    margin: 4px 0 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #d63638 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
    list-style: none !important;
}

form.checkout .woocommerce-NoticeGroup-checkout .comitpro-dsf-hidden-checkout-duplicate,
.woocommerce-checkout .woocommerce-NoticeGroup-checkout .comitpro-dsf-hidden-checkout-duplicate,
form.checkout .comitpro-dsf-empty-checkout-notices,
.woocommerce-checkout .comitpro-dsf-empty-checkout-notices {
    display: none !important;
}

/* Checkout payment/order return errors: keep real gateway errors visible, but remove the large WooCommerce box styling. */
.comitpro-dsf-checkout-global-error,
.comitpro-dsf-checkout-global-error li,
.comitpro-dsf-visible-checkout-error {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #d63638 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.comitpro-dsf-checkout-global-error::before {
    display: none !important;
    content: none !important;
}

/* Divi checkout modules may render on pages without the WooCommerce checkout body class. Keep the same checkout error styling scoped to the actual checkout markup. */
form.checkout .comitpro-dsf-field-error,
.woocommerce-checkout .comitpro-dsf-field-error,
form.checkout .form-row .woocommerce-error,
.woocommerce-checkout .form-row .woocommerce-error,
form.checkout .form-row.woocommerce-invalid-required-field .comitpro-dsf-field-error,
.woocommerce-checkout .form-row.woocommerce-invalid-required-field .comitpro-dsf-field-error {
    display: block !important;
    margin: 4px 0 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #d63638 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
    list-style: none !important;
}

form.checkout .woocommerce-NoticeGroup-checkout,
form.checkout .woocommerce-NoticeGroup-checkout .woocommerce-error,
form.checkout > .woocommerce-error,
form.checkout > .woocommerce-NoticeGroup,
form.checkout > .woocommerce-NoticeGroup .woocommerce-error,
form.checkout .woocommerce-notices-wrapper .woocommerce-error,
form.checkout #order_review .woocommerce-error,
form.checkout .woocommerce-checkout-review-order .woocommerce-error,
.woocommerce-checkout .woocommerce-NoticeGroup-checkout,
.woocommerce-checkout .woocommerce-NoticeGroup-checkout .woocommerce-error,
.woocommerce-checkout .woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-checkout #order_review .woocommerce-error,
.woocommerce-checkout .woocommerce-checkout-review-order .woocommerce-error,
.comitpro-dsf-payment-return-error {
    display: block !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #d63638 !important;
    margin: 8px 0 14px 0 !important;
    padding: 0 !important;
}

form.checkout .woocommerce-NoticeGroup-checkout .woocommerce-error::before,
form.checkout > .woocommerce-error::before,
form.checkout > .woocommerce-NoticeGroup .woocommerce-error::before,
form.checkout .woocommerce-notices-wrapper .woocommerce-error::before,
form.checkout #order_review .woocommerce-error::before,
form.checkout .woocommerce-checkout-review-order .woocommerce-error::before,
.woocommerce-checkout .woocommerce-NoticeGroup-checkout .woocommerce-error::before,
.woocommerce-checkout .woocommerce-notices-wrapper .woocommerce-error::before,
.woocommerce-checkout #order_review .woocommerce-error::before,
.woocommerce-checkout .woocommerce-checkout-review-order .woocommerce-error::before,
.comitpro-dsf-payment-return-error::before {
    display: none !important;
    content: none !important;
}

form.checkout .woocommerce-NoticeGroup-checkout .woocommerce-error li,
form.checkout > .woocommerce-error li,
form.checkout > .woocommerce-NoticeGroup .woocommerce-error li,
form.checkout .woocommerce-notices-wrapper .woocommerce-error li,
form.checkout #order_review .woocommerce-error li,
form.checkout .woocommerce-checkout-review-order .woocommerce-error li,
.woocommerce-checkout .woocommerce-NoticeGroup-checkout .woocommerce-error li,
.woocommerce-checkout .woocommerce-notices-wrapper .woocommerce-error li,
.woocommerce-checkout #order_review .woocommerce-error li,
.woocommerce-checkout .woocommerce-checkout-review-order .woocommerce-error li,
.comitpro-dsf-payment-return-error li {
    background: transparent !important;
    border: 0 !important;
    color: #d63638 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Failed payment return notice: one clear message above the payment module, never inside the gray payment box. */
form.checkout ul.woocommerce-error.comitpro-dsf-payment-return-error,
form.checkout ul.woocommerce-error.comitpro-dsf-payment-anchor-error,
.woocommerce-checkout ul.woocommerce-error.comitpro-dsf-payment-return-error,
.woocommerce-checkout ul.woocommerce-error.comitpro-dsf-payment-anchor-error,
ul.woocommerce-error.comitpro-dsf-payment-return-error,
ul.woocommerce-error.comitpro-dsf-payment-anchor-error {
    display: block !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px 0 14px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #d63638 !important;
    list-style: none !important;
}

form.checkout ul.woocommerce-error.comitpro-dsf-payment-return-error::before,
form.checkout ul.woocommerce-error.comitpro-dsf-payment-anchor-error::before,
.woocommerce-checkout ul.woocommerce-error.comitpro-dsf-payment-return-error::before,
.woocommerce-checkout ul.woocommerce-error.comitpro-dsf-payment-anchor-error::before,
ul.woocommerce-error.comitpro-dsf-payment-return-error::before,
ul.woocommerce-error.comitpro-dsf-payment-anchor-error::before {
    display: none !important;
    content: none !important;
}

form.checkout ul.woocommerce-error.comitpro-dsf-payment-return-error li,
form.checkout ul.woocommerce-error.comitpro-dsf-payment-anchor-error li,
.woocommerce-checkout ul.woocommerce-error.comitpro-dsf-payment-return-error li,
.woocommerce-checkout ul.woocommerce-error.comitpro-dsf-payment-anchor-error li,
ul.woocommerce-error.comitpro-dsf-payment-return-error li,
ul.woocommerce-error.comitpro-dsf-payment-anchor-error li {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    color: #d63638 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
    list-style: none !important;
}

/* Native WooCommerce Update cart button must never be visible; cart updates are dynamic. */
.woocommerce-cart-form button[name="update_cart"],
.woocommerce-cart-form input[name="update_cart"],
.woocommerce-cart-form .button[name="update_cart"],
.woocommerce-cart-form td.actions button[name="update_cart"],
.woocommerce-cart-form td.actions input[name="update_cart"],
.et_pb_wc_cart_products .woocommerce-cart-form button[name="update_cart"],
.et_pb_wc_cart_products .woocommerce-cart-form input[name="update_cart"],
.et_pb_wc_cart_products .woocommerce-cart-form .button[name="update_cart"],
body.woocommerce-cart .woocommerce-cart-form button[name="update_cart"],
body.woocommerce-cart .woocommerce-cart-form input[name="update_cart"],
body.woocommerce-cart .woocommerce-cart-form .button[name="update_cart"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}


/* Checkout delivery notes: keep single-line input controlled without affecting textarea mode. */
body.woocommerce-checkout input#order_comments,
form.checkout input#order_comments,
.woocommerce-checkout form.checkout input#order_comments {
    min-height: 0 !important;
    height: auto !important;
    resize: none !important;
}
