/* Scoped fixes: preserve page zoom, drawer animation and checkout behavior. */
.fbco-repair-help-wrap {
    box-sizing: border-box;
    max-width: 100%;
    margin: 14px 0;
    padding: 0;
    direction: rtl;
    text-align: start;
}
.fbco-repair-help-wrap[hidden] { display: none !important; }
.fbco-repair-help-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    max-width: 100%;
    min-height: 44px;
    padding: 9px 15px;
    border: 1px solid #086647;
    border-radius: 10px;
    background: #f0f8f4;
    color: #07503a;
    font: 600 16px/1.5 Tahoma,Arial,sans-serif;
    white-space: normal;
    cursor: pointer;
}
.fbco-repair-help-button:focus-visible { outline: 3px solid #2458a0; outline-offset: 3px; }
#fbco-welcome-offer #fbco-repair-offer-payment {
    margin: 10px 0 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff4f5;
    color: #8d1730;
    font-size: 15px;
    line-height: 1.7;
}
#fbco-chat-host[data-fbco-repair-suppressed] { display: none !important; }
#fbco-chat-host[data-fbco-repair-open]:not([data-shop-desktop]) {
    bottom: var(--fbco-repair-bottom, calc(14px + env(safe-area-inset-bottom))) !important;
    max-height: var(--fbco-repair-chat-height, calc(100dvh - 28px));
}
/* The WooCommerce drawer and chat previously shared z-index:9999. */
body:has(.wc-block-components-drawer__screen-overlay:not(.wc-block-components-drawer__screen-overlay--is-hidden)) #fbco-chat-host {
    display: none !important;
}
body.fbco-repair-drawer-open #fbco-chat-host { display: none !important; }
/* CookieAdmin's re-open icon is 99999; its consent modal stays above this at 999999. */
.wc-block-components-drawer__screen-overlay { z-index: 100000 !important; }
body:has(.wc-block-components-drawer__screen-overlay:not(.wc-block-components-drawer__screen-overlay--is-hidden)) button.cookieadmin_re_consent,
body.fbco-repair-drawer-open button.cookieadmin_re_consent {
    visibility: hidden !important;
    pointer-events: none !important;
}

@media screen and (max-width: 900px) {
    html body.woocommerce-checkout :is(input.input-text, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="search"], textarea, select, .select2-container .select2-selection),
    body.woocommerce-account :is(input.input-text, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="search"], textarea, select),
    body.woocommerce-cart :is(input.input-text, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="search"], textarea, select),
    body :is(.wc-block-checkout, .wc-block-cart) :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select),
    body :is(.wp-block-search__input, .select2-search__field, .select2-container .select2-selection, .fbco-quote-form input, .fbco-quote-form textarea) {
        font-size: 16px !important;
        line-height: 1.5 !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    body:is(.woocommerce-checkout, .woocommerce-cart, .woocommerce-account) :is(main, .wp-block-post-content, .woocommerce, form.checkout, #customer_details, .col2-set, .woocommerce-billing-fields, .woocommerce-billing-fields__field-wrapper, .woocommerce-additional-fields, #order_review) {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    body.woocommerce-checkout .woocommerce form .form-row {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    body.woocommerce-checkout .woocommerce-checkout-review-order-table :is(th, td) {
        overflow-wrap: anywhere;
    }
    body :is(.select2-container, .select2-dropdown) { max-width: 100% !important; box-sizing: border-box !important; }
    body footer .fbco-group-identity {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        flex: 1 1 auto;
    }
    body footer .fbco-group-identity :is(span, strong, small) {
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }
    body footer .fbco-group-identity img { flex: 0 0 auto; max-width: 60px !important; height: auto; }
    body footer .alignwide:has(.fbco-group-identity):has(.wp-block-social-links) {
        flex-wrap: wrap !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        gap: 12px !important;
    }
    body footer .alignwide > .wp-block-group:has(.fbco-group-identity) { min-width: 0 !important; max-width: 100% !important; }
    body .fbco-unified-header .fbco-unified-header-buttons {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 6px !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    body .fbco-unified-header .fbco-unified-header-buttons .wp-block-button.customer-login { grid-column: 1 / -1 !important; }
    body .fbco-unified-header .fbco-unified-header-buttons .wp-block-button,
    body .fbco-unified-header .fbco-unified-header-buttons .wp-block-button .wp-block-button__link {
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 44px !important;
        height: auto !important;
        max-height: none !important;
        box-sizing: border-box !important;
    }
    body .fbco-unified-header .fbco-unified-header-buttons .wp-block-button .wp-block-button__link {
        font-size: 12px !important;
        line-height: 1.4 !important;
        padding: 6px 4px !important;
        white-space: normal !important;
    }
}
@media screen and (max-width: 365px) {
    body .fbco-unified-header .fbco-unified-header-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Keep the mini-cart's fixed-width drawer independent of page/product styles.
 * Woo's original row creates implicit tracks beside its 60px + 132px columns.
 * Give details the remaining width and keep totals in their own row instead.
 */
body .wc-block-mini-cart__drawer table.wc-block-mini-cart-items,
body .wc-block-mini-cart__drawer table.wc-block-mini-cart-items > tbody {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
body .wc-block-mini-cart__drawer table.wc-block-mini-cart-items .wc-block-cart-items__row:not([hidden]) {
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) !important;
    column-gap: 12px !important;
    row-gap: 8px;
    align-items: start;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
body .wc-block-mini-cart__drawer table.wc-block-mini-cart-items .wc-block-cart-items__row > td {
    min-width: 0;
    width: auto;
    padding: 0 !important;
    box-sizing: border-box;
}
body .wc-block-mini-cart__drawer .wc-block-cart-items__row > .wc-block-cart-item__image {
    grid-column: 1 / 2 !important;
    grid-row: 1 / 2 !important;
}
body .wc-block-mini-cart__drawer .wc-block-cart-items__row > .wc-block-cart-item__product {
    grid-column: 2 / 3 !important;
    grid-row: 1 / 2 !important;
}
body .wc-block-mini-cart__drawer .wc-block-cart-items__row > .wc-block-cart-item__total {
    grid-column: 2 / 3 !important;
    grid-row: 2 / 3 !important;
    justify-self: start;
    text-align: start;
}
body .wc-block-mini-cart__drawer .wc-block-cart-item__wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    align-items: stretch !important;
}
body .wc-block-mini-cart__drawer .wc-block-components-product-name:not([hidden]) {
    display: block !important;
    width: 100%;
    min-width: 0;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    overflow: visible;
    -webkit-line-clamp: unset;
}
body .wc-block-mini-cart__drawer .wc-block-components-product-price {
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}
body .wc-block-mini-cart__drawer .wc-block-cart-item__quantity {
    flex-wrap: wrap;
    gap: 8px !important;
    min-width: 0;
    max-width: 100%;
}
body .wc-block-mini-cart__drawer .wc-block-components-quantity-selector {
    flex: 0 0 134px;
    width: 134px !important;
    min-width: 134px !important;
    max-width: 100% !important;
    min-height: 46px;
    box-sizing: border-box;
}
body .wc-block-mini-cart__drawer .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
    flex: 1 1 44px !important;
    width: 44px !important;
    min-width: 0 !important;
    max-width: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
}
body .wc-block-mini-cart__drawer .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    box-sizing: border-box;
}
body .wc-block-mini-cart__drawer .wc-block-cart-item__quantity .wc-block-cart-item__remove-link {
    flex: 0 0 44px;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px;
}
@media screen and (max-width: 900px) {
    html body.single-product #commentform :is(.comment-form-author, .comment-form-email) {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    html body.single-product #commentform :is(input#author, input#email) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
    }
}

