/* STORE APP Patch 440
   Final selector/variable recovery for updated V3 storefront.
   Fixes product images hidden by dark background shorthands, language selector state,
   and remaining light/white controls after the dark theme rebase. */

body.site-masterpalm{
  --mp440-bg:#050607;
  --mp440-panel:#0b1015;
  --mp440-panel2:#131b23;
  --mp440-panel3:#18222d;
  --mp440-line:rgba(255,255,255,.18);
  --mp440-line2:rgba(255,255,255,.30);
  --mp440-text:#f8fafc;
  --mp440-muted:#c9d2dc;
  --mp440-red:#d71920;
  --mp440-red-dark:#8f070c;
  --mp440-red-soft:#ff6168;
}

/* -------------------------------------------------------------------------
   A. Product and category image wells.
   The V3 templates use several different variables. Previous dark patches used
   background/background shorthands, which erased background-image after the image
   variables were assigned inline. This block restores every active selector and
   uses background-color separately so the image stays above the light canvas.
   ------------------------------------------------------------------------- */
body.site-masterpalm .mpb2b-product-media,
body.site-masterpalm .mpb2b-product-media.has-product-image,
body.site-masterpalm .mp-product-list-media,
body.site-masterpalm .mp-product-list-media.has-product-image,
body.site-masterpalm .mp-card-media,
body.site-masterpalm .mp-category-card .mp-card-media,
body.site-masterpalm .mpb2b-gallery-main,
body.site-masterpalm .mpb2b-thumb,
body.site-masterpalm .mpb2b-cart-img,
body.site-masterpalm .ses-list-card__media,
body.site-masterpalm .mp-rfq-item-media.has-image,
body.site-masterpalm .mpb2b-media-poster{
  display:block!important;
  opacity:1!important;
  visibility:visible!important;
  background-color:#f5f7fa!important;
  background-repeat:no-repeat!important;
  background-position:center center!important;
  background-size:contain!important;
  filter:none!important;
  mix-blend-mode:normal!important;
  isolation:isolate!important;
}
body.site-masterpalm .mpb2b-product-media,
body.site-masterpalm .mpb2b-product-media.has-product-image{
  background-image:var(--mp-product-img,var(--mp-product-card-bg,var(--mp-card-bg,none)))!important;
}
body.site-masterpalm .mp-product-list-media,
body.site-masterpalm .mp-product-list-media.has-product-image{
  background-image:var(--mp-product-card-bg,var(--mp-product-img,var(--mp-card-bg,none)))!important;
}
body.site-masterpalm .mp-card-media,
body.site-masterpalm .mp-category-card .mp-card-media{
  background-image:var(--mp-card-bg,var(--mp-product-card-bg,var(--mp-product-img,none)))!important;
}
body.site-masterpalm .mpb2b-gallery-main{
  background-image:var(--mp-product-img,none)!important;
  background-size:contain!important;
}
body.site-masterpalm .mpb2b-thumb{
  background-image:var(--mp-thumb-img,var(--mp-product-img,none))!important;
}
body.site-masterpalm .mpb2b-cart-img{
  background-image:var(--mp-product-img,none)!important;
}
body.site-masterpalm .ses-list-card__media{
  background-image:var(--mp-product-list-bg,var(--list-bg,var(--mp-product-card-bg,none)))!important;
}
body.site-masterpalm .mp-rfq-item-media.has-image{
  background-image:var(--mp-rfq-img,none)!important;
}
body.site-masterpalm .mpb2b-media-poster{
  background-image:var(--mp-media-poster,none)!important;
  background-size:cover!important;
}
body.site-masterpalm .mpb2b-product-media::before,
body.site-masterpalm .mpb2b-product-media::after,
body.site-masterpalm .mp-product-list-media::before,
body.site-masterpalm .mp-product-list-media::after,
body.site-masterpalm .mp-card-media::before,
body.site-masterpalm .mp-card-media::after,
body.site-masterpalm .mpb2b-gallery-main::before,
body.site-masterpalm .mpb2b-gallery-main::after,
body.site-masterpalm .mpb2b-thumb::before,
body.site-masterpalm .mpb2b-thumb::after,
body.site-masterpalm .ses-list-card__media::before,
body.site-masterpalm .ses-list-card__media::after{
  background:transparent!important;
  opacity:0!important;
  content:""!important;
  pointer-events:none!important;
}
body.site-masterpalm img{
  opacity:1!important;
  visibility:visible!important;
  filter:none!important;
}

/* -------------------------------------------------------------------------
   B. Language selector. Keep the panel hidden on load, compact the flags, and
   expose it only when the dedicated JS sets .is-open / data-mp-language-open.
   ------------------------------------------------------------------------- */
body.site-masterpalm .mpb2b-topbar-language{
  position:relative!important;
  z-index:2147482500!important;
  display:flex!important;
  align-items:center!important;
}
body.site-masterpalm .ses-language-compact,
body.site-masterpalm .mpb2b-lang-topbar,
body.site-masterpalm [data-ses-translate-trigger]{
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:6px!important;
  min-height:28px!important;
  width:auto!important;
  padding:3px 8px!important;
  border-radius:999px!important;
  border:1px solid rgba(255,255,255,.22)!important;
  background:rgba(255,255,255,.08)!important;
  color:#f8fafc!important;
  font-size:12px!important;
  line-height:1!important;
  box-shadow:none!important;
}
body.site-masterpalm #sesTranslatePanel,
body.site-masterpalm .ses-translate-panel{
  display:none!important;
  position:absolute!important;
  top:calc(100% + 8px)!important;
  right:0!important;
  left:auto!important;
  width:280px!important;
  max-width:calc(100vw - 24px)!important;
  max-height:min(70vh,520px)!important;
  overflow:auto!important;
  margin:0!important;
  padding:8px!important;
  list-style:none!important;
  background:linear-gradient(180deg,#121922,#070b10)!important;
  border:1px solid rgba(255,255,255,.20)!important;
  border-radius:14px!important;
  box-shadow:0 22px 60px rgba(0,0,0,.60)!important;
  z-index:2147482600!important;
}
body.site-masterpalm #sesTranslatePanel.is-open,
body.site-masterpalm #sesTranslatePanel[data-mp-language-open="1"],
body.site-masterpalm .ses-translate-panel.is-open,
body.site-masterpalm .ses-translate-panel[data-mp-language-open="1"]{
  display:block!important;
}
body.site-masterpalm #sesTranslatePanel[aria-hidden="true"]:not([data-mp-language-open="1"]),
body.site-masterpalm .ses-translate-panel[aria-hidden="true"]:not([data-mp-language-open="1"]){
  display:none!important;
}
body.site-masterpalm #sesTranslatePanel .ses-language-menu,
body.site-masterpalm .ses-translate-panel .ses-language-menu{
  display:flex!important;
  flex-direction:column!important;
  gap:4px!important;
  margin:0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
body.site-masterpalm #sesTranslatePanel .ses-language-option,
body.site-masterpalm .ses-translate-panel .ses-language-option{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  min-height:34px!important;
  width:100%!important;
  padding:7px 9px!important;
  color:#f8fafc!important;
  background:transparent!important;
  border:1px solid transparent!important;
  border-radius:10px!important;
  font-size:13px!important;
  font-weight:750!important;
  line-height:1.2!important;
  text-decoration:none!important;
  white-space:nowrap!important;
}
body.site-masterpalm #sesTranslatePanel .ses-language-option:hover,
body.site-masterpalm #sesTranslatePanel .ses-language-option.is-active,
body.site-masterpalm #sesTranslatePanel .ses-language-option[aria-checked="true"],
body.site-masterpalm .ses-translate-panel .ses-language-option:hover,
body.site-masterpalm .ses-translate-panel .ses-language-option.is-active,
body.site-masterpalm .ses-translate-panel .ses-language-option[aria-checked="true"]{
  color:#fff!important;
  background:linear-gradient(90deg,rgba(215,25,32,.30),rgba(255,255,255,.06))!important;
  border-color:rgba(215,25,32,.45)!important;
}
body.site-masterpalm .ses-language-flag-img,
body.site-masterpalm .ses-language-current-flag-img,
body.site-masterpalm [data-ses-selected-language-flag-img],
body.site-masterpalm #sesTranslatePanel img,
body.site-masterpalm .ses-translate-panel img{
  display:inline-block!important;
  width:16px!important;
  height:16px!important;
  min-width:16px!important;
  max-width:16px!important;
  min-height:16px!important;
  max-height:16px!important;
  flex:0 0 16px!important;
  object-fit:cover!important;
  border-radius:999px!important;
  background:#fff!important;
  box-shadow:0 0 0 1px rgba(255,255,255,.25)!important;
  margin:0!important;
  padding:0!important;
}
body.site-masterpalm #sesTranslatePanel .ses-language-option img,
body.site-masterpalm .ses-translate-panel .ses-language-option img{
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  max-width:18px!important;
  min-height:18px!important;
  max-height:18px!important;
  flex-basis:18px!important;
}
body.site-masterpalm [data-ses-selected-language-label]{
  display:inline!important;
  color:inherit!important;
  font-size:inherit!important;
}

/* -------------------------------------------------------------------------
   C. Remaining controls: eliminate white buttons/white-on-white states while
   preserving light image and payment-logo surfaces.
   ------------------------------------------------------------------------- */
body.site-masterpalm .btn:not(.btn-close),
body.site-masterpalm button:not(.btn-close):not(.mpb2b-submenu-toggle):not(.mp-category-nav-toggle):not([data-ses-translate-trigger]),
body.site-masterpalm .mp-product-list-actions>a,
body.site-masterpalm .mp-product-list-actions form>button,
body.site-masterpalm .mpb2b-card-actions>a,
body.site-masterpalm .mpb2b-card-actions form>button,
body.site-masterpalm .mp-cart-square-button,
body.site-masterpalm .mp-quote-square-button,
body.site-masterpalm .mp-rfq-square-button,
body.site-masterpalm .mp-inline-search button,
body.site-masterpalm .mp-cta-actions a,
body.site-masterpalm .mp-sidebar-quote a,
body.site-masterpalm .mpb2b-btn,
body.site-masterpalm .mpb2b-btn-outline{
  color:#fff!important;
  background:linear-gradient(180deg,var(--mp440-red),var(--mp440-red-dark))!important;
  border-color:rgba(255,255,255,.24)!important;
  text-shadow:none!important;
  box-shadow:0 10px 24px rgba(0,0,0,.34)!important;
}
body.site-masterpalm .mp-product-list-actions>a:first-child,
body.site-masterpalm .mpb2b-card-actions>a:first-child,
body.site-masterpalm .mpb2b-btn-outline,
body.site-masterpalm .btn-outline-light,
body.site-masterpalm .btn-outline-secondary{
  color:#f8fafc!important;
  background:linear-gradient(180deg,#202a33,#0f151c)!important;
  border-color:rgba(255,255,255,.24)!important;
}
body.site-masterpalm .mp-rfq-square-button,
body.site-masterpalm .mp-quote-square-button{
  color:#ffdce0!important;
  background:linear-gradient(180deg,#421217,#17090c)!important;
  border-color:rgba(215,25,32,.65)!important;
}
body.site-masterpalm .mp-product-list-price.is-quote strong,
body.site-masterpalm .mp-product-list-price strong,
body.site-masterpalm .mpb2b-price,
body.site-masterpalm .mpb2b-current-price{
  color:#ff6269!important;
}
body.site-masterpalm .mp-product-list-body,
body.site-masterpalm .mp-product-list-body h3,
body.site-masterpalm .mp-product-list-body h3 a,
body.site-masterpalm .mpb2b-product-body,
body.site-masterpalm .mpb2b-product-body strong,
body.site-masterpalm .mp-category-copy,
body.site-masterpalm .mp-category-copy h2,
body.site-masterpalm .mp-category-copy h3,
body.site-masterpalm .mp-category-main,
body.site-masterpalm .mp-product-results-head,
body.site-masterpalm .mp-product-results-head h2,
body.site-masterpalm .mp-category-sidebar,
body.site-masterpalm .mp-category-sidebar h2,
body.site-masterpalm .mp-sidebar-quote,
body.site-masterpalm .mp-sidebar-quote strong{
  color:var(--mp440-text)!important;
}
body.site-masterpalm .mp-product-list-body p,
body.site-masterpalm .mpb2b-product-body em,
body.site-masterpalm .mpb2b-spec-mini,
body.site-masterpalm .mp-category-copy p,
body.site-masterpalm .mp-category-copy li,
body.site-masterpalm .mp-product-results-head span,
body.site-masterpalm .mp-sidebar-quote span{
  color:var(--mp440-muted)!important;
}

/* -------------------------------------------------------------------------
   D. Shop/category menu positioning. The root submenu must be anchored to the
   Shop by Category wrapper, not the viewport/page left edge.
   ------------------------------------------------------------------------- */
body.site-masterpalm .mpb2b-nav,
body.site-masterpalm .mpb2b-nav .mpb2b-container,
body.site-masterpalm .mpb2b-nav-category-wrap,
body.site-masterpalm .mpb2b-nav-managed .has-submenu,
body.site-masterpalm .mpb2b-category-menu-item.has-submenu{
  overflow:visible!important;
}
body.site-masterpalm .mpb2b-nav-category-wrap{
  position:relative!important;
}
@media (min-width:992px){
  body.site-masterpalm .mpb2b-nav-category-wrap > .mpb2b-category-submenu,
  body.site-masterpalm .mpb2b-nav-category-wrap > .mpb2b-nav-submenu{
    position:absolute!important;
    top:100%!important;
    left:0!important;
    right:auto!important;
    transform:none!important;
    min-width:320px!important;
    max-width:min(440px,calc(100vw - 24px))!important;
    width:max-content!important;
    display:none!important;
  }
  body.site-masterpalm .mpb2b-nav-category-wrap:hover > .mpb2b-category-submenu,
  body.site-masterpalm .mpb2b-nav-category-wrap.is-open > .mpb2b-category-submenu,
  body.site-masterpalm .mpb2b-nav-category-wrap:hover > .mpb2b-nav-submenu,
  body.site-masterpalm .mpb2b-nav-category-wrap.is-open > .mpb2b-nav-submenu{
    display:block!important;
  }
  body.site-masterpalm .mpb2b-category-menu-item > .mpb2b-nav-submenu,
  body.site-masterpalm .mpb2b-nav-subitem.has-submenu > .mpb2b-nav-submenu{
    position:absolute!important;
    top:0!important;
    left:100%!important;
    right:auto!important;
    transform:none!important;
    min-width:300px!important;
    display:none!important;
  }
  body.site-masterpalm .mpb2b-category-menu-item:hover > .mpb2b-nav-submenu,
  body.site-masterpalm .mpb2b-category-menu-item.is-open > .mpb2b-nav-submenu,
  body.site-masterpalm .mpb2b-nav-subitem.has-submenu:hover > .mpb2b-nav-submenu,
  body.site-masterpalm .mpb2b-nav-subitem.has-submenu.is-open > .mpb2b-nav-submenu{
    display:block!important;
  }
}

@media (max-width:991.98px){
  body.site-masterpalm #sesTranslatePanel,
  body.site-masterpalm .ses-translate-panel{
    position:fixed!important;
    top:56px!important;
    left:12px!important;
    right:12px!important;
    width:auto!important;
    max-width:none!important;
  }
  body.site-masterpalm .mpb2b-nav-category-wrap > .mpb2b-nav-submenu,
  body.site-masterpalm .mpb2b-nav-managed .mpb2b-nav-submenu{
    position:static!important;
    display:none!important;
    width:100%!important;
    min-width:0!important;
    box-shadow:none!important;
  }
  body.site-masterpalm .mpb2b-nav-category-wrap.is-open > .mpb2b-nav-submenu,
  body.site-masterpalm .mpb2b-nav-managed .has-submenu.is-open > .mpb2b-nav-submenu{
    display:block!important;
  }
}
