/* Only the product-photo viewer. Existing gallery dimensions remain untouched. */
/* Keep the mat at the bottom of cropped product-module thumbnails. */
.hbj-product-page .hbj-gallery-thumb .hbj-gallery-thumb-img{object-position:center bottom!important}
.hbj-gallery-strip{position:relative;width:100%;max-width:680px}
.hbj-product-page .hbj-gallery-strip .hbj-gallery-thumbs.has-overflow{position:relative;grid-template-columns:none!important;grid-auto-flow:column;grid-auto-columns:calc((100% - 48px)/3);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain}
.hbj-gallery-thumbs.has-overflow::-webkit-scrollbar,.hbj-lb-thumbs.has-overflow::-webkit-scrollbar{display:none}
.hbj-gallery-thumbs.has-overflow .hbj-gallery-thumb{scroll-snap-align:start}
.hbj-strip-arrow{position:absolute;z-index:7;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;min-height:36px;min-width:36px;margin:0;padding:5px 10px;border:1px solid #ffffffd9;border-radius:24px;color:#253785;background:linear-gradient(135deg,#fffffff2,#eff4ffb8);box-shadow:0 3px 14px #09112b33;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);font:600 14px/1 system-ui;cursor:pointer;touch-action:manipulation}
.hbj-strip-arrow[hidden]{display:none!important}
.hbj-strip-back{left:4px}.hbj-strip-more{right:4px}
.hbj-strip-arrow:focus-visible{outline:3px solid #253785;outline-offset:2px}
.hbj-lb-strip{position:relative;max-width:100%;flex:none}
.hbj-product-lightbox .hbj-lb-thumbs.has-overflow{width:240px;max-width:100%;scrollbar-width:none}
.hbj-lb-strip .hbj-strip-back{left:-36px}.hbj-lb-strip .hbj-strip-more{right:-48px}
@media(max-width:720px){.hbj-product-page .hbj-gallery-strip .hbj-gallery-thumbs.has-overflow{grid-auto-columns:calc((100% - 24px)/3)}}
@media(max-width:1100px),(hover:none) and (pointer:coarse){.hbj-product-lightbox .hbj-lb-strip{display:none}}
@media(max-height:540px){.hbj-product-lightbox .hbj-lb-strip{display:none}}
.hbj-product-gallery .hbj-gallery-main-img{cursor:default}
.hbj-product-gallery .hbj-gallery-expand{position:absolute;right:14px;top:14px;z-index:6;display:flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;padding:0;margin:0;border:1px solid rgba(255,255,255,.85);border-radius:50%;color:#253785;background:linear-gradient(135deg,rgba(255,255,255,.85),rgba(240,244,252,.55));box-shadow:0 6px 20px rgba(15,23,42,.15),inset 0 1px 0 #fff;backdrop-filter:blur(16px) saturate(140%);-webkit-backdrop-filter:blur(16px) saturate(140%);cursor:pointer;touch-action:manipulation}
.hbj-product-gallery .hbj-gallery-expand:hover{background:rgba(255,255,255,.95);color:#253785}
.hbj-product-gallery .hbj-gallery-expand:focus-visible{outline:3px solid #253785;outline-offset:3px}
.hbj-product-gallery .hbj-gallery-expand svg{display:block;width:21px;height:21px;pointer-events:none}
dialog.hbj-product-lightbox{position:fixed;inset:0;box-sizing:border-box;width:100%;max-width:none;height:100%;height:100dvh;max-height:none;margin:0;padding:16px;padding:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));border:0;background:transparent;color:#253785;font:16px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;overflow:hidden;overscroll-behavior:contain}
dialog.hbj-product-lightbox:not([open]){display:none!important}
dialog.hbj-product-lightbox[open]{display:flex;flex-direction:column;gap:12px}
dialog.hbj-product-lightbox::backdrop{background:rgba(15,23,42,.78);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.hbj-product-lightbox *{box-sizing:border-box}
.hbj-product-lightbox .hbj-lb-header{display:flex;align-items:center;justify-content:space-between;gap:16px;width:min(960px,100%);margin:0 auto;flex:0 0 auto}
.hbj-product-lightbox .hbj-lb-heading,.hbj-product-lightbox .hbj-lb-button,.hbj-product-lightbox .hbj-lb-controls{background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(239,244,255,.72));border:1px solid rgba(255,255,255,.8);box-shadow:0 10px 28px rgba(9,17,43,.2),inset 0 1px 0 #fff,inset 0 -1px 0 rgba(37,55,133,.12);backdrop-filter:blur(18px) saturate(140%);-webkit-backdrop-filter:blur(18px) saturate(140%)}
.hbj-product-lightbox .hbj-lb-heading{border-radius:22px;padding:9px 20px;min-width:0;display:flex;align-items:baseline;gap:16px}
.hbj-product-lightbox .hbj-lb-title{font-size:17px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.hbj-product-lightbox .hbj-lb-count{font-size:12px;white-space:nowrap;color:#43516d}
.hbj-product-lightbox .hbj-lb-button{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:44px;width:44px;height:44px;border-radius:50%;padding:0;margin:0;color:#253785;font:400 28px/1 system-ui,sans-serif;text-decoration:none;cursor:pointer;touch-action:manipulation;transition:background .15s,box-shadow .15s}
.hbj-product-lightbox .hbj-lb-button:hover:not(:disabled){background:#fff;box-shadow:0 5px 20px rgba(9,17,43,.25),inset 0 0 0 1px #fff}
.hbj-product-lightbox button:focus-visible{outline:3px solid #84d7ff;outline-offset:3px}
.hbj-product-lightbox button:disabled{opacity:.4;cursor:default}
.hbj-product-lightbox .hbj-lb-view{position:relative;display:flex;flex:1 1 0;min-height:0;width:100%;padding:0 60px}
.hbj-product-lightbox .hbj-lb-stage{position:relative;flex:1 1 0;min-height:0;min-width:0;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;cursor:default}
.hbj-product-lightbox .hbj-lb-side{position:absolute;top:50%;z-index:2;transform:translateY(-50%)}
.hbj-product-lightbox .hbj-lb-prev{left:max(0px,calc(50% - var(--hbj-lb-photo-half,30%) - 56px))}
.hbj-product-lightbox .hbj-lb-next{right:max(0px,calc(50% - var(--hbj-lb-photo-half,30%) - 56px))}
.hbj-product-lightbox .hbj-lb-stage.is-zoomed{cursor:grab}
.hbj-product-lightbox .hbj-lb-stage.is-dragging{cursor:grabbing}
.hbj-product-lightbox .hbj-lb-image{position:absolute!important;left:50%!important;top:50%!important;display:block!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:5px!important;object-fit:contain!important;transform-origin:center;box-shadow:0 16px 55px rgba(0,0,0,.24);visibility:hidden;user-select:none;-webkit-user-drag:none}
.hbj-product-lightbox .hbj-lb-status{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;text-align:center;padding:24px;margin:0;font-size:15px;pointer-events:none}
.hbj-product-lightbox .hbj-lb-status:empty{display:none}
.hbj-product-lightbox .hbj-lb-footer{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:8px;width:100%;margin:0;padding:0}
.hbj-product-lightbox .hbj-lb-controls{display:flex;align-items:center;gap:6px;padding:5px 8px;border-radius:32px;max-width:100%}
.hbj-product-lightbox .hbj-lb-controls .hbj-lb-button{box-shadow:none;background:rgba(255,255,255,.18);border-color:transparent}
.hbj-product-lightbox .hbj-lb-reset{font-size:14px;font-weight:700;width:54px;border-radius:18px}
.hbj-product-lightbox .hbj-lb-hint{color:#e4e9f3;font-size:11px;text-align:center;margin:0;padding:0}
.hbj-product-lightbox .hbj-lb-thumbs{position:relative;display:flex;gap:8px;max-width:min(960px,100%);overflow-x:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ffffff70 transparent;padding:4px;margin:0}
.hbj-product-lightbox .hbj-lb-thumb{appearance:none;flex:0 0 52px;width:52px;height:62px;display:block;margin:0;padding:3px;border:1px solid #ffffff70;border-radius:10px;overflow:hidden;background:#ffffff25;cursor:pointer;opacity:.7;touch-action:manipulation}
.hbj-product-lightbox .hbj-lb-thumb[aria-pressed="true"]{opacity:1;background:#fff;border-color:#fff;box-shadow:0 0 0 2px #91c8f5}
.hbj-product-lightbox .hbj-lb-thumb img{display:block;width:100%;height:100%;object-fit:cover;border:0;border-radius:6px;margin:0;padding:0}
@media(max-width:1100px),(hover:none) and (pointer:coarse){
  .hbj-product-lightbox .hbj-lb-thumbs{display:none}
  .hbj-product-lightbox .hbj-lb-view{padding:0}
}
@media(max-width:640px){
  .hbj-product-gallery .hbj-gallery-expand{top:10px;right:10px}
  dialog.hbj-product-lightbox[open]{gap:10px}
  .hbj-product-lightbox .hbj-lb-heading{padding:8px 14px;gap:10px}
  .hbj-product-lightbox .hbj-lb-title{font-size:15px}
  .hbj-product-lightbox .hbj-lb-controls{gap:3px;padding:4px 6px}
  .hbj-product-lightbox .hbj-lb-hint{font-size:10px;max-width:320px}
  .hbj-product-lightbox .hbj-lb-thumb{flex-basis:44px;width:44px;height:52px}
}
@media(max-height:540px){
  .hbj-product-lightbox .hbj-lb-thumbs,.hbj-product-lightbox .hbj-lb-hint{display:none}
  dialog.hbj-product-lightbox[open]{gap:6px}
}
@media(prefers-reduced-motion:reduce){.hbj-product-lightbox *{transition:none!important;scroll-behavior:auto!important}}
@media(prefers-reduced-transparency:reduce){dialog.hbj-product-lightbox::backdrop{background:#172033}.hbj-product-lightbox .hbj-lb-heading,.hbj-product-lightbox .hbj-lb-controls,.hbj-product-lightbox .hbj-lb-close{background:#eef2fa}}

/* Desktop/laptop: anchor below the visible photo edges at its initial 1.5x size.
   The measured fit width is independent of zoom/pan; only a resized viewport or new photo recalculates it. */
@media(min-width:1101px) and (hover:hover) and (pointer:fine){
  .hbj-product-lightbox .hbj-lb-view{--hbj-lb-start-half:min(calc(var(--hbj-lb-photo-half,30%) * 1.5),calc(50% - 60px))}
  .hbj-product-lightbox .hbj-lb-side{top:calc(100% + 18px);transform:none}
  .hbj-product-lightbox .hbj-lb-prev{left:max(0px,min(calc(50% - 150px),calc(50% - var(--hbj-lb-start-half) + 44px)))}
  .hbj-product-lightbox .hbj-lb-next{right:max(0px,min(calc(50% - 150px),calc(50% - var(--hbj-lb-start-half) + 44px)))}
}
@media(min-width:1101px) and (max-height:540px) and (hover:hover) and (pointer:fine){
  .hbj-product-lightbox .hbj-lb-side{top:calc(100% + 12px)}
}

/* Touch layouts: the photograph owns the entire viewport, controls float over it. */
@media(max-width:1100px),(hover:none) and (pointer:coarse){
  dialog.hbj-product-lightbox[open]{padding:0;gap:0}
  .hbj-product-lightbox .hbj-lb-view{padding:0}
  .hbj-product-lightbox .hbj-lb-header{position:absolute;z-index:4;top:max(12px,env(safe-area-inset-top));left:0;width:100%;padding:0 max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));pointer-events:none}
  .hbj-product-lightbox .hbj-lb-close{pointer-events:auto}
  .hbj-product-lightbox .hbj-lb-footer{position:absolute;z-index:4;left:0;bottom:max(12px,env(safe-area-inset-bottom),calc(50% - var(--hbj-lb-photo-half-height,50vh) + 12px));pointer-events:none}
  .hbj-product-lightbox .hbj-lb-controls{pointer-events:auto}
  .hbj-product-lightbox .hbj-lb-hint,.hbj-product-lightbox .hbj-lb-thumbs{display:none}
  .hbj-product-lightbox .hbj-lb-image{border-radius:0!important}
  .hbj-product-lightbox .hbj-lb-prev{left:max(8px,env(safe-area-inset-left),calc(50% - var(--hbj-lb-photo-half,30%) - 56px))}
  .hbj-product-lightbox .hbj-lb-next{right:max(8px,env(safe-area-inset-right),calc(50% - var(--hbj-lb-photo-half,30%) - 56px))}
}
