/**
 * Bigpixel_RfqGate frontend styles
 *
 * Loaded as a static file (not inline) so it works under any Content
 * Security Policy. All rules are scoped to body.bigpixel-rfq-international,
 * which the JS only adds after AJAX confirms the session is international.
 *
 * Selectors confirmed against multiple themes:
 *   - Smartwave Porto / Luma:  #product-addtocart-button (PDP),
 *                              [data-role="addToCartButton"] (Cart2Quote category)
 *   - Hyvä default theme:      [data-addto="cart"]
 *   - Universal fallback:      form[action*="/checkout/cart/add"] button[type=submit]
 *
 * Cart2Quote's "Add to Quote" buttons (data-role="addToQuoteButton",
 * class includes "toquote") are intentionally NOT hidden.
 */

/* === Hide Add-to-Cart buttons === */
body.bigpixel-rfq-international #product-addtocart-button,
body.bigpixel-rfq-international button[data-role="addToCartButton"],
body.bigpixel-rfq-international input[data-role="addToCartButton"],
body.bigpixel-rfq-international button[data-addto="cart"],
body.bigpixel-rfq-international a[data-addto="cart"],
body.bigpixel-rfq-international button[name="addtocart"],
body.bigpixel-rfq-international input[name="addtocart"],
body.bigpixel-rfq-international form[action*="/checkout/cart/add"] button[type="submit"]:not(.toquote):not([data-role="addToQuoteButton"]),
body.bigpixel-rfq-international form[action*="/checkout/cart/add"] input[type="submit"]:not(.toquote):not([data-role="addToQuoteButton"]) {
    display: none !important;
    visibility: hidden !important;
}

/* === Hide qty controls (no point picking quantity if you can't add to cart) === */
body.bigpixel-rfq-international .product-add-form .field.qty,
body.bigpixel-rfq-international .product-info-main .box-tocart .field.qty {
    display: none !important;
}

/* === Hide payment shortcuts (only relevant for direct purchase) === */
body.bigpixel-rfq-international #instant-purchase,
body.bigpixel-rfq-international #payment-method-messaging-element,
body.bigpixel-rfq-international .paypal.checkout,
body.bigpixel-rfq-international [data-label="or"].paypal {
    display: none !important;
}

/* === Notice banner: hidden by default, shown when JS adds body class === */
#bigpixel-rfq-gate-notice {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff8e1;
    border-bottom: 4px solid #f59e0b;
    color: #856404;
    padding: 12px 18px;
    font-size: 14px;
    line-height: 1.45;
    box-sizing: border-box;
    z-index: 99999;          /* above everything: header, sticky bars, modals backdrops, chat widgets */
}

#bigpixel-rfq-gate-notice .bigpixel-rfq-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#bigpixel-rfq-gate-notice .bigpixel-rfq-icon {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1.3;
    color: #f59e0b;
    /* Lock against flex squashing */
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    margin-top: 1px;
}

#bigpixel-rfq-gate-notice p {
    margin: 0;
}

body.bigpixel-rfq-international #bigpixel-rfq-gate-notice {
    display: block;
}

/*
 * When the banner is visible, push the rest of the page down so the
 * fixed banner doesn't cover the header. 56px matches typical banner
 * height (one line of text + padding); banners that wrap to two lines
 * may overlap slightly on narrow viewports — acceptable trade-off vs
 * doing JS-based dynamic measurement.
 */
body.bigpixel-rfq-international {
    padding-top: 56px;
}

@media (max-width: 640px) {
    body.bigpixel-rfq-international {
        padding-top: 88px;   /* extra room for wrapped text on mobile */
    }
}

/* === Inline checkout alert (Phase 5) =================================== */
/*
 * Injected by JS into the checkout page payment area when international
 * is detected. More prominent than the top notice banner — explicitly
 * tells the customer their order can't proceed, plus offers a CTA button
 * to take them directly to the RFQ flow.
 */

#bigpixel-rfq-checkout-alert {
    display: block;
    background: #fff8e1;
    border: 2px solid #f59e0b;
    border-radius: 6px;
    color: #856404;
    padding: 16px 20px;
    margin: 0 0 20px 0;
    box-sizing: border-box;
    font-size: 15px;
    line-height: 1.5;
}

#bigpixel-rfq-checkout-alert .bigpixel-rfq-checkout-alert-inner {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
}

#bigpixel-rfq-checkout-alert .bigpixel-rfq-checkout-alert-icon {
    font-size: 24px;
    line-height: 1;
    flex: 0 0 auto;
}

#bigpixel-rfq-checkout-alert .bigpixel-rfq-checkout-alert-text {
    flex: 1 1 280px;
    min-width: 0;
}

#bigpixel-rfq-checkout-alert .bigpixel-rfq-checkout-alert-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    color: #6c4a04;
}

#bigpixel-rfq-checkout-alert .bigpixel-rfq-checkout-alert-text p {
    margin: 0;
}

#bigpixel-rfq-checkout-alert .bigpixel-rfq-checkout-alert-btn {
    flex: 0 0 auto;
    display: inline-block;
    background: #f59e0b;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    align-self: center;
    transition: background 0.15s ease;
}

#bigpixel-rfq-checkout-alert .bigpixel-rfq-checkout-alert-btn:hover,
#bigpixel-rfq-checkout-alert .bigpixel-rfq-checkout-alert-btn:focus {
    background: #d68208;
    color: #fff !important;
    text-decoration: none !important;
}

/* Visually disable Place Order button when our gate kicks in */
button.bigpixel-rfq-disabled,
.bigpixel-rfq-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* === Cart-page inline alert =========================================== */
/*
 * Shown above the cart contents when an international shipping address is
 * entered in the estimator. Injected by JS into the cart-page DOM.
 *
 * Cart page anchor: .checkout-cart-index .page-title-wrapper (Luma/Porto)
 * Hyvä cart page anchor: same selector path on standard Hyvä carts
 */
#bigpixel-rfq-cart-alert {
    display: block;
    background: #fff8e1;
    border: 2px solid #f59e0b;
    border-radius: 6px;
    color: #856404;
    padding: 14px 18px;
    margin: 0 0 20px 0;
    box-sizing: border-box;
    font-size: 15px;
    line-height: 1.5;
}

#bigpixel-rfq-cart-alert .bigpixel-rfq-cart-alert-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

#bigpixel-rfq-cart-alert .bigpixel-rfq-cart-alert-icon {
    font-size: 22px;
    line-height: 1;
    flex: 0 0 auto;
    color: #f59e0b;
}

#bigpixel-rfq-cart-alert .bigpixel-rfq-cart-alert-text {
    flex: 1 1 auto;
}

/* Disabled Proceed-to-Checkout button styling (cart page) */
button.bigpixel-rfq-disabled,
.bigpixel-rfq-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}
