/* v1.7.3 - Safe-zone mini-card render parity
   Goal: editor and live render the exact same stabilized child layout.
   If a minicard has edited child elements, every child is positioned inside a safe card grid.
*/

.magazine-shell .product-card.is-child-layout{
  position:relative!important;
  overflow:hidden!important;
  isolation:isolate!important;
  contain:layout paint style!important;
}

.magazine-shell .product-card.is-child-layout .product-copy,
.magazine-shell .product-card.is-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;
}

.magazine-shell .product-card.is-child-layout [data-nc-child].is-manual-child,
.magazine-shell .product-card.is-child-layout [data-nc-child][style*="--x"],
.magazine-shell .product-card.is-child-layout [data-nc-child][style*="--y"],
.magazine-shell .product-card.is-child-layout [data-nc-child][style*="--w"],
.magazine-shell .product-card.is-child-layout [data-nc-child][style*="--h"]{
  position:absolute!important;
  left:var(--x,0)!important;
  top:var(--y,0)!important;
  width:var(--w,auto)!important;
  height:var(--h,auto)!important;
  z-index:var(--z,10)!important;
  display:block!important;
  box-sizing:border-box!important;
  max-width:none!important;
  max-height:none!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  overflow:hidden!important;
  transform:none!important;
  color:var(--text-color,inherit)!important;
  background:var(--card-bg,transparent)!important;
  font-size:var(--font-size,inherit)!important;
  font-family:var(--font-family,inherit)!important;
  font-weight:var(--font-weight,inherit)!important;
  text-align:var(--text-align,inherit)!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;
  line-height:1.08!important;
}

.magazine-shell .product-card.is-child-layout [data-nc-child="image"]{
  background:rgba(255,255,255,.16)!important;
  border:1px solid rgba(70,44,16,.22)!important;
}
.magazine-shell .product-card.is-child-layout [data-nc-child="image"] img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
}

.magazine-shell .product-card.is-child-layout [data-nc-child="title"]{
  font-family:Impact,'Arial Black','Arial Narrow',sans-serif!important;
  text-transform:uppercase!important;
}
.magazine-shell .product-card.is-child-layout [data-nc-child="old_price"]{
  color:#8b201a!important;
  text-decoration:line-through!important;
  text-decoration-thickness:2px!important;
  font-weight:900!important;
}
.magazine-shell .product-card.is-child-layout [data-nc-child="price"]{
  font-family:Impact,'Arial Black','Arial Narrow',sans-serif!important;
  font-size:var(--font-size,22px)!important;
  font-weight:900!important;
}
.magazine-shell .product-card.is-child-layout [data-nc-child="badge"]{
  background:var(--card-bg,#cf332a)!important;
  color:var(--text-color,#fff)!important;
  padding:var(--pad,3px 8px)!important;
  font-weight:900!important;
}
.magazine-shell .product-card.is-child-layout [data-nc-child="discount"]{
  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;
  transform:none!important;
  font-family:Impact,'Arial Black','Arial Narrow',sans-serif!important;
}

/* Safe-zone feedback in editor. These lines are visible only while a card is selected.
   They show the image column and the text/price column so elements do not intercalate. */
body.nc-editor-page .visual-editor-root .product-card.is-editor-selected{
  outline:2px solid rgba(0,153,255,.9)!important;
  outline-offset:0!important;
}
body.nc-editor-page .visual-editor-root .product-card.is-editor-selected::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:9990;
  pointer-events:none;
  background:
    linear-gradient(90deg, transparent 0 46%, rgba(0,153,255,.22) 46% calc(46% + 1px), transparent calc(46% + 1px)),
    linear-gradient(0deg, transparent 0 20%, rgba(214,169,40,.18) 20% calc(20% + 1px), transparent calc(20% + 1px)),
    linear-gradient(0deg, transparent 0 76%, rgba(214,169,40,.18) 76% calc(76% + 1px), transparent calc(76% + 1px));
}
body.nc-editor-page .visual-editor-root .product-card.is-safe-normalized::after{
  content:"safe layout";
  position:absolute;
  right:4px;
  bottom:4px;
  z-index:9991;
  pointer-events:none;
  background:rgba(10,8,4,.76);
  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;
}
