/* Native product gallery: keep source proportions inside the viewport. */
#product-modal{padding:0!important;overflow:hidden}
#product-modal .modal-dialog{width:calc(100% - 32px);max-width:min(1200px,calc(100vh + 80px));max-width:min(1200px,calc(100dvh + 80px));margin:16px auto}
#product-modal .modal-content{display:grid;grid-template-rows:64px minmax(0,1fr);height:calc(100vh - 32px);height:calc(100dvh - 32px);padding:0;background:#f7f6f2;border:1px solid #dedfd5;border-radius:8px;overflow:hidden;box-sizing:border-box}
#product-modal .dm-gallery-header{display:flex;align-items:center;gap:16px;padding:8px 14px 8px 20px;border-bottom:1px solid #dedfd5;min-width:0;color:#343830}
#product-modal #dm-gallery-title{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px;font-weight:600}
#product-modal .dm-gallery-close{flex:0 0 44px;width:44px;height:44px;background:#fff;border:1px solid #d9ddd2;border-radius:4px;color:#343830;font-size:30px;line-height:1;cursor:pointer}
#product-modal .modal-content .modal-body{display:grid;grid-template-columns:minmax(0,1fr) 96px;gap:16px;margin:0;padding:16px;min-width:0;min-height:0;overflow:hidden}
#product-modal .modal-body figure{margin:0;min-width:0;min-height:0;height:100%}
#product-modal .modal-body figure>picture{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-width:0;min-height:0}
#product-modal .modal-content .modal-body figure img{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;background:transparent;box-shadow:none}
#product-modal .modal-body #thumbnails{min-width:0;min-height:0;height:100%}
#product-modal .modal-content .modal-body .mask{margin:0!important;max-height:none;height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#product-modal .modal-content .modal-body .product-images{display:flex;flex-direction:column;gap:10px;position:static;margin:0!important;padding:0;transform:none!important;list-style:none}
#product-modal .modal-body .product-images>li.thumb-container{display:block;flex:0 0 auto;width:84px;margin:0;padding:0}
#product-modal .modal-content .modal-body .product-images img{display:block;width:84px;height:84px;max-width:100%;object-fit:contain;border:2px solid transparent;margin:0;background:#fff;box-sizing:border-box;border-radius:3px}
#product-modal .modal-content .modal-body .product-images img.selected,#product-modal .modal-content .modal-body .product-images img:hover{border:2px solid #5f6b50}
#product-modal .modal-content .modal-body .arrows{display:none}
#product .product-cover .dm-gallery-open{border:0;width:100%;height:100%;padding:0}
#product .product-cover .dm-gallery-open:focus-visible{opacity:1;outline:3px solid #5f6b50;outline-offset:-4px}
@media(max-width:767px){
 #product-modal .modal-dialog{width:calc(100% - 16px);margin:8px auto}
 #product-modal .modal-content{height:calc(100vh - 16px);height:calc(100dvh - 16px);grid-template-rows:60px minmax(0,1fr)}
 #product-modal .dm-gallery-header{padding:8px 10px;gap:8px}
 #product-modal #dm-gallery-title{font-size:14px}
 #product-modal .modal-content .modal-body{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 76px;gap:12px;padding:12px}
 #product-modal .modal-content .modal-body .product-images{flex-direction:row;width:max-content;gap:8px}
 #product-modal .modal-body .product-images>li.thumb-container{width:64px;flex-basis:64px}
 #product-modal .modal-content .modal-body .product-images img{width:64px;height:64px}
 #product .product-cover .dm-gallery-open{opacity:1;background:transparent;align-items:flex-end;justify-content:flex-end}
 #product .product-cover .dm-gallery-open .zoom-in{margin:10px;padding:8px;border-radius:4px;background:#fff;color:#5f6b50;font-size:24px;box-shadow:0 1px 5px #0002}
}
