/* Ecartup palette bridge. It is scoped to the storefront tree so WordPress's
   frontend admin bar keeps its own native colors and interactions. */

body.ecartup-storefront {
    background-color: var(--rivrun-bg, #fff9fc);
}

body.ecartup-storefront .wp-site-blocks {
    background-color: var(--rivrun-bg, #fff9fc);
    color: var(--rivrun-text, #241d28);
}

/* Product price colors are owned by the dynamic theme-option layer. Explicit Gutenberg Product Price colors remain authoritative. */

/* A sticky template-part without an explicit block background uses the
   Gutenberg base preset. Explicit block background classes remain untouched. */
body.ecartup-storefront header.wp-block-template-part.is-position-sticky:not(.has-background),
body.ecartup-storefront header.wp-block-template-part .is-position-sticky:not(.has-background) {
    background-color: var(--rivrun-bg, var(--wp--preset--color--base, #fff9fc)) !important;
    background-image: none;
    box-shadow: none !important;
}

/* Remove mouse-hover underlines and mouse-click focus rings added by generic
   theme styles. Keyboard focus-visible remains available for accessibility. */
body.ecartup-storefront .wp-site-blocks a:hover {
    text-decoration: none !important;
}

body.ecartup-storefront .wp-site-blocks :is(a, button, input, select, textarea):focus:not(:focus-visible),
body.ecartup-storefront .wp-site-blocks :is(a, button):active {
    outline: 0 !important;
    box-shadow: none !important;
}

body.ecartup-storefront .wp-site-blocks :is(a, button) {
    -webkit-tap-highlight-color: transparent;
}

/* Theme-generated controls follow the selected palette. */
body.ecartup-storefront .rivrun-load-more-button {
    border-color: var(--rivrun-button-bg, #ef4f91) !important;
    background: var(--rivrun-button-bg, #ef4f91) !important;
    color: var(--rivrun-button-text, #fff) !important;
}

body.ecartup-storefront .rivrun-load-more-button:hover {
    filter: brightness(.92);
}

body.ecartup-storefront .rivrun-load-more-status {
    color: var(--rivrun-muted, #746a76) !important;
}

body.ecartup-storefront :is(.wp-block-woocommerce-product-sale-badge, .wc-block-grid__product-onsale) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    line-height: normal !important;
}

body.ecartup-storefront :is(.wp-block-woocommerce-product-sale-badge, .wc-block-grid__product-onsale)::before,
body.ecartup-storefront :is(.wp-block-woocommerce-product-sale-badge, .wc-block-grid__product-onsale)::after {
    display: none !important;
    content: none !important;
}

body.ecartup-storefront :is(.onsale.rivrun-onsale-badge, .wc-block-components-product-sale-badge) {
    display: inline-flex !important;
    width: fit-content !important;
    min-width: 0 !important;
    max-width: max-content !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: .35em .8em !important;
    border: 1px solid color-mix(in srgb, var(--rivrun-sale-badge-text, #fff) 75%, transparent) !important;
    border-radius: 999px !important;
    background: var(--rivrun-sale-badge-bg, #f23883) !important;
    color: var(--rivrun-sale-badge-text, #fff) !important;
    box-shadow: none !important;
    line-height: 1 !important;
}

body.ecartup-storefront.single-product :is(
    .wp-block-woocommerce-product-gallery,
    .wc-block-product-gallery,
    .woocommerce-product-gallery,
    .wc-block-product-gallery-large-image,
    .wc-block-product-gallery-large-image__container,
    .wc-block-product-gallery-large-image__wrapper,
    .wc-block-product-gallery-thumbnails,
    .wc-block-components-product-image,
    .wp-block-woocommerce-product-image,
    .wc-block-components-product-image__inner-container
) {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.ecartup-storefront.single-product :is(.wp-block-woocommerce-product-gallery, .wc-block-product-gallery, .woocommerce-product-gallery) {
    padding: 0 !important;
    border-width: 0 !important;
    border-radius: 0 !important;
}

body.ecartup-storefront.single-product :is(
    form.cart,
    form.variations_form,
    .wp-block-woocommerce-add-to-cart-with-options,
    [class*="add-to-cart-with-options"]
) :is(.single_add_to_cart_button, .wc-block-components-product-button__button, button[type="submit"]):not(.multishop-premium-atc-button):not([style*="border"]) {
    border-color: var(--rivrun-button-bg, #ef4f91) !important;
}
body.ecartup-storefront.single-product :is(
    form.cart,
    form.variations_form,
    .wp-block-woocommerce-add-to-cart-with-options,
    [class*="add-to-cart-with-options"]
) :is(.single_add_to_cart_button, .wc-block-components-product-button__button, button[type="submit"]):not(.multishop-premium-atc-button):not(.has-background):not([style*="background"]) {
    background: var(--rivrun-button-bg, #ef4f91) !important;
}
body.ecartup-storefront.single-product :is(
    form.cart,
    form.variations_form,
    .wp-block-woocommerce-add-to-cart-with-options,
    [class*="add-to-cart-with-options"]
) :is(.single_add_to_cart_button, .wc-block-components-product-button__button, button[type="submit"]):not(.multishop-premium-atc-button):not(.has-text-color):not([style*="color"]) {
    color: var(--rivrun-button-text, #fff) !important;
}

body.ecartup-storefront .rivrun-sticky-cart__inner {
    background: linear-gradient(135deg, var(--rivrun-sticky-bg, #f55c9d), var(--rivrun-sticky-bg-2, #d93678)) !important;
}

body.ecartup-storefront .rivrun-sticky-cart__info,
body.ecartup-storefront .rivrun-sticky-cart__info strong {
    color: var(--rivrun-sticky-text, #fff) !important;
}

body.ecartup-storefront input[type="radio"],
body.ecartup-storefront input[type="checkbox"] {
    accent-color: var(--rivrun-accent-2, #ef4f91);
}

/* Palette bridge for WordPress/Gutenberg and WooCommerce controls. The rules
   stay inside the storefront tree, so the frontend WordPress admin bar keeps
   its original colors. Explicit custom inline block colors remain valid. */
body.ecartup-storefront {
    background-color: var(--rivrun-bg, #fff9fc) !important;
    color: var(--rivrun-text, #241d28);
}

body.ecartup-storefront .wp-site-blocks,
body.ecartup-storefront .wp-site-blocks > main {
    background-color: var(--rivrun-bg, #fff9fc);
    color: var(--rivrun-text, #241d28);
}

body.ecartup-storefront .wp-site-blocks main :where(a:not(.wp-element-button):not(.wp-block-button__link):not(.button):not(.add_to_cart_button)),
body.ecartup-storefront .wp-site-blocks footer :where(a:not(.wp-element-button):not(.wp-block-button__link):not(.button)) {
    color: var(--rivrun-link, var(--rivrun-accent-2, #ef4f91));
}

body.ecartup-storefront .wp-site-blocks header :where(a:not(.wp-element-button):not(.wp-block-button__link):not(.button)) {
    color: var(--rivrun-text, #241d28);
}

/* Theme Options supplies defaults only. Gutenberg blocks with an explicit
   background/text color retain their editor choice. */
body.ecartup-storefront .wp-site-blocks :is(
    .wp-element-button:not(.has-background):not(.has-text-color):not([style*="background"]):not([style*="color"]),
    .wp-block-button__link:not(.has-background):not(.has-text-color):not([style*="background"]):not([style*="color"]),
    .wc-block-components-button:not(.has-background):not(.has-text-color):not([style*="background"]):not([style*="color"]),
    .wc-block-components-product-button__button:not(.multishop-premium-atc-button):not(.has-background):not(.has-text-color):not([style*="background"]):not([style*="color"]),
    .woocommerce a.button:not([style*="background"]):not([style*="color"]),
    .woocommerce button.button:not([style*="background"]):not([style*="color"]),
    .woocommerce input.button:not([style*="background"]):not([style*="color"]),
    .single_add_to_cart_button:not([style*="background"]):not([style*="color"]),
    .add_to_cart_button:not([style*="background"]):not([style*="color"]),
    .checkout-button,
    .rivrun-load-more-button,
    .rivrun-inline-coupon-button,
    #place_order
) {
    border-color: var(--rivrun-button-bg, #ef4f91) !important;
    background-color: var(--rivrun-button-bg, #ef4f91) !important;
    color: var(--rivrun-button-text, #fff) !important;
}

body.ecartup-storefront .wp-site-blocks :is(
    .wp-element-button:not(.has-background):not(.has-text-color):not([style*="background"]):not([style*="color"]),
    .wp-block-button__link:not(.has-background):not(.has-text-color):not([style*="background"]):not([style*="color"]),
    .wc-block-components-button:not(.has-background):not(.has-text-color):not([style*="background"]):not([style*="color"]),
    .wc-block-components-product-button__button:not(.multishop-premium-atc-button):not(.has-background):not(.has-text-color):not([style*="background"]):not([style*="color"]),
    .woocommerce a.button:not([style*="background"]):not([style*="color"]),
    .woocommerce button.button:not([style*="background"]):not([style*="color"]),
    .woocommerce input.button:not([style*="background"]):not([style*="color"]),
    .single_add_to_cart_button:not([style*="background"]):not([style*="color"]),
    .add_to_cart_button:not([style*="background"]):not([style*="color"]),
    .checkout-button,
    .rivrun-load-more-button,
    .rivrun-inline-coupon-button,
    #place_order
):hover {
    border-color: var(--rivrun-accent-2, #ef4f91) !important;
    background-color: color-mix(in srgb, var(--rivrun-button-bg, #ef4f91) 86%, var(--rivrun-text, #241d28)) !important;
    color: var(--rivrun-button-text, #fff) !important;
}

/* Gutenberg Product Button stores explicit colors on the block wrapper while
   WooCommerce renders the clickable child. Carry the editor value inward. */
body.ecartup-storefront :is(.wp-block-woocommerce-product-button,.wc-block-components-product-button).has-background > :is(a,button),
body.ecartup-storefront :is(.wp-block-woocommerce-product-button,.wc-block-components-product-button)[style*="background"] > :is(a,button) {
    background: inherit !important;
}
body.ecartup-storefront :is(.wp-block-woocommerce-product-button,.wc-block-components-product-button).has-text-color > :is(a,button),
body.ecartup-storefront :is(.wp-block-woocommerce-product-button,.wc-block-components-product-button)[style*="color"] > :is(a,button) {
    color: inherit !important;
}

body.ecartup-storefront .wp-site-blocks :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
    select,
    textarea
) {
    border-color: var(--rivrun-border, #f3c8d8);
    background-color: var(--rivrun-surface, #fff);
    color: var(--rivrun-text, #241d28);
}

body.ecartup-storefront .wp-site-blocks :is(
    .wc-block-cart,
    .wc-block-checkout,
    .wc-block-components-sidebar,
    .wc-block-components-totals-wrapper,
    .woocommerce-cart-form,
    .cart_totals,
    .woocommerce-MyAccount-content
) {
    border-color: var(--rivrun-border, #f3c8d8);
    color: var(--rivrun-text, #241d28);
}

/* ---------------------------------------------------------
   Canonical WooCommerce price-color bridge — 11.2.7
   Theme Options are defaults. An explicit Gutenberg Product Price text color
   inherits into WooCommerce descendants and takes precedence.
   --------------------------------------------------------- */
body.ecartup-storefront:not(.single-product) :where(
    .wp-block-woocommerce-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-components-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-grid__product-price:not(.has-text-color):not([style*="color"]),
    .woocommerce ul.products li.product .price,
    .related.products .price,
    .upsells.products .price
) {
    color: var(--rivrun-price, #241d28) !important;
}
body.ecartup-storefront:not(.single-product) :where(
    .wp-block-woocommerce-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-components-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-grid__product-price:not(.has-text-color):not([style*="color"]),
    .woocommerce ul.products li.product .price,
    .related.products .price,
    .upsells.products .price
) ins,
body.ecartup-storefront:not(.single-product) :where(
    .wp-block-woocommerce-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-components-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-grid__product-price:not(.has-text-color):not([style*="color"]),
    .woocommerce ul.products li.product .price,
    .related.products .price,
    .upsells.products .price
) ins :where(.woocommerce-Price-amount,.woocommerce-Price-currencySymbol,bdi) {
    color: var(--rivrun-sale-price, #ef4f91) !important;
}
body.ecartup-storefront:not(.single-product) :where(
    .wp-block-woocommerce-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-components-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-grid__product-price:not(.has-text-color):not([style*="color"]),
    .woocommerce ul.products li.product .price,
    .related.products .price,
    .upsells.products .price
) del,
body.ecartup-storefront:not(.single-product) :where(
    .wp-block-woocommerce-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-components-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-grid__product-price:not(.has-text-color):not([style*="color"]),
    .woocommerce ul.products li.product .price,
    .related.products .price,
    .upsells.products .price
) del :where(.woocommerce-Price-amount,.woocommerce-Price-currencySymbol,bdi) {
    color: var(--rivrun-regular-price, #9a8f99) !important;
}

/* Main single-product price has its own independent controls. */
body.ecartup-storefront.single-product :where(
    .wp-block-woocommerce-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-components-product-price:not(.has-text-color):not([style*="color"]),
    .summary p.price,
    .summary span.price,
    .woocommerce div.product p.price,
    .woocommerce div.product span.price
) {
    color: var(--rivrun-single-price, var(--rivrun-price, #241d28)) !important;
}
body.ecartup-storefront.single-product :where(
    .wp-block-woocommerce-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-components-product-price:not(.has-text-color):not([style*="color"]),
    .summary p.price,
    .summary span.price,
    .woocommerce div.product p.price,
    .woocommerce div.product span.price
) ins,
body.ecartup-storefront.single-product :where(
    .wp-block-woocommerce-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-components-product-price:not(.has-text-color):not([style*="color"]),
    .summary p.price,
    .summary span.price,
    .woocommerce div.product p.price,
    .woocommerce div.product span.price
) ins :where(.woocommerce-Price-amount,.woocommerce-Price-currencySymbol,bdi) {
    color: var(--rivrun-single-sale-price, var(--rivrun-sale-price, #ef4f91)) !important;
}
body.ecartup-storefront.single-product :where(
    .wp-block-woocommerce-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-components-product-price:not(.has-text-color):not([style*="color"]),
    .summary p.price,
    .summary span.price,
    .woocommerce div.product p.price,
    .woocommerce div.product span.price
) del,
body.ecartup-storefront.single-product :where(
    .wp-block-woocommerce-product-price:not(.has-text-color):not([style*="color"]),
    .wc-block-components-product-price:not(.has-text-color):not([style*="color"]),
    .summary p.price,
    .summary span.price,
    .woocommerce div.product p.price,
    .woocommerce div.product span.price
) del :where(.woocommerce-Price-amount,.woocommerce-Price-currencySymbol,bdi) {
    color: var(--rivrun-single-regular-price, var(--rivrun-regular-price, #9a8f99)) !important;
}

/* Related and upsell cards on a single-product screen are still product cards,
   so they use the global card price controls rather than the main-product ones. */
body.ecartup-storefront.single-product :is(.related.products,.upsells.products,.cross-sells,.wp-block-woocommerce-related-products) :where(.price,.wp-block-woocommerce-product-price,.wc-block-components-product-price) {
    color: var(--rivrun-price, #241d28) !important;
}
body.ecartup-storefront.single-product :is(.related.products,.upsells.products,.cross-sells,.wp-block-woocommerce-related-products) :where(.price,.wp-block-woocommerce-product-price,.wc-block-components-product-price) ins,
body.ecartup-storefront.single-product :is(.related.products,.upsells.products,.cross-sells,.wp-block-woocommerce-related-products) :where(.price,.wp-block-woocommerce-product-price,.wc-block-components-product-price) ins :where(.woocommerce-Price-amount,.woocommerce-Price-currencySymbol,bdi) {
    color: var(--rivrun-sale-price, #ef4f91) !important;
}
body.ecartup-storefront.single-product :is(.related.products,.upsells.products,.cross-sells,.wp-block-woocommerce-related-products) :where(.price,.wp-block-woocommerce-product-price,.wc-block-components-product-price) del,
body.ecartup-storefront.single-product :is(.related.products,.upsells.products,.cross-sells,.wp-block-woocommerce-related-products) :where(.price,.wp-block-woocommerce-product-price,.wc-block-components-product-price) del :where(.woocommerce-Price-amount,.woocommerce-Price-currencySymbol,bdi) {
    color: var(--rivrun-regular-price, #9a8f99) !important;
}

/* Gutenberg explicit Product Price colors live on the block root. They must
   win over the theme defaults above, including nested del/ins amount markup. */
body.ecartup-storefront :is(
    .wp-block-woocommerce-product-price.has-text-color,
    .wp-block-woocommerce-product-price[style*="color"],
    .wc-block-components-product-price.has-text-color,
    .wc-block-components-product-price[style*="color"]
) :where(.wc-block-components-product-price,.woocommerce-Price-amount,.woocommerce-Price-currencySymbol,.wc-block-formatted-money-amount,bdi,ins,del) {
    color: inherit !important;
}

/* Optional delayed header. Page scope is controlled exclusively by Theme Options. */
body.ecartup-storefront {
    --onlymedx-admin-bar-offset: 0px;
}

body.ecartup-storefront.admin-bar {
    --onlymedx-admin-bar-offset: 32px;
}

body.ecartup-storefront.onlymedx-delayed-site-header .wp-site-blocks > header.wp-block-template-part,
body.ecartup-storefront.onlymedx-delayed-site-header header.wp-block-template-part,
body.ecartup-storefront.onlymedx-delayed-site-header header.onlymedx-delayed-header,
body.ecartup-storefront.onlymedx-delayed-site-header header.onlymedx-site-header {
    position: fixed !important;
    top: var(--onlymedx-admin-bar-offset) !important;
    right: 0 !important;
    left: 0 !important;
    z-index: 99990 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    transform: translate3d(0, calc(-100% - 12px), 0) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform .28s ease, opacity .22s ease, visibility 0s linear .28s !important;
}

body.ecartup-storefront.onlymedx-delayed-site-header .wp-site-blocks > header.wp-block-template-part.is-onlymedx-header-visible,
body.ecartup-storefront.onlymedx-delayed-site-header header.wp-block-template-part.is-onlymedx-header-visible,
body.ecartup-storefront.onlymedx-delayed-site-header header.onlymedx-delayed-header.is-onlymedx-header-visible,
body.ecartup-storefront.onlymedx-delayed-site-header header.onlymedx-site-header.is-onlymedx-header-visible {
    transform: translate3d(0, 0, 0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background-color: var(--ecartup-header-background, var(--rivrun-bg, var(--wp--preset--color--base, #fff9fc))) !important;
    background-image: var(--ecartup-header-background-image, none) !important;
    transition-delay: 0s !important;
}

body.ecartup-storefront.onlymedx-delayed-site-header header .is-position-sticky {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    z-index: auto !important;
}

@media (max-width: 782px) {
    body.ecartup-storefront.admin-bar {
        --onlymedx-admin-bar-offset: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ecartup-storefront.onlymedx-delayed-site-header .wp-site-blocks > header.wp-block-template-part,
    body.ecartup-storefront.onlymedx-delayed-site-header .onlymedx-delayed-header {
        transition: none !important;
    }
}


/* Checkout header visibility: Theme Options is the single authority. */
body.ecartup-storefront.one2tenx-checkout-header-hide :is(.wp-site-blocks > header.wp-block-template-part,.ecup-v5-header-wrap,header.ecartup-header,header.onlymedx-site-header,header.onlymedx-delayed-header) {
    display: none !important;
}
body.ecartup-storefront.one2tenx-checkout-header-show :is(
    .wp-site-blocks > header.wp-block-template-part,
    header.wp-block-template-part,
    header.onlymedx-delayed-header,
    header.onlymedx-site-header,
    .ecup-v5-header-wrap
) {
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    max-height: none !important;
}
