/**
 * MerchFuse v1.15.14.3 — interaction containment firewall.
 *
 * Prevents hidden desktop mega-menu descendants and historical stretched-card
 * links from intercepting unrelated controls. Restores product-card wishlist
 * placement without changing the WooCommerce product-card markup.
 */

/* ========================================================================== 
   1. Desktop mega menus: a closed menu and every descendant are non-interactive
   ========================================================================== */
@media (min-width:1281px) {
  html.mf-js[data-mf-theme] body.mf-site .mf-header .mf-nav > li:not(.mf-menu-open) > .sub-menu,
  html.mf-js[data-mf-theme] body.mf-site .mf-header .mf-nav > li:not(.mf-menu-open) > .sub-menu *,
  html.mf-js[data-mf-theme] body.mf-site .mf-header .mf-nav > li:not(.mf-menu-open) > .sub-menu::before {
    pointer-events:none !important;
  }

  html.mf-js[data-mf-theme] body.mf-site .mf-header .mf-nav > li:not(.mf-menu-open) > .sub-menu,
  html.mf-js[data-mf-theme] body.mf-site .mf-header .mf-nav > li:not(.mf-menu-open) > .sub-menu * {
    visibility:hidden !important;
  }

  html.mf-js[data-mf-theme] body.mf-site .mf-header .mf-nav > li:not(.mf-menu-open) > .sub-menu {
    opacity:0 !important;
    transform:translate(-50%,10px) !important;
  }

  html.mf-js.mf-menu-interaction-ready[data-mf-theme] body.mf-site .mf-header .mf-nav > li.mf-menu-open > .sub-menu,
  html.mf-js.mf-menu-interaction-ready[data-mf-theme] body.mf-site .mf-header .mf-nav > li.mf-menu-open > .sub-menu * {
    visibility:visible !important;
  }

  html.mf-js.mf-menu-interaction-ready[data-mf-theme] body.mf-site .mf-header .mf-nav > li.mf-menu-open > .sub-menu,
  html.mf-js.mf-menu-interaction-ready[data-mf-theme] body.mf-site .mf-header .mf-nav > li.mf-menu-open > .sub-menu::before,
  html.mf-js.mf-menu-interaction-ready[data-mf-theme] body.mf-site .mf-header .mf-nav > li.mf-menu-open > .sub-menu :where(a,button,input,select,textarea,[tabindex]) {
    pointer-events:auto !important;
  }

  html.mf-js.mf-menu-interaction-ready[data-mf-theme] body.mf-site .mf-header .mf-nav > li.mf-menu-open > .sub-menu {
    opacity:1 !important;
    transform:translate(-50%,0) !important;
  }

  html[data-mf-theme] body.mf-site .mf-header .mf-nav > li > .sub-menu[inert],
  html[data-mf-theme] body.mf-site .mf-header .mf-nav > li > .sub-menu[inert] * {
    pointer-events:none !important;
    user-select:none !important;
  }
}

/* ========================================================================== 
   2. Product-card link containment and wishlist restoration
   ========================================================================== */
html[data-mf-theme] body.mf-site :where(
  .mf-product-grid > li.mf-product-card,
  ul.products > li.product.mf-product-card,
  .related.products li.product.mf-product-card,
  .upsells.products li.product.mf-product-card
) {
  position:relative !important;
  isolation:isolate !important;
  contain:none !important;
  overflow:hidden !important;
}

html[data-mf-theme] body.mf-site :where(
  .mf-product-card__link,
  a.woocommerce-LoopProduct-link,
  a.woocommerce-loop-product__link
) {
  position:relative !important;
  top:auto !important;
  right:auto !important;
  bottom:auto !important;
  left:auto !important;
  inset:auto !important;
  z-index:1 !important;
  width:100% !important;
  max-width:100% !important;
  height:auto !important;
  min-height:0 !important;
  display:flex !important;
  flex:1 1 auto !important;
  flex-direction:column !important;
  pointer-events:auto !important;
  text-decoration:none !important;
}

html[data-mf-theme] body.mf-site :where(
  .mf-product-card__link,
  a.woocommerce-LoopProduct-link,
  a.woocommerce-loop-product__link
)::before,
html[data-mf-theme] body.mf-site :where(
  .mf-product-card__link,
  a.woocommerce-LoopProduct-link,
  a.woocommerce-loop-product__link
)::after {
  content:none !important;
  display:none !important;
  pointer-events:none !important;
}

html[data-mf-theme] body.mf-site .mf-product-card__actions {
  position:absolute !important;
  inset:auto !important;
  top:clamp(10px,1vw,14px) !important;
  right:clamp(10px,1vw,14px) !important;
  bottom:auto !important;
  left:auto !important;
  z-index:8 !important;
  margin:0 !important;
  padding:0 !important;
  display:flex !important;
  flex-direction:column !important;
  gap:8px !important;
  opacity:1 !important;
  visibility:visible !important;
  transform:none !important;
  pointer-events:auto !important;
}

html[data-mf-theme] body.mf-site .mf-product-card__action {
  position:relative !important;
  top:auto !important;
  right:auto !important;
  bottom:auto !important;
  left:auto !important;
  inset:auto !important;
  z-index:1 !important;
  margin:0 !important;
  flex:0 0 auto !important;
  pointer-events:auto !important;
}

html[data-mf-theme] body.mf-site .mf-product-card__cta {
  position:relative !important;
  top:auto !important;
  right:auto !important;
  bottom:auto !important;
  left:auto !important;
  inset:auto !important;
  z-index:4 !important;
  width:auto !important;
  margin-top:var(--mf-space-3,12px) !important;
  pointer-events:auto !important;
}

html[data-mf-theme] body.mf-site .mf-product-card__body {
  position:relative !important;
  z-index:2 !important;
  min-width:0 !important;
}

html[data-mf-theme] body.mf-site .mf-product-card__title,
html[data-mf-theme] body.mf-site .mf-product-card__title a {
  text-decoration:none !important;
}

/* Explicitly protect genuine form controls and buttons from decorative layers. */
html[data-mf-theme] body.mf-site :where(
  form.cart,
  .variations_form,
  .mf-pdp-form,
  .mf-product__summary,
  .mf-shop-toolbar,
  .mf-shop-pagination,
  .woocommerce-cart-form,
  .woocommerce-checkout
) :where(button,input,select,textarea,label,a) {
  position:relative;
  z-index:2;
  pointer-events:auto;
}

@media (hover:hover) and (pointer:fine) {
  html[data-mf-theme] body.mf-site .mf-product-card__actions {
    opacity:0 !important;
    transform:translateY(-4px) !important;
    transition:opacity 160ms ease,transform 160ms ease !important;
  }

  html[data-mf-theme] body.mf-site .mf-product-card:is(:hover,:focus-within) .mf-product-card__actions {
    opacity:1 !important;
    transform:none !important;
  }
}

@media (prefers-reduced-motion:reduce) {
  html[data-mf-theme] body.mf-site .mf-product-card__actions {
    transition:none !important;
  }
}
