/**
 * FSPL theme - Product image gallery
 * Markup comes from Elementor (4 native Image widgets inside .fspl-gallery__stage); assets/js/gallery.js adds
 * thumbnails, arrows, counter, swipe, keyboard control and the zoom lightbox. Without JS the first image is shown.
 */
.fspl-gallery{position:relative;min-width:0}
.fspl-gallery__stage{position:relative;overflow:hidden;aspect-ratio:1/1;background:var(--fspl-slot);border:1px solid var(--fspl-line);touch-action:pan-y;cursor:zoom-in}
.fspl-gallery__slide.fspl-gallery__slide{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;margin:0;opacity:0;visibility:hidden;
  transition:opacity .5s var(--fspl-ease),visibility 0s .5s}
.fspl-gallery__slide.is-active{opacity:1;visibility:visible;transition:opacity .5s var(--fspl-ease),visibility 0s}
.fspl-gallery__slide .elementor-widget-container,.fspl-gallery__slide a{display:block;width:100%;height:100%}
.fspl-gallery__stage img{-webkit-user-drag:none;user-select:none}
.fspl-gallery__slide img{width:100%;height:100%;object-fit:cover}

.fspl-gallery__nav{position:absolute;top:50%;z-index:3;width:44px;height:44px;margin-top:-22px;padding:0;border:1px solid var(--fspl-line);border-radius:50%;
  background:rgba(252,252,252,.92);color:var(--fspl-navy);cursor:pointer;display:grid;place-items:center;
  transition:background-color .2s,color .2s,transform .2s,opacity .2s;box-shadow:0 4px 14px rgba(32,44,80,.12)}
.fspl-gallery__nav::before{content:"";width:10px;height:10px;border:solid currentColor;border-width:2px 2px 0 0}
.fspl-gallery__nav--prev{left:12px}.fspl-gallery__nav--prev::before{transform:translateX(2px) rotate(-135deg)}
.fspl-gallery__nav--next{right:12px}.fspl-gallery__nav--next::before{transform:translateX(-2px) rotate(45deg)}
.fspl-gallery__nav:hover{background:var(--fspl-navy);color:var(--fspl-white)}
.fspl-gallery__nav:active{transform:scale(.94)}
.fspl-gallery__count{position:absolute;right:12px;bottom:12px;z-index:3;padding:4px 9px;background:var(--fspl-navy-deep);color:var(--fspl-white);font:500 11px/1.3 var(--fspl-font-mono);letter-spacing:.08em}

.fspl-gallery__thumbs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:12px;padding:0;list-style:none}
.fspl-gallery__thumb{display:block;position:relative;aspect-ratio:1/1;padding:0;border:1px solid var(--fspl-line);background:var(--fspl-slot-light,var(--fspl-mist));cursor:pointer;overflow:hidden;opacity:.72;
  transition:opacity .25s,border-color .25s,box-shadow .25s}
.fspl-gallery__thumb img{display:block;width:100%;height:100%;object-fit:cover}
.fspl-gallery__thumb:hover{opacity:1}
.fspl-gallery__thumb.is-active{opacity:1;border-color:var(--fspl-navy);box-shadow:inset 0 0 0 1px var(--fspl-navy)}
@media(max-width:600px){.fspl-gallery__thumbs{gap:8px}.fspl-gallery__nav{width:40px;height:40px;margin-top:-20px}}

/* lightbox */
.fspl-lightbox{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(32,44,80,.92);
  opacity:0;visibility:hidden;transition:opacity .3s ease,visibility 0s .3s}
.fspl-lightbox.is-open{opacity:1;visibility:visible;transition:opacity .3s ease,visibility 0s}
.fspl-lightbox__img{max-width:min(92vw,1100px);max-height:86vh;width:auto;height:auto;object-fit:contain;background:var(--fspl-white);box-shadow:0 20px 60px rgba(0,0,0,.4)}
.fspl-lightbox__close{position:absolute;top:14px;right:16px;border:0;background:transparent;color:var(--fspl-white);font:600 15px var(--fspl-font-body);cursor:pointer;padding:10px}
.fspl-lightbox .fspl-gallery__nav--prev{left:18px}.fspl-lightbox .fspl-gallery__nav--next{right:18px}

/* Elementor editor: show all four images as a grid so each can be replaced */
.elementor-editor-active .fspl-gallery__stage{aspect-ratio:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;border:0;background:none;overflow:visible;cursor:default}
.elementor-editor-active .fspl-gallery__slide.fspl-gallery__slide{position:relative;opacity:1;visibility:visible;aspect-ratio:1/1}
@media(prefers-reduced-motion:reduce){.fspl-gallery__slide,.fspl-gallery__slide img,.fspl-lightbox{transition:none}}
