/* Pending: hide prices for the one round trip on a first visit. */
html.htsp-region-pending .price,
html.htsp-region-pending .product-price-wrapper,
html.htsp-region-pending .product-card__price,
html.htsp-region-pending .product-card__links,
html.htsp-region-pending form.cart {
    visibility: hidden;
}

/* Gated EU visitor. */
html.htsp-eu-gated .price,
html.htsp-eu-gated .product-price-wrapper,
html.htsp-eu-gated .product-card__price,
html.htsp-eu-gated .product-card__links,
html.htsp-eu-gated .price-rrp,
html.htsp-eu-gated .price-saving,
html.htsp-eu-gated .trade-login-link,
html.htsp-eu-gated form.cart,
html.htsp-eu-gated .pdp_add_to_cart_button,
html.htsp-eu-gated .widget_shopping_cart,
html.htsp-eu-gated .mini-cart,
html.htsp-eu-gated .basket-btn,
html.htsp-eu-gated .cart-modal,
html.htsp-eu-gated a[href$="/basket/"],
html.htsp-eu-gated a[href$="/cart/"],
html.htsp-eu-gated a[href$="/checkout/"] {
    display: none !important;
}

.htsp-eu-cta {
    display: none;
    font-weight: 600;
    margin: 0.5rem 0;
}
html.htsp-eu-gated .htsp-eu-cta {
    display: block;
}
/* On product cards the CTA stands in for the hidden price block, so it takes
   the same inline padding, top rule and bottom spacing as .product-card__price
   and sits flush above .product-card__bottom. */
.product-card .htsp-eu-cta {
    margin: auto 0 0;
    padding: 1rem 1rem 0.5rem;
    border-top: 1px solid #eee;
    background: #fff;
    font-size: 0.95rem;
    line-height: 1.35;
}
.product-card .htsp-eu-cta a {
    color: inherit;
    text-decoration: underline;
}

