/* v1.7.0 - shared live/editor render parity for manually edited mini-cards.
   Purpose: every position/size/style saved from the visual editor must render identically in live.
   This file is intentionally NOT editor-scoped. It is the final render layer for both contexts. */

/* Manual page canvas: once a page is saved as manual, product cards must not be laid out by CSS Grid. */
.editorial-grid.manual-canvas {
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
}

/* Mini-card position saved by editor. */
.editorial-grid.manual-canvas > .product-card.is-manual-card,
.editorial-grid.manual-canvas > .product-card[style*="--x"],
.editorial-grid.manual-canvas > .product-card[style*="--y"] {
  position: absolute !important;
  left: var(--x, 0) !important;
  top: var(--y, 0) !important;
  width: var(--w, 240px) !important;
  height: var(--h, 180px) !important;
  z-index: var(--z, 1) !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 60px !important;
  min-height: 46px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* When the editor has locked child elements, wrappers must stop participating in layout.
   They become transparent structure only, in both live and editor. */
.product-card.is-child-layout {
  isolation: isolate !important;
  overflow: hidden !important;
  contain: layout paint style !important;
}
.product-card.is-child-layout .product-copy,
.product-card.is-child-layout .price-row {
  display: contents !important;
  position: static !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Leaf children saved by the editor. */
.product-card.is-child-layout [data-nc-child] {
  box-sizing: border-box !important;
  max-width: none !important;
  max-height: none !important;
}
.product-card.is-child-layout [data-nc-child][style*="--x"],
.product-card.is-child-layout [data-nc-child][style*="--y"],
.product-card.is-child-layout [data-nc-child][style*="--w"],
.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, 80px) !important;
  height: var(--h, 32px) !important;
  z-index: var(--z, 10) !important;
  display: block !important;
  margin: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !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.05 !important;
}
.product-card.is-child-layout [data-nc-child="image"][style*="--x"] img,
.product-card.is-child-layout [data-nc-child="image"][style*="--y"] img,
.product-card.is-child-layout [data-nc-child="image"][style*="--w"] img,
.product-card.is-child-layout [data-nc-child="image"][style*="--h"] img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
}
.product-card.is-child-layout [data-nc-child="discount"][style*="--x"],
.product-card.is-child-layout [data-nc-child="discount"][style*="--y"] {
  transform: rotate(6deg) !important;
}
.product-card.is-child-layout [data-nc-child="old_price"] {
  text-decoration: line-through !important;
  text-decoration-thickness: 3px !important;
}
.product-card.is-child-layout [style*="display:none"],
.product-card.is-child-layout [style*="display: none"] {
  display: none !important;
}

/* Live must not show editor-only controls even if the same markup exists accidentally. */
body:not(.nc-editor-fullscreen-page) .nc-select-card,
body:not(.nc-editor-fullscreen-page) .nc-resize-handle,
body:not(.nc-editor-fullscreen-page) .nc-selection-box,
body:not(.nc-editor-fullscreen-page) .nc-element-toolbar {
  display: none !important;
}
