/* HOTFIX16: product DETAIL photo popup only. Fit to selected photo instead of filling a white 1360px frame.
   Large viewport desktop: center tight photo and vertically auto-scrolling thumbnails.
   Existing mobile lightbox and quickview remain untouched. */
@media(min-width:1024px) and (min-height:520px){
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal{padding:12px!important;overflow:hidden!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal.show,
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal.in{display:flex!important;align-items:center!important;justify-content:center!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .modal-dialog{position:relative!important;flex:0 0 auto!important;display:block!important;width:max-content!important;max-width:calc(100vw - 32px)!important;height:auto!important;max-height:calc(100dvh - 24px)!important;margin:auto!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .modal-content{display:block!important;flex:none!important;width:max-content!important;height:auto!important;max-width:calc(100vw - 32px)!important;max-height:calc(100dvh - 24px)!important;border-radius:16px!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .modal-body{display:flex!important;flex-direction:row!important;align-items:stretch!important;justify-content:center!important;gap:12px!important;width:max-content!important;height:auto!important;max-width:100%!important;max-height:calc(100dvh - 24px)!important;min-height:0!important;padding:44px 13px 13px!important;margin:0!important;overflow:hidden!important;box-sizing:border-box!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .modal-body figure{display:flex!important;flex:0 0 auto!important;grid-column:auto!important;grid-row:auto!important;align-items:center!important;justify-content:center!important;min-width:0!important;min-height:0!important;width:var(--cn16-picture-w, min(70vw,740px))!important;height:var(--cn16-picture-h, min(75dvh,740px))!important;max-width:calc(100vw - 180px)!important;max-height:calc(100dvh - 90px)!important;margin:0!important;padding:0!important;overflow:hidden!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .js-modal-product-cover{display:block!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;margin:0!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal #thumbnails{display:flex!important;flex-direction:column!important;flex:0 0 95px!important;grid-column:auto!important;grid-row:auto!important;width:95px!important;max-width:95px!important;height:var(--cn16-picture-h,min(75dvh,740px))!important;max-height:calc(100dvh - 90px)!important;min-height:0!important;margin:0!important;padding:0!important;overflow:hidden!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .js-modal-mask{display:block!important;flex:1 1 auto!important;width:100%!important;height:100%!important;max-height:none!important;min-height:0!important;margin:0!important;padding:0!important;overflow-x:hidden!important;overflow-y:auto!important;scrollbar-width:thin!important;overscroll-behavior:contain!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .js-modal-product-images{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;flex-wrap:nowrap!important;gap:8px!important;width:100%!important;min-width:0!important;min-height:0!important;height:auto!important;max-height:none!important;padding:2px!important;margin:0!important;list-style:none!important;box-sizing:border-box!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .thumb-container{flex:0 0 83px!important;width:83px!important;max-width:83px!important;height:83px!important;max-height:83px!important;min-height:83px!important;margin:0!important;border:1px solid #e1e8f5!important;border-radius:10px!important;overflow:hidden!important;box-sizing:border-box!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .thumb-container .thumb{width:100%!important;height:100%!important;max-height:100%!important;object-fit:contain!important;cursor:pointer!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .thumb-container .thumb.cn16-active{outline:2px solid #376df2!important;outline-offset:-3px!important;border-radius:9px!important}
 body #product-modal.cn12-gallery-modal.cn16-gallery-modal .cn12-gallery-close{top:5px!important;right:6px!important;width:34px!important;height:34px!important}
}
@media(prefers-reduced-motion:reduce){body #product-modal.cn12-gallery-modal.cn16-gallery-modal .thumb{scroll-behavior:auto!important}}
