.has-rendered-template{position:relative}.has-rendered-template>.parent-template-canvas,.has-rendered-template>.parent-template-slot,.has-rendered-template>.parent-template-fixed-art{visibility:hidden}.has-rendered-template>.parent-rendered-template{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;z-index:2;pointer-events:none;user-select:none;-webkit-user-drag:none}.pack-card-component-visual.has-rendered-template{min-height:80px}
.has-rendered-template>.pack-component-template{visibility:hidden}
.has-rendered-template[aria-busy=true]::after{content:"Préparation de l’aperçu…";position:absolute;inset:0;display:grid;place-items:center;padding:8px;background:#f3f0eb;color:#50483f;font-size:.85rem;text-align:center;z-index:3}
.template-side-picker{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.template-side-picker button{min-height:36px;padding:6px 12px;border:1px solid var(--line,#c8beb5);border-radius:8px;background:#fff;color:#302a24;font:inherit;font-size:.88rem;cursor:pointer}
.template-side-picker button[aria-pressed=true]{background:#302a24;color:#fff;border-color:#302a24}
.template-side-picker button:focus-visible{outline:3px solid #a4502d;outline-offset:2px}
#preview-overlay .preview-pack-component>.template-side-picker{grid-column:2;margin-top:0}
@media(min-width:700px){#preview-overlay .preview-pack-component>.template-side-picker{grid-column:auto}}
#preview-overlay .preview-dialog:not(.is-pack-preview) .parent-template-canvas-modal.has-rendered-template{position:absolute;inset:12px;width:calc(100% - 24px);height:calc(100% - 24px);max-width:none;max-height:none;aspect-ratio:auto;animation:none!important;transition:none!important;transform:none!important;background:none;box-shadow:none;border:0}

/* Keep the complete sheet visible, including its border and identification strip. */
.catalog-products .product-card-visual.has-rendered-template {
 background: #f0f3f1;
}
.catalog-products .product-card-visual > .parent-rendered-template {
 box-sizing: border-box;
 padding: 10px 10px 38px;
 object-fit: contain;
}
.catalog-products .product-card-visual:hover .product-card-image,
.catalog-products .product-card-visual:hover .parent-template-canvas {
 transform: none;
}
.catalog-products .product-card-visual > .product-card-image {
 box-sizing: border-box;
 padding: 10px 10px 38px;
 object-fit: contain;
}
.pack-card-component-visual > .parent-rendered-template { object-fit: contain; }
.catalog-products .product-preview-label { z-index: 3; }
.catalog-products .product-card-visual:has(.pack-card-preview:not(.pack-card-preview-configurable)) {
 background: #edf3f0;
}
.catalog-products .pack-card-preview:not(.pack-card-preview-configurable) {
 inset: 14px 12px 40px;
 display: grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 grid-auto-rows: minmax(0, 1fr);
 align-items: stretch;
 gap: 8px;
}
.catalog-products .pack-card-preview:has(> .pack-card-component:only-child) { grid-template-columns: minmax(0, 1fr); }
.catalog-products .pack-card-component:nth-child(n) {
 display: grid;
 grid-template-rows: minmax(0, 1fr) auto;
 gap: 4px;
 transform: none;
 min-height: 0;
}
.catalog-products .pack-card-component-visual,
.catalog-products .pack-card-component-visual.has-rendered-template {
 height: 100%;
 min-height: 0;
 aspect-ratio: auto;
 border: 0;
 border-radius: 4px;
 background: transparent;
 box-shadow: none;
}
.catalog-products .pack-card-component-name {
 display: block;
 color: #274d44;
 font-size: .65rem;
 line-height: 1.3;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

@media (max-width: 720px) {
 .catalog-products .product-card {
  display: flex;
  flex-direction: column;
 }
 .catalog-products .product-card-visual {
  height: clamp(220px, 65vw, 300px);
  min-height: 0;
  width: 100%;
 }
 .catalog-products .product-card-copy { padding: 16px; }
 .catalog-products .product-card-visual > .parent-rendered-template { padding: 12px 12px 38px; }
 .catalog-products .product-card-visual .pack-card-preview { max-width: 100%; }
}

@media (max-width: 640px) {
 .checkout-list > .checkout-item-pack { grid-template-columns: minmax(0, 1fr); }
 .checkout-list > .checkout-item-pack > .cart-item-visual {
  width: 100%;
  height: 112px;
  aspect-ratio: auto;
 }
 .checkout-item-pack > .cart-item-visual img { object-fit: contain; }
 .checkout-item-pack .cart-pack-components { grid-template-columns: minmax(0, 1fr); }
}

.cart-addon-visual { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.cart-addon-visual img { min-width: 0; min-height: 0; object-fit: contain; }
.cart-addon-pack-count { display: grid; place-items: center; gap: 3px; padding: 6px; color: #174c3a; text-align: center; }
.cart-addon-pack-count strong { font-size: 1.7rem; line-height: 1; }
.cart-addon-pack-count small { font-size: .7rem; line-height: 1.2; }

@media (min-width: 900px) {
 #preview-overlay .is-pack-preview .preview-pack-components:has(> .preview-pack-component:nth-child(4):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
 }
 #preview-overlay .is-pack-preview .preview-pack-components:has(> .preview-pack-component:nth-child(4):last-child) .preview-pack-component-visual {
  height: 126px;
 }
}
