/* FG — GLB Core Overrides (v1.0.0)
 * Canonical GLightbox styling for captions + share pill.
 */

/* Dark overlay everywhere */
.glightbox-container .goverlay{ background:#333333 !important; }

/* Caption panel below image */
.glightbox-container .gslide-description{
  background:#333333 !important;
  color:#ffffff !important;
  padding:14px 16px !important;
}

/* Title + description typography */
.glightbox-container .gslide-title{
  color:#ffffff !important;
  font-weight:600 !important;
  margin:0 0 8px 0 !important;
}
.glightbox-container .gslide-desc{
  color:#ffffff !important;
  margin:0 !important;
  opacity:1 !important;
}

/* Make long captions scrollable */
.glightbox-container .gdesc-inner{
  max-height: 28vh;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
}

/* Keep captions visible; avoid accidental permanent hide states */
.glightbox-container .gslide-description{ display:block !important; }
.glightbox-container .gslide-description.hidden{ display:block !important; }

/* Share pill (match existing) */
.fg-glb-share{
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 2147483647;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 9999px;
  background: transparent;
  color: rgba(255,255,255,.98);
  font: 600 16px/1 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.fg-glb-share:hover{ background: rgba(255,255,255,.08); }
.fg-glb-share:active{ transform: translateY(1px); }

/* Visit Store pill (same style) */
.fg-glb-visit{
  position: fixed;
  top: 14px;
  left: 104px;
  z-index: 2147483647;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 9999px;
  background: transparent;
  color: rgba(255,255,255,.98);
  font: 600 16px/1 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.fg-glb-visit:hover{ background: rgba(255,255,255,.08); }
.fg-glb-visit:active{ transform: translateY(1px); }

/* Small toast */
.fg-glb-toast{
  position: fixed;
  top: 60px;
  left: 14px;
  z-index: 2147483647;
  padding: 8px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.95);
  font: 600 14px/1 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* Product page magnifier overlay (visual parity with prior system)
   IMPORTANT: only apply to the MAIN image, not the thumbnails. */
.single-product .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:first-child{ position:relative; }
.single-product .woocommerce-product-gallery__trigger{ display:none !important; }
.single-product .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:first-child::after{
  content:"";
  position:absolute;
  right:12px;
  bottom:12px;
  width:26px;
  height:26px;
  background-color:rgba(0,0,0,.55);
  border-radius:9999px;
  border:1px solid rgba(255,255,255,.30);
  background-repeat:no-repeat;
  background-position:center;
  background-size:16px 16px;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.35));
  opacity:.9;
  pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.65' y1='16.65' x2='21' y2='21'/%3E%3C/svg%3E");
}
@media (hover:hover){
  .single-product .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:first-child:hover::after{opacity:1}
}

/* Caption visibility toggle */
.glightbox-container.fg-glb-captions-hidden .gdesc,
.glightbox-container.fg-glb-captions-hidden .gslide-description{
  display: none !important;
}

/* “Click image to toggle captions” hint */
.glightbox-container .fg-glb-hint{
  position: fixed;
  top: 56px;
  left: 14px;
  z-index: 2147483647;
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.95);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 9999px;
  padding: 6px 12px;
  font: 600 12px/1 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  pointer-events: none;
}


/* === v1.0.2 fixes =========================================
 * 1) Hide floating UI unless GLightbox is open
 * 2) Caption toggle: when .glightbox-container has .fg-glb-captions-off, hide captions
 * ========================================================= */
body:not(.glightbox-open) .fg-glb-ui,
body:not(.glightbox-open) .fg-glb-share,
body:not(.glightbox-open) .fg-glb-visit,
body:not(.glightbox-open) .fg-glb-caption-hint{
  display:none !important;
}

.glightbox-container.fg-glb-captions-off .gslide-description,
.glightbox-container.fg-glb-captions-off .gdesc-inner,
.glightbox-container.fg-glb-captions-off .gdesc{
  display:none !important;
}


/* === FG GLB Top Bar (v1.0.3) ========================================= */
.fg-glb-bar{
  position:fixed;
  top:14px;
  left:14px;
  z-index:2147483646;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  pointer-events:none;
}
.fg-glb-bar > *{ pointer-events:auto; }

.fg-glb-share,
.fg-glb-visit,
.fg-glb-caphint{
  position:relative !important;
  top:auto !important;
  left:auto !important;
  right:auto !important;
  bottom:auto !important;
}

@media (max-width: 520px){
  .fg-glb-bar{ flex-direction:column; align-items:flex-start; }
}