/* Product photos: one carousel in the card, one modal viewer. */
.bp-product-gallery{min-width:0}
.product-media{min-width:0}
.bp-product-gallery .bp-gallery-stage{position:relative;min-height:0;height:clamp(380px,45vw,610px);overflow:hidden;border-radius:8px;background:var(--soft)}
.bp-gallery-stage::before,.bp-gallery-stage::after{display:none!important}
.bp-gallery-viewport{display:flex;width:100%;height:100%;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x pan-y pinch-zoom}
.bp-gallery-viewport::-webkit-scrollbar{display:none}
.bp-gallery-slide{display:block;position:relative;flex:0 0 100%;width:100%;height:100%;min-width:0;padding:0;border:0;background:transparent;scroll-snap-align:center;scroll-snap-stop:always;cursor:zoom-in;overflow:hidden}
.bp-gallery-slide>img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity .18s ease;user-select:none;pointer-events:none}
.bp-gallery-slide.is-ready>img{opacity:1}
.bp-gallery-loading{position:absolute;left:50%;top:50%;width:26px;height:26px;margin:-13px;border:2px solid var(--line);border-top-color:var(--primary);border-radius:50%;animation:bp-photo-spin .9s linear infinite}
.bp-gallery-error{display:none;position:absolute;inset:0;align-items:center;justify-content:center;flex-direction:column;gap:10px;padding:24px;color:var(--ink);font-size:14px;line-height:1.5}
.bp-gallery-error small{color:var(--muted);font-size:12px}
.bp-gallery-slide.is-failed .bp-gallery-error{display:flex}
.bp-gallery-slide.is-ready .bp-gallery-loading,.bp-gallery-slide.is-failed .bp-gallery-loading{display:none}
.bp-gallery-arrow,.bp-gallery-expand{position:absolute;z-index:4;display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:50%;box-shadow:0 3px 15px #00000012;cursor:pointer;transition:background .18s,transform .18s,opacity .18s}
.bp-gallery-arrow svg,.bp-gallery-expand svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.bp-gallery-arrow{top:50%;transform:translateY(-50%)}
.bp-gallery-prev{left:14px}
.bp-gallery-next{right:14px}
.bp-gallery-arrow:disabled{opacity:.35;cursor:default}
.bp-gallery-arrow:hover:not(:disabled),.bp-gallery-expand:hover{background:var(--soft)}
.bp-gallery-expand{right:14px;bottom:14px;border-radius:9px}
.bp-gallery-counter{position:absolute;z-index:4;left:14px;bottom:14px;display:flex;align-items:center;min-height:32px;padding:6px 12px;border-radius:7px;background:var(--paper);color:var(--ink);font-size:12px;font-weight:550;font-variant-numeric:tabular-nums;pointer-events:none}
.bp-gallery-thumbs{position:relative;display:flex;gap:9px;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;margin-top:10px;padding:3px 1px 6px;scrollbar-width:thin}
.bp-gallery-thumbs button{position:relative;flex:0 0 68px;width:68px;height:68px;padding:3px;border:2px solid transparent;border-radius:7px;background:var(--soft);cursor:pointer;opacity:.65;transition:border-color .18s,opacity .18s}
.bp-gallery-thumbs button[aria-current=true]{border-color:var(--primary);opacity:1}
.bp-gallery-thumbs button:hover{opacity:1}
.bp-gallery-thumbs img{display:block;width:100%;height:100%;object-fit:cover;border-radius:3px;pointer-events:none}
.bp-gallery-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.bp-gallery-slide:focus-visible{outline:3px solid var(--primary);outline-offset:-4px}
.bp-product-gallery button:focus-visible,.bp-lightbox-tools button:focus-visible,.bp-gallery-zoom:focus-visible{outline:2px solid var(--primary);outline-offset:-3px}
.bp-gallery-empty{display:flex;align-items:center;justify-content:center;min-height:270px;background:var(--soft);color:var(--muted);font-size:14px}
body.bp-gallery-open{overflow:hidden}
.bp-lightbox{width:min(1400px,calc(100vw - 64px));height:calc(100dvh - 64px);max-width:none;max-height:none;padding:0;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);box-shadow:0 25px 100px #0005;overflow:hidden}
.bp-lightbox[open]{display:flex;flex-direction:column}
.bp-lightbox::backdrop{background:rgb(6 16 25 / 78%);backdrop-filter:blur(4px)}
.bp-lightbox-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 20px;border-bottom:1px solid var(--line);flex-shrink:0}
.bp-lightbox-header h2{margin:0;font:550 15px/1.4 var(--sans);letter-spacing:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.bp-lightbox-tools{display:flex;gap:6px;flex-shrink:0}
.bp-lightbox-tools button{display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:8px;background:var(--chalk);color:var(--ink);font-size:27px;cursor:pointer}
.bp-lightbox-tools button:hover{background:var(--soft)}
.bp-lightbox-tools button[aria-pressed=true]{background:var(--primary);color:var(--on-primary)}
.bp-lightbox-body{display:flex;flex:1;min-height:0;padding:16px}
.bp-lightbox .bp-product-gallery{display:flex;flex-direction:column;width:100%;min-height:0}
.bp-lightbox .bp-product-gallery .bp-gallery-stage{flex:1;min-height:0;height:auto;background:var(--soft)}
.bp-lightbox .bp-gallery-thumbs{flex-shrink:0;align-self:center;width:max-content;max-width:100%;margin-top:10px}
.bp-gallery-zoom{position:absolute;z-index:3;inset:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y pinch-zoom;cursor:grab;background:var(--soft)}
.bp-gallery-zoom[hidden]{display:none}
.bp-gallery-zoom:active{cursor:grabbing}
.bp-gallery-zoom>img{position:static;display:block;width:200%;height:200%;max-width:none;object-fit:contain;user-select:none;pointer-events:none}
@keyframes bp-photo-spin{to{transform:rotate(360deg)}}
@media(max-width:980px){.bp-product-gallery .bp-gallery-stage{height:min(68vw,520px)}}
@media(max-width:650px){
  .bp-product-gallery .bp-gallery-stage{height:clamp(235px,72vw,320px)}
  .bp-gallery-prev{left:9px}.bp-gallery-next{right:9px}
  .bp-gallery-expand{right:9px;bottom:9px}
  .bp-gallery-counter{left:9px;bottom:9px;font-size:11px;min-height:30px;padding:5px 10px}
  .bp-gallery-thumbs{gap:7px;margin-top:8px}
  .bp-gallery-thumbs button{flex-basis:54px;width:54px;height:54px;padding:2px}
  .bp-lightbox{width:100%;height:100dvh;margin:0;border:0;border-radius:0}
  .bp-lightbox-header{gap:12px;padding:calc(10px + env(safe-area-inset-top)) 12px 10px}
  .bp-lightbox-header h2{font-size:12px;line-height:1.5}
  .bp-lightbox-body{padding:10px 10px calc(10px + env(safe-area-inset-bottom))}
  .bp-lightbox .bp-gallery-thumbs{padding-bottom:2px}
}
@media(prefers-reduced-motion:reduce){
  .bp-gallery-slide>img,.bp-gallery-arrow,.bp-gallery-expand,.bp-gallery-thumbs button{transition:none}
  .bp-gallery-loading{animation:none}
}
