/* Shared image viewer for medical product details and catalogue cards. */
.cpg-detail-zoom { position:absolute; z-index:8; top:14px; right:14px; display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border:1px solid #dce1e9; border-radius:50%; background:#fff; color:var(--cpg-brand); box-shadow:0 3px 12px #24324714; }
.cpg-detail-zoom:hover { background:#f5f7fa; }
.cpg-medical-gallery-ready .avada-product-gallery-lightbox-trigger,
.cpg-medical-gallery-ready .woocommerce-product-gallery__trigger { display:none!important; }
body.cpg-image-open { overflow:hidden; }
dialog.cpg-image-dialog { width:min(1200px,calc(100vw - 40px)); height:min(900px,calc(100vh - 40px)); height:min(900px,calc(100dvh - 40px)); max-width:none; max-height:none; margin:auto; padding:0; border:1px solid #dce1e9; border-radius:24px; background:#fff; color:#243247; overflow:hidden; box-shadow:0 24px 90px #17243438; }
.cpg-image-dialog[open] { display:flex; flex-direction:column; }
.cpg-image-dialog::backdrop { background:rgb(22 35 52 / 58%); backdrop-filter:blur(4px); }
.cpg-image-dialog *, .cpg-image-dialog *::before, .cpg-image-dialog *::after { box-sizing:border-box; }
.cpg-image-dialog [hidden] { display:none!important; }
.cpg-image-dialog header { display:flex; align-items:center; justify-content:space-between; gap:16px; flex:none; padding:18px 22px; border-bottom:1px solid #e4e8ee; }
.cpg-image-dialog h2 { font-size:19px!important; line-height:1.35!important; margin:0 0 3px!important; color:inherit; text-align:left!important; }
.cpg-image-counter { font-size:13px; color:#596579; }
.cpg-image-dialog button { display:inline-flex; align-items:center; justify-content:center; flex:none; width:44px; height:44px; border:0; border-radius:50%; padding:0; background:#f0f2f5; color:#3d4c62; cursor:pointer; font:inherit; }
.cpg-image-dialog button:focus-visible { outline:3px solid #326baf; outline-offset:2px; }
.cpg-image-dialog button svg { width:22px; height:22px; }
.cpg-image-stage { display:flex; align-items:center; gap:16px; min-height:0; flex:1 1 auto; padding:18px; }
.cpg-image-dialog .cpg-image-full { display:block; min-width:0; width:100%; height:100%; flex:1 1 auto; object-fit:contain; }
.cpg-image-dialog [data-image-step] { font-size:32px; line-height:1; }
.cpg-image-thumbnails { display:flex; flex:none; gap:10px; overflow-x:auto; padding:12px 22px 18px; border-top:1px solid #e4e8ee; }
.cpg-image-thumbnails button { width:66px; height:66px; padding:5px; border-radius:12px; border:1px solid #dce1e9; background:#fff; }
.cpg-image-thumbnails button[aria-pressed="true"] { border:2px solid #3d4c62; }
.cpg-image-thumbnails img { width:100%; height:100%; object-fit:contain; }
@media(max-width:700px) {
 dialog.cpg-image-dialog { width:calc(100vw - 16px); height:calc(100vh - 24px); height:calc(100dvh - 24px); border-radius:18px; }
 .cpg-image-dialog header { padding:14px; }
 .cpg-image-dialog h2 { font-size:16px!important; }
 .cpg-image-stage { position:relative; padding:12px 8px 60px; }
 .cpg-image-dialog [data-image-step] { position:absolute; bottom:8px; left:calc(50% - 50px); }
 .cpg-image-dialog [data-image-step="1"] { left:auto; right:calc(50% - 50px); }
 .cpg-image-thumbnails { padding:10px 14px max(14px,env(safe-area-inset-bottom)); }
}

/* The separate control sits over the image; image/title links still open details. */
.cpg-app .cpg-card-zoom { position:absolute; z-index:3; top:10px; left:calc(var(--cpg-content-left) - 56px); display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border:1px solid #dce1e9; border-radius:50%; background:#fff; color:#3d4c62; box-shadow:0 3px 12px #24324714; }
.cpg-app .cpg-card-zoom:hover { background:#f5f7fa; }
.cpg-app .cpg-card-zoom:focus-visible, .cpg-detail-zoom:focus-visible { outline:3px solid #326baf; outline-offset:2px; }
.cpg-app .cpg-card-zoom svg { width:20px; height:20px; }
.cpg-app .cpg-offer-card .cpg-card-zoom, .cpg-app .cpg-personal-card .cpg-card-zoom { left:auto; right:10px; }
