/* Shop Pro semantic palette system v1.3.1
 * One source of truth for page, header, navigation, WooCommerce and interaction
 * colors. Loaded last so legacy MultiShop/Ecartup rules cannot leave half-applied
 * palettes (for example a dark page with black product titles).
 */

html body{
  background:var(--shoppro-bg)!important;
  color:var(--shoppro-text)!important;
}
html body :where(p,li,dt,dd,figcaption,.wp-block-post-excerpt,.woocommerce-product-details__short-description):not(.has-text-color){color:inherit}
html body :where(a):not(.wp-element-button):not(.has-text-color){color:var(--shoppro-link)}
html body :where(a,button,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--shoppro-focus)!important;outline-offset:2px}

/* Generic surfaces — deliberately excludes media/gallery elements. */
html body :where(.woocommerce-notices-wrapper .woocommerce-message,.woocommerce-notices-wrapper .woocommerce-info,.woocommerce-notices-wrapper .woocommerce-error,.wc-block-components-notice-banner,.woocommerce form.checkout,.woocommerce-cart-form,.cart_totals,.woocommerce-MyAccount-content,.woocommerce-MyAccount-navigation,.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout){
  color:var(--shoppro-text);
}
html body :where(.woocommerce-message,.woocommerce-info,.woocommerce-error,.wc-block-components-notice-banner){
  background:var(--shoppro-surface)!important;color:var(--shoppro-text)!important;border-color:var(--shoppro-border)!important
}

/* ---------- Header: main row ---------- */
html body .ecup-v5-header-wrap,
html body .ecup-v5-header-wrap .ecup-v5-main,
html body header .ecup-v5-main{
  background:var(--shoppro-header-bg)!important;
  color:var(--shoppro-header-text)!important;
  border-color:var(--shoppro-header-border)!important;
}
html body .ecup-v5-header-wrap :where(.ecup-v5-logo,.ecup-v5-account,.ecup-v5-cart,.multishop-header-account-block,.multishop-header-cart-block){color:var(--shoppro-header-text)!important}
html body .ecup-v5-header-wrap :where(.ecup-v5-account-copy small,.ecup-v5-cart-label,.multishop-header-account__copy small){color:var(--shoppro-header-muted)!important}

/* Search/control surfaces. */
html body .ecup-v5-header-wrap :where(.ecup-v5-search-form,.ecup-v5-search.wp-block-search .wp-block-search__inside-wrapper,.ecup-v5-account,.ecup-v5-cart,.multishop-header-account-block>a,.multishop-header-cart-block>a){
  background:var(--shoppro-header-control-bg)!important;
  color:var(--shoppro-header-control-text)!important;
  border-color:var(--shoppro-header-border)!important;
}
html body .ecup-v5-header-wrap :where(.ecup-v5-search-input,.wp-block-search__input){color:var(--shoppro-header-control-text)!important;background:transparent!important}
html body .ecup-v5-header-wrap :where(.ecup-v5-search-input,.wp-block-search__input)::placeholder{color:var(--shoppro-header-muted)!important;opacity:.78}
html body .ecup-v5-header-wrap :where(.ecup-v5-search-btn,.wp-block-search__button){background:var(--shoppro-button-bg)!important;color:var(--shoppro-button-text)!important;border-color:transparent!important}

/* Account/cart circular icon parity and accessible hover. */
html body .ecup-v5-header-wrap :where(.ecup-v5-account-icon,.ecup-v5-cart-icon,.multishop-header-account__icon,.multishop-header-cart__icon){
  background:var(--shoppro-header-control-bg)!important;
  color:var(--shoppro-header-control-text)!important;
  border-color:var(--shoppro-header-border)!important;
}
html body .ecup-v5-header-wrap :where(.ecup-v5-account,.ecup-v5-cart,.multishop-header-account-block>a,.multishop-header-cart-block>a):hover{
  background:var(--shoppro-hover-bg)!important;color:var(--shoppro-hover-text)!important;border-color:var(--shoppro-focus)!important
}
html body .ecup-v5-header-wrap :where(.ecup-v5-account,.ecup-v5-cart,.multishop-header-account-block>a,.multishop-header-cart-block>a):hover :where(.ecup-v5-account-icon,.ecup-v5-cart-icon,.multishop-header-account__icon,.multishop-header-cart__icon){
  background:var(--shoppro-hover-bg)!important;color:var(--shoppro-hover-text)!important;border-color:var(--shoppro-focus)!important
}
html body .ecup-v5-header-wrap .multishop-header-cart__count{background:var(--shoppro-accent-2)!important;color:var(--shoppro-on-accent)!important}