.htsp-eu-interstitial {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(13, 20, 40, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.htsp-eu-interstitial[hidden] {
    display: none;
}
.htsp-eu-interstitial__panel {
    background: #fff;
    max-width: 520px;
    width: 100%;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(13, 20, 40, 0.25);
}
.htsp-eu-interstitial__panel h2 {
    font-size: 1.75rem;
    line-height: 1.15;
    margin: 0 0 0.75rem;
}
/* The heading takes focus when the interstitial opens so screen readers
   announce it. It is not interactive, so it draws no focus ring. */
#htsp-eu-interstitial-title:focus,
#htsp-eu-interstitial-title:focus-visible {
    outline: none;
}
.htsp-eu-interstitial__panel > p {
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

/* Two equal buttons from the theme: green primary, outlined navy secondary. */
.htsp-eu-interstitial__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.htsp-eu-interstitial__actions .button {
    flex: 1 1 0;
    min-width: max-content;
    min-height: 2.75rem;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Secondary choices: plain text links below a rule, clearly not buttons. */
.htsp-eu-interstitial__links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #eee;
}
.htsp-eu-interstitial__link {
    align-self: flex-start;
    color: #26285b;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.htsp-eu-interstitial__link:hover,
.htsp-eu-interstitial__link:focus-visible {
    color: #018849;
}
.htsp-eu-interstitial__link:focus-visible {
    outline: 2px solid #26285b;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .htsp-eu-interstitial__panel {
        padding: 24px 20px;
    }
    .htsp-eu-interstitial__panel h2 {
        font-size: 1.5rem;
    }
    .htsp-eu-interstitial__actions {
        flex-direction: column;
    }
    .htsp-eu-interstitial__actions .button {
        width: 100%;
    }
}

/* Shopping preferences (theme): approved EU dealers have a fixed region and see
   ex VAT EUR prices only, so the chip has nothing to change. Gated EU visitors
   see no prices, so they get the region choice without the VAT switch. */
body.htsp-eu-dealer .shop-prefs,
html.htsp-eu-gated body.logged-in .shop-prefs {
    /* A logged in gated account has a fixed region and sees no prices: nothing to change. */
    display: none !important;
}
html.htsp-eu-gated .shop-prefs__divider,
html.htsp-eu-gated .shop-prefs__vat,
html.htsp-eu-gated .shop-prefs__group--vat,
html.htsp-region-pending .shop-prefs__divider,
html.htsp-region-pending .shop-prefs__vat {
    display: none !important;
}

/* Guest PDP: the cached stock line is the UK figure. Keep it hidden while the
   region is pending or EU until eu-trade.js swaps in the NL figure. Logged in
   pages render EU stock server side, so they are left alone. */
html.htsp-region-pending body:not(.logged-in) div.stock-status:not(.htsp-eu-stock),
html.htsp-eu-gated body:not(.logged-in) div.stock-status:not(.htsp-eu-stock) {
    visibility: hidden;
}

/* Guest out of stock form. The server renders it when either warehouse is out.
   UK guests: shown only when UK is out, as before. EU and pending guests:
   hidden until eu-trade.js reads live NL stock and adds .htsp-eu-show. */
.htsp-enquire-copy--eu {
    display: none;
}
body:not(.logged-in) .product-enquire-form--regional[data-uk-out="0"] {
    display: none;
}
html.htsp-region-pending body:not(.logged-in) .product-enquire-form--regional,
html.htsp-eu-gated body:not(.logged-in) .product-enquire-form--regional:not(.htsp-eu-show) {
    display: none !important;
}
html.htsp-eu-gated body:not(.logged-in) .product-enquire-form--regional.htsp-eu-show {
    display: block !important;
}
html.htsp-eu-gated .product-enquire-form--regional .htsp-enquire-copy--uk {
    display: none;
}
html.htsp-eu-gated .product-enquire-form--regional .htsp-enquire-copy--eu {
    display: block;
}

/* Stripe express checkout: EU orders use the standard checkout only. */
html.htsp-eu-gated #wc-stripe-express-checkout-element,
html.htsp-eu-gated #wc-stripe-express-checkout-button-separator,
html.htsp-eu-gated #wc-stripe-payment-request-wrapper,
html.htsp-eu-gated #wc-stripe-payment-request-button-separator,
body.htsp-eu-dealer #wc-stripe-express-checkout-element,
body.htsp-eu-dealer #wc-stripe-express-checkout-button-separator,
body.htsp-eu-dealer #wc-stripe-payment-request-wrapper,
body.htsp-eu-dealer #wc-stripe-payment-request-button-separator {
    display: none !important;
}

/* Interstitial open: lock page scroll behind it. */
html.htsp-eu-modal-open,
html.htsp-eu-modal-open body {
    overflow: hidden;
}

/* UK next day delivery messaging does not apply to EU orders from the NL warehouse. */
html.htsp-eu-gated .delivery-countdown,
html.htsp-eu-gated .timer-countdown,
body.htsp-eu-dealer .delivery-countdown,
body.htsp-eu-dealer .timer-countdown {
    display: none !important;
}

/* My Account: EU VAT number panel. */
.eu-trade-vat {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid #d6e0e2;
    border-radius: 8px;
    background: #fff;
}
.eu-trade-vat__title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}
.eu-trade-vat__status {
    margin: 0 0 0.75rem;
}
.eu-trade-vat__form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
}
.eu-trade-vat__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 14rem;
    min-width: 0;
}
.eu-trade-vat__hint {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.85rem;
    color: #4b5560;
}

/* Region specific wording. The HTML carries the UK text and the EU text in
   data-eu; eu-trade.js swaps it for EU visitors, so the heading stays hidden
   until the region is known. */
html.htsp-region-pending .htsp-regional,
html.htsp-eu-gated .htsp-regional:not(.htsp-regional--eu) {
    visibility: hidden;
}

/* Launch gift message on the basket and checkout: the theme's trade notice
   colours, inside the page container, with room before the form. */
.woocommerce .htsp-gift-notice {
    margin: 0 0 1.5rem;
}

/* Checkout for an approved dealer. The theme hides the postcode finder with
   an inline style that Bootstrap's d-flex outranks, leaving an empty flex box
   beside the company field and a stray column gap. */
body.htsp-eu-dealer #postcode_lookup,
body.htsp-eu-dealer .enter-address-manually {
    display: none !important;
}

/* The fixed country reads as a value, not a heading. */
body.htsp-eu-dealer .eu-trade-fixed-country {
    display: block;
    font-weight: 500;
    padding: .5rem 0;
}
