/* v1.7.4 - hard safe-zone minicard layout
   Purpose: stop child elements from intercalating in live/editor.
   Canonical rule: each product/minicard has fixed non-overlapping zones.
   Image stays left/top, text stays right, prices stay bottom-right.
*/

html body .magazine-shell .editorial-grid.manual-canvas{
  position:relative!important;
}

html body .magazine-shell .product-card.is-child-layout,
html body .magazine-shell .product-card.is-safe-child-layout{
  position:relative!important;
  display:block!important;
  overflow:hidden!important;
  isolation:isolate!important;
  box-sizing:border-box!important;
  contain:layout paint style!important;
  min-width:0!important;
  min-height:0!important;
}

html body .magazine-shell .product-card.is-child-layout .product-copy,
html body .magazine-shell .product-card.is-child-layout .price-row,
html body .magazine-shell .product-card.is-safe-child-layout .product-copy,
html body .magazine-shell .product-card.is-safe-child-layout .price-row{
  display:contents!important;
  position:static!important;
  width:auto!important;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
  transform:none!important;
}

html body .magazine-shell .product-card.is-child-layout [data-nc-child],
html body .magazine-shell .product-card.is-safe-child-layout [data-nc-child]{
  position:absolute!important;
  box-sizing:border-box!important;
  display:block!important;
  margin:0!important;
  transform:none!important;
  max-width:none!important;
  max-height:none!important;
  min-width:0!important;
  min-height:0!important;
  overflow:hidden!important;
  line-height:1.08!important;
  color:var(--text-color,inherit)!important;
  background:var(--card-bg,transparent)!important;
  font-family:var(--font-family,inherit)!important;
  font-size:var(--font-size,inherit)!important;
  font-weight:var(--font-weight,inherit)!important;
  text-align:var(--text-align,left)!important;
  border-color:var(--border-color,transparent)!important;
  border-width:var(--border-width,0)!important;
  border-style:var(--border-style,solid)!important;
  border-radius:var(--radius,0)!important;
  padding:var(--pad,0)!important;
  opacity:var(--opacity,1)!important;
}

/* Canonical safe zones. These deliberately win over older saved broken geometry. */
html body .magazine-shell .product-card.is-safe-child-layout [data-nc-child="image"]{
  left:4%!important; top:8%!important; width:39%!important; height:62%!important; z-index:10!important;
  background:rgba(255,255,255,.16)!important;
  border:1px solid rgba(70,44,16,.22)!important;
}
html body .magazine-shell .product-card.is-safe-child-layout [data-nc-child="badge"]{
  left:49%!important; top:8%!important; width:22%!important; height:12%!important; z-index:30!important;
  background:var(--card-bg,#cf332a)!important;
  color:var(--text-color,#fff)!important;
  padding:var(--pad,3px 8px)!important;
  font-weight:900!important;
  text-transform:uppercase!important;
}
html body .magazine-shell .product-card.is-safe-child-layout [data-nc-child="discount"]{
  left:76%!important; top:7%!important; width:18%!important; height:14%!important; z-index:35!important;
  background:var(--card-bg,#f6d044)!important;
  color:var(--text-color,#9e2019)!important;
  border:var(--border-width,1px) var(--border-style,solid) var(--border-color,#9e2019)!important;
  font-family:Impact,'Arial Black','Arial Narrow',sans-serif!important;
  text-align:center!important;
}
html body .magazine-shell .product-card.is-safe-child-layout [data-nc-child="title"]{
  left:49%!important; top:23%!important; width:47%!important; height:19%!important; z-index:20!important;
  font-family:var(--font-family,Impact,'Arial Black','Arial Narrow',sans-serif)!important;
  text-transform:uppercase!important;
  font-weight:900!important;
}
html body .magazine-shell .product-card.is-safe-child-layout [data-nc-child="description"]{
  left:49%!important; top:44%!important; width:47%!important; height:21%!important; z-index:20!important;
}
html body .magazine-shell .product-card.is-safe-child-layout [data-nc-child="merchant"]{
  left:49%!important; top:66%!important; width:47%!important; height:10%!important; z-index:20!important;
}
html body .magazine-shell .product-card.is-safe-child-layout [data-nc-child="old_price"]{
  left:49%!important; top:78%!important; width:24%!important; height:8%!important; z-index:25!important;
  color:#8b201a!important;
  text-decoration:line-through!important;
  text-decoration-thickness:2px!important;
  font-weight:900!important;
}
html body .magazine-shell .product-card.is-safe-child-layout [data-nc-child="price"]{
  left:49%!important; top:86%!important; width:36%!important; height:13%!important; z-index:25!important;
  font-family:Impact,'Arial Black','Arial Narrow',sans-serif!important;
  font-size:var(--font-size,22px)!important;
  font-weight:900!important;
}

html body .magazine-shell .product-card.is-safe-child-layout [data-nc-child="image"] img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
}

/* Hide children marked deleted/hidden in both live and editor. */
html body .magazine-shell .product-card.is-child-layout [style*="display:none"],
html body .magazine-shell .product-card.is-child-layout [style*="display: none"],
html body .magazine-shell .product-card.is-safe-child-layout [style*="display:none"],
html body .magazine-shell .product-card.is-safe-child-layout [style*="display: none"]{
  display:none!important;
}

/* Editor guide overlay: image zone + text zone. */
body.nc-editor-page .visual-editor-root .product-card.is-editor-selected.is-safe-child-layout::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:9990;
  pointer-events:none;
  background:
    linear-gradient(90deg, transparent 0 46%, rgba(0,153,255,.28) 46% calc(46% + 1px), transparent calc(46% + 1px)),
    linear-gradient(0deg, transparent 0 20%, rgba(214,169,40,.22) 20% calc(20% + 1px), transparent calc(20% + 1px)),
    linear-gradient(0deg, transparent 0 76%, rgba(214,169,40,.22) 76% calc(76% + 1px), transparent calc(76% + 1px));
}
body.nc-editor-page .visual-editor-root .product-card.is-safe-child-layout::after{
  content:"safe zones";
  position:absolute;
  right:4px;
  bottom:4px;
  z-index:9991;
  pointer-events:none;
  background:rgba(10,8,4,.72);
  color:#f6d044;
  border:1px solid rgba(246,208,68,.45);
  border-radius:4px;
  padding:2px 5px;
  font:700 8px/1 Arial,sans-serif;
  text-transform:uppercase;
}