/* ---------- Navigation row ---------- */
html body .ecup-v5-header-wrap .ecup-v5-nav-row,
html body .ecup-v5-header-wrap .ecup-v5-nav-inner,
html body .ecup-v5-header-wrap .ecup-v5-main-nav{
  background:var(--shoppro-nav-bg)!important;color:var(--shoppro-nav-text)!important;border-color:var(--shoppro-header-border)!important
}
html body .ecup-v5-header-wrap .ecup-v5-main-nav :where(a,.wp-block-navigation-item__content){color:var(--shoppro-nav-text)!important}
html body .ecup-v5-header-wrap .ecup-v5-main-nav :where(a,.wp-block-navigation-item__content):hover,
html body .ecup-v5-header-wrap .ecup-v5-main-nav .current-menu-item>.wp-block-navigation-item__content{
  background:var(--shoppro-hover-bg)!important;color:var(--shoppro-hover-text)!important
}

/* Shop Categories / Mega Menu */
html body .shoppro-header-categories summary{
  background:var(--shoppro-button-bg)!important;color:var(--shoppro-button-text)!important;border-color:transparent!important
}
html body .shoppro-header-categories summary:hover{filter:brightness(.97)}
html body .shoppro-header-categories__panel,
html body .shoppro-header-categories__mega,
html body .shoppro-header-categories__detail{
  background:var(--shoppro-surface)!important;color:var(--shoppro-text)!important;border-color:var(--shoppro-border)!important
}
html body .shoppro-header-categories__rail{background:var(--shoppro-surface-2)!important;border-color:var(--shoppro-border)!important}
html body .shoppro-header-categories :where(a,button){color:var(--shoppro-text)}
html body .shoppro-header-categories__rail-link:is(:hover,:focus-visible,.is-active),
html body .shoppro-header-categories__rail-item.is-active .shoppro-header-categories__rail-link,
html body .shoppro-header-categories__card:hover{
  background:var(--shoppro-hover-bg)!important;color:var(--shoppro-hover-text)!important;border-color:var(--shoppro-focus)!important
}
html body .shoppro-header-categories__card{background:var(--shoppro-surface)!important;color:var(--shoppro-text)!important;border-color:var(--shoppro-border)!important}
html body .shoppro-header-categories__grandchildren a{color:var(--shoppro-muted)!important}
html body .shoppro-header-categories__grandchildren a:hover{color:var(--shoppro-hover-text)!important}

/* Legacy Gutenberg-navigation mega menu. */
html body .ecup-v5-header-wrap .multishop-mega-panel,
html body .ecup-v5-header-wrap .multishop-mega-panel .wp-block-navigation__submenu-container{
  background:var(--shoppro-surface)!important;color:var(--shoppro-text)!important;border-color:var(--shoppro-border)!important
}
html body .ecup-v5-header-wrap .multishop-mega-panel :where(.wp-block-navigation-item__content,.multishop-mega-branch-title){color:var(--shoppro-text)!important}
html body .ecup-v5-header-wrap .multishop-mega-panel>.wp-block-navigation-item:is(.is-mega-active,:hover)>.wp-block-navigation-item__content,
html body .ecup-v5-header-wrap .multishop-mega-panel .wp-block-navigation-item__content:hover{background:var(--shoppro-hover-bg)!important;color:var(--shoppro-hover-text)!important}