.fbco-repair-cart-block-notices {
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 0 20px;
    text-align: start;
    overflow-wrap: anywhere;
}
.fbco-repair-cart-block-notices .fbco-payment-discount-policy {
    margin: 12px 0 0;
    font-size: 16px;
    line-height: 1.7;
}
/* The full Cart block needs the same explicit tracks at mobile widths only.
 * Its desktop table and the WooCommerce interactivity bindings stay intact.
 */
@media screen and (max-width: 900px) {
    body .wp-block-woocommerce-cart,
    body .wp-block-woocommerce-cart .wc-block-cart__main,
    body .wp-block-woocommerce-cart table.wc-block-cart-items,
    body .wp-block-woocommerce-cart table.wc-block-cart-items > tbody {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    body .wp-block-woocommerce-cart table.wc-block-cart-items,
    body .wp-block-woocommerce-cart table.wc-block-cart-items > tbody {
        display: block;
        width: 100% !important;
    }
    body .wp-block-woocommerce-cart table.wc-block-cart-items > thead { display: none; }
    body .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row:not([hidden]) {
        display: grid !important;
        grid-template-columns: 56px minmax(0, 1fr) !important;
        column-gap: 12px !important;
        row-gap: 8px;
        align-items: start;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    body .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row > td {
        min-width: 0 !important;
        max-width: 100%;
        width: auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    body .wp-block-woocommerce-cart .wc-block-cart-items__row > .wc-block-cart-item__image {
        grid-column: 1 / 2 !important;
        grid-row: 1 / 2 !important;
    }
    body .wp-block-woocommerce-cart .wc-block-cart-items__row > .wc-block-cart-item__product {
        grid-column: 2 / 3 !important;
        grid-row: 1 / 2 !important;
    }
    body .wp-block-woocommerce-cart .wc-block-cart-items__row > .wc-block-cart-item__total {
        grid-column: 2 / 3 !important;
        grid-row: 2 / 3 !important;
        justify-self: start;
        text-align: start;
    }
    body .wp-block-woocommerce-cart .wc-block-cart-item__wrap {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        align-items: stretch !important;
    }
    body .wp-block-woocommerce-cart .wc-block-components-product-name:not([hidden]) {
        display: block !important;
        width: 100%;
        min-width: 0;
        max-width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
        white-space: normal;
        word-break: normal;
        overflow-wrap: anywhere;
        overflow: visible;
        -webkit-line-clamp: unset;
    }
    body .wp-block-woocommerce-cart .wc-block-cart-item__quantity {
        flex-wrap: wrap;
        gap: 8px !important;
        min-width: 0;
        max-width: 100%;
    }
    body .wp-block-woocommerce-cart .wc-block-components-quantity-selector {
        flex: 0 0 134px;
        width: 134px !important;
        min-width: 134px !important;
        max-width: 100% !important;
        min-height: 46px;
        box-sizing: border-box;
    }
    body .wp-block-woocommerce-cart .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
        flex: 1 1 44px !important;
        width: 44px !important;
        min-width: 0 !important;
        max-width: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 16px !important;
        box-sizing: border-box !important;
    }
    body .wp-block-woocommerce-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
        flex: 0 0 44px;
        width: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        box-sizing: border-box;
    }
    body .wp-block-woocommerce-cart .wc-block-cart-item__quantity .wc-block-cart-item__remove-link {
        flex: 0 1 auto;
        width: auto !important;
        min-width: 44px;
        max-width: 100%;
        height: auto !important;
        min-height: 44px;
        white-space: normal !important;
    }
}

/* Keep mobile page boundaries still without disabling pinch zoom or nested scrolling. */
@media screen and (max-width: 900px) {
    html, body { overscroll-behavior-x: none; }
}