/* ---------- Storefront / WooCommerce ---------- */
html body.woocommerce :where(.site-main,.wp-site-blocks),html body.woocommerce-page :where(.site-main,.wp-site-blocks){color:var(--shoppro-text)}
html body :where(.wp-block-post-title,.wp-block-query-title,.woocommerce-products-header__title,.woocommerce div.product .product_title,.wp-block-woocommerce-product-title,.wc-block-components-product-name,.wc-block-grid__product-title):not(.has-text-color){color:var(--shoppro-text)!important}
html body :where(.woocommerce-product-details__short-description,.product_meta,.woocommerce-result-count,.wc-block-components-product-summary):not(.has-text-color){color:var(--shoppro-text)!important}
html body :where(.product_meta,.woocommerce-result-count,.wc-block-components-product-metadata,.wc-block-grid__product-price del){color:var(--shoppro-muted)!important}

html body :where(.woocommerce ul.products li.product,.wc-block-product,.wp-block-post.product,.wc-block-grid__product){color:var(--shoppro-text)}
html body :where(.woocommerce ul.products li.product,.wc-block-product,.wp-block-post.product) :where(.wp-block-group,.wc-block-components-product-image):not(.has-background){border-color:var(--shoppro-border)}

html body :where(.price,.wc-block-components-product-price):not(.has-text-color){color:var(--shoppro-price)!important}
html body.single-product :where(.price,.wp-block-woocommerce-product-price,.wc-block-components-product-price) ins{color:var(--shoppro-single-sale-price)!important}
html body.single-product :where(.price,.wp-block-woocommerce-product-price,.wc-block-components-product-price) del{color:var(--shoppro-single-regular-price)!important}

html body :where(.woocommerce button.button,.woocommerce a.button,.wc-block-components-button,.wp-element-button):not(.has-background){background:var(--shoppro-button-bg);color:var(--shoppro-button-text)}
html body :where(.woocommerce button.button,.woocommerce a.button,.wc-block-components-button,.wp-element-button):not(.has-background):hover{filter:brightness(.96)}
html body :where(input,select,textarea,.wc-block-components-text-input input,.wc-block-components-combobox .components-combobox-control__input):not([type=submit]):not([type=button]){
  background:var(--shoppro-surface)!important;color:var(--shoppro-text)!important;border-color:var(--shoppro-border)!important
}

/* Bundle block follows the active palette unless its block controls explicitly override. */
html body .wp-block-multishop-bundle{color:var(--shoppro-text)}
html body .wp-block-multishop-bundle .multishop-bundle__tier:not([style*="background"]){background:var(--shoppro-surface)!important;border-color:var(--shoppro-border)!important}

/* Footer and overlay panels. */
html body footer.wp-block-template-part :where(.wp-block-group):not(.has-background){border-color:var(--shoppro-border)}
html body .ecup-v5-mobile-panel,
html body .ecup-v5-mobile-panel-head,
html body .ecup-v5-mobile-menu{background:var(--shoppro-surface)!important;color:var(--shoppro-text)!important;border-color:var(--shoppro-border)!important}
html body .ecup-v5-mobile-panel :where(.ecup-v5-mobile-link,.ecup-v5-mobile-toggle-row){color:var(--shoppro-text)!important}
html body .ecup-v5-mobile-panel :where(.ecup-v5-mobile-link,.ecup-v5-mobile-toggle-row):hover{background:var(--shoppro-hover-bg)!important;color:var(--shoppro-hover-text)!important}

/* Core preset classes remain coherent with Shop Pro's active semantic system. */
html body .has-base-background-color{background-color:var(--shoppro-bg)!important}
html body .has-contrast-background-color{background-color:var(--shoppro-text)!important;color:var(--shoppro-bg)!important}
html body .has-base-color{color:var(--shoppro-bg)!important}
html body .has-contrast-color{color:var(--shoppro-text)!important}

@media (prefers-reduced-motion:reduce){
  html body *{scroll-behavior:auto}
}
