/* Native WC gallery only; keep the surrounding product layout untouched. */
.lb-store .lbs-gallery.images { position: relative; min-width: 0; width: 100%; float: none; margin: 0; opacity: 1 !important; transition: none !important; --lbs-visible-thumbs: 4; --lbs-rail-space: 0px; }
.lbs-gallery .woocommerce-product-gallery__wrapper { margin: 0; padding: 0; }
.lbs-gallery--ready > .woocommerce-product-gallery__wrapper { display: flow-root; min-width: 0; aspect-ratio: 1; border-radius: 32px; overflow: hidden; }
.lbs-gallery .woocommerce-product-gallery__image, .lbs-gallery .woocommerce-product-gallery__image--placeholder { position: relative; aspect-ratio: 1; overflow: hidden; border: 0; border-radius: 32px; background: #fff; }
.lb-store .lbs-gallery .woocommerce-product-gallery__image > a { display: block; width: 100%; height: 100%; }
.lb-store .lbs-gallery .woocommerce-product-gallery__image img:not(.zoomImg), .lb-store .lbs-gallery .woocommerce-product-gallery__image--placeholder img, .lb-store .lbs-gallery .woocommerce-product-gallery__image video { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.lbs-gallery--slider:not(.lbs-gallery--ready):not(.lbs-gallery--fallback) > .woocommerce-product-gallery__wrapper { aspect-ratio: 1; overflow: hidden; }
.lbs-gallery--slider:not(.lbs-gallery--ready):not(.lbs-gallery--fallback) > .woocommerce-product-gallery__wrapper > div:not(:first-child) { display: none; }
.lbs-gallery .flex-viewport { aspect-ratio: 1; height: auto !important; border-radius: 32px; min-width: 0; }
.lbs-gallery--ready .woocommerce-product-gallery__wrapper > div { border-radius: 0; }
.lbs-gallery--fallback .woocommerce-product-gallery__wrapper > div, .lbs-gallery--stacked .woocommerce-product-gallery__wrapper > div { margin-bottom: 16px; }
.lbs-gallery .lbs-gallery-rail { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; width: 100%; max-width: calc(var(--lbs-visible-thumbs) * 88px + (var(--lbs-visible-thumbs) - 1) * 12px + 104px); margin: 12px auto 0; }
.lbs-gallery .lbs-gallery-rail--overflow { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.lb-store .lbs-gallery .flex-control-thumbs { display: flex; gap: 12px; width: 100%; max-width: 100%; min-width: 0; margin: 0; padding: 4px; overflow: auto; overscroll-behavior: contain; scrollbar-width: none; list-style: none; scroll-snap-type: x proximity; }
.lbs-gallery .flex-control-thumbs::-webkit-scrollbar { display: none; }
.lb-store .lbs-gallery .flex-control-thumbs li { display: block; flex: 0 0 calc((100% - (var(--lbs-visible-thumbs) - 1) * 12px) / var(--lbs-visible-thumbs)); float: none; width: auto; margin: 0; padding: 0; scroll-snap-align: start; }
.lb-store .lbs-gallery .flex-control-thumbs img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; padding: 4px; border: 2px solid transparent; border-radius: 16px; background: var(--lb-design-mist, #f1f1f1); opacity: 1; cursor: pointer; }
.lb-store .lbs-gallery .flex-control-thumbs img.flex-active { border-color: var(--lb-design-brand, #ffa719); background: var(--lb-design-tint, #ffeccc); }
.lbs-gallery .flex-control-thumbs img:focus-visible { outline: 3px solid #995a00; outline-offset: -3px; }
.lb-store .lbs-gallery button.lbs-gallery-control[type="button"] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 94%); color: var(--lb-design-ink, #090909); font: 400 32px/1 Arial, sans-serif; text-transform: none; letter-spacing: 0; box-shadow: 0 2px 12px rgb(0 0 0 / 8%); cursor: pointer; transition: background .15s ease; }
.lb-store .lbs-gallery button.lbs-gallery-control[type="button"]:hover { background: var(--lb-design-tint, #ffeccc); }
.lb-store .lbs-gallery button.lbs-gallery-control[type="button"]:disabled { opacity: .4; cursor: default; }
.lbs-gallery .lbs-gallery-previous, .lbs-gallery .lbs-gallery-next { position: absolute; z-index: 3; top: calc((100vw - 40px) / 2 - 22px); top: calc((100cqw - var(--lbs-rail-space)) / 2 - 22px); }
.lbs-gallery { container-type: inline-size; }
.lbs-gallery .lbs-gallery-previous { left: calc(var(--lbs-rail-space) + 12px); }
.lbs-gallery .lbs-gallery-next { right: 12px; }
.lb-store .lbs-gallery button.lbs-gallery-rail-previous[type="button"], .lb-store .lbs-gallery button.lbs-gallery-rail-next[type="button"] { width: 44px; box-shadow: none; background: var(--lb-design-mist, #f1f1f1); }
.lbs-gallery .lbs-gallery-open { position: absolute; top: 12px; right: 12px; z-index: 3; }
.lbs-gallery .lbs-gallery-open::before { content: ''; width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 50%; transform: translate(-2px, -2px); }
.lbs-gallery .lbs-gallery-open::after { content: ''; position: absolute; width: 8px; height: 2px; background: currentColor; transform: translate(8px, 8px) rotate(45deg); }
.lbs-gallery .lbs-gallery-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin-top: 8px; }
.lb-store .lbs-gallery button.lbs-gallery-dot[type="button"] { width: 44px; height: 44px; border-radius: 12px; background: transparent; box-shadow: none; }
.lbs-gallery .lbs-gallery-dot::before { content: ''; display: block; width: 7px; height: 7px; border-radius: 50%; background: #a9a9a9; }
.lbs-gallery .lbs-gallery-dot[aria-pressed="true"]::before { background: var(--lb-design-brand, #ffa719); transform: scale(1.3); }
.lb-store .lbs-gallery button.lbs-gallery-play[type="button"] { width: auto; min-width: 80px; padding: 0 16px; margin: 8px auto 0; font: 600 14px/1.4 var(--lb-design-body, Barlow), sans-serif; border-radius: 99px; background: var(--lb-design-mist, #f1f1f1); box-shadow: none; }
.lbs-gallery--no-thumbnails .lbs-gallery-rail { display: none !important; }
.lbs-gallery [hidden] { display: none !important; }
.lbs-product-lightbox.pswp { z-index: 999999; }
.lbs-product-lightbox .pswp__bg { background: #090909; }
.lbs-product-lightbox .pswp__button:focus-visible { outline: 3px solid #ffa719; outline-offset: -3px; }
.lbs-product-lightbox .pswp__counter { font: 400 14px/44px var(--lb-design-body, Barlow), sans-serif; }
.lbs-gallery-lightbox-open { overflow: hidden !important; }
@media (min-width: 1024px) {
	.lbs-gallery--vertical.lbs-gallery--ready:not(.lbs-gallery--no-thumbnails) { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 0 16px; --lbs-rail-space: 88px; }
	.lbs-gallery--vertical.lbs-gallery--ready:not(.lbs-gallery--no-thumbnails) > .flex-viewport, .lbs-gallery--vertical.lbs-gallery--ready:not(.lbs-gallery--no-thumbnails) > .woocommerce-product-gallery__wrapper { grid-column: 2; grid-row: 1; min-width: 0; }
	.lbs-gallery--vertical.lbs-gallery--ready:not(.lbs-gallery--no-thumbnails) > .lbs-gallery-rail { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-self: start; width: 72px; margin: 0; }
	.lb-store .lbs-gallery--vertical .flex-control-thumbs { flex-direction: column; scroll-snap-type: y proximity; padding: 0; }
	.lb-store .lbs-gallery--vertical .flex-control-thumbs li { flex: 0 0 72px; width: 100%; }
	.lb-store .lbs-gallery--vertical .flex-control-thumbs img { height: 72px; }
	.lbs-gallery--vertical .lbs-gallery-rail-previous, .lbs-gallery--vertical .lbs-gallery-rail-next { transform: rotate(90deg); }
	.lbs-gallery--vertical .lbs-gallery-dots, .lbs-gallery--vertical .lbs-gallery-play { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
	.lbs-gallery *, .lbs-product-lightbox * { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}

/* WoodMart native 360 control beside the custom WooCommerce gallery. */
.lb-store .lbs-gallery-360-wrap { position: relative; min-width: 0; }
.lb-store .lbs-gallery-360-wrap > .product-360-button {
 position: absolute; z-index: 15; right: 14px; bottom: 110px; margin: 0;
}
.lb-store .lbs-gallery-360-wrap > .product-360-button a { pointer-events: auto; }
@media (max-width: 767px) {
 .lb-store .lbs-gallery-360-wrap > .product-360-button { right: 12px; bottom: 96px; }
}

/* Lucas Bites – 360 viewer as an integrated gallery thumbnail. */
.lb-store .lbs-gallery-360-wrap > .product-360-button { display: none !important; }
.lb-store .lbs-gallery-360-wrap .lbs-spin-stage { position: absolute; z-index: 12; inset: 0 0 auto 0; aspect-ratio: 1 / 1; background: #fff; border-radius: 16px; overflow: hidden; cursor: ew-resize; touch-action: pan-y; user-select: none; }
.lb-store .lbs-gallery-360-wrap .lbs-spin-stage[hidden] { display: none !important; }
.lb-store .lbs-spin-stage > img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.lb-store .lbs-spin-hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 9px 14px; border-radius: 99px; background: rgba(255,255,255,.94); color: #171717; font: 600 12px/1.2 Barlow,sans-serif; box-shadow: 0 2px 12px #0001; pointer-events: none; }
.lb-store .lbs-spin-thumb-item { position: relative; }
.lb-store .lbs-spin-thumb { position: relative; display: block; width: 100%; padding: 0; border: 2px solid transparent; border-radius: 16px; background: #f1f1f1; overflow: hidden; cursor: pointer; }
.lb-store .lbs-spin-thumb[aria-pressed="true"] { border-color: #ffa719; background: #ffeccc; }
.lb-store .lbs-spin-thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.lb-store .lbs-spin-thumb span { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); padding: 3px 7px; border-radius: 30px; background: #fff; color: #111; font: 700 12px/1.2 Barlow,sans-serif; box-shadow: 0 1px 5px #0002; }
.lb-store .lbs-spin-thumb:focus-visible, .lb-store .lbs-spin-stage:focus-visible { outline: 3px solid #ffa719; outline-offset: 2px; }
.lb-store .lbs-gallery.lbs-spin-active > .lbs-gallery-open, .lb-store .lbs-gallery.lbs-spin-active > .lbs-gallery-previous, .lb-store .lbs-gallery.lbs-spin-active > .lbs-gallery-next { visibility: hidden; }

/* V4: 360 availability badge, integrated arrows and thumb rail navigation. */
.lb-store .lbs-gallery-360-wrap .lbs-spin-product-badge {
 position:absolute; top:16px; left:16px; z-index:14; pointer-events:none;
 padding:9px 13px; border-radius:99px; background:#fff; color:#171717;
 border:1px solid rgba(0,0,0,.08); box-shadow:0 3px 14px rgba(0,0,0,.08);
 font:700 12px/1.2 Barlow,sans-serif; letter-spacing:.01em;
}
.lb-store .lbs-gallery.lbs-spin-active > .lbs-gallery-previous { visibility:visible; z-index:16; }
.lb-store .lbs-gallery.lbs-spin-active > .lbs-gallery-next { visibility:hidden; }
.lb-store .lbs-gallery .lbs-spin-thumb-item { scroll-snap-align:start; }
@media(max-width:767px){.lb-store .lbs-gallery-360-wrap .lbs-spin-product-badge{top:12px;left:12px;padding:7px 10px;font-size:11px}}

/* V5 – match the native photo thumbnail's square dimensions and active border. */
.lb-store .lbs-gallery .flex-control-thumbs li.lbs-spin-thumb-item { align-self: stretch; }
.lb-store .lbs-gallery .flex-control-thumbs .lbs-spin-thumb {
  display: block !important; box-sizing: border-box !important; width: 100% !important;
  height: auto !important; aspect-ratio: 1 / 1 !important; padding: 4px !important;
  border: 2px solid transparent !important; border-radius: 16px !important;
  background: var(--lb-design-mist, #f1f1f1) !important; box-shadow: none !important;
}
.lb-store .lbs-gallery .flex-control-thumbs .lbs-spin-thumb[aria-pressed="true"] {
  border-color: var(--lb-design-brand, #ffa719) !important;
  background: var(--lb-design-tint, #ffeccc) !important;
}
.lb-store .lbs-gallery .flex-control-thumbs .lbs-spin-thumb > img {
  width: 100% !important; height: 100% !important; aspect-ratio: auto !important;
  object-fit: contain !important; padding: 0 !important; border: 0 !important;
  border-radius: 10px !important;
}
.lb-store .lbs-gallery .flex-control-thumbs .lbs-spin-thumb > span {
  bottom: 5px !important; font-size: 10px !important; padding: 3px 6px !important;
}

/* V6: constrain 360 stage to the image viewport (never the slide rail). */
.lb-store .lbs-gallery .flex-viewport { position: relative !important; }
.lb-store .lbs-gallery .flex-viewport > .lbs-spin-stage {
  position: absolute !important; inset: 0 !important; width: 100% !important;
  height: 100% !important; aspect-ratio: auto !important; z-index: 12 !important;
  background: #fff !important; border-radius: 0 !important;
}
.lb-store .lbs-gallery .flex-viewport > .lbs-spin-stage[hidden] { display: none !important; }
.lb-store .lbs-gallery .flex-viewport > .lbs-spin-stage > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lb-store .lbs-gallery .flex-control-thumbs li.lbs-spin-thumb-item { min-width: 0; }
.lb-store .lbs-gallery .flex-control-thumbs li.lbs-spin-thumb-item > button { min-height: 0 !important; }

/* V7b: hide zoom controls only when the 360 viewer is active. */
.lb-store .lbs-gallery.lbs-spin-active .lbs-gallery-open,
.lb-store .lbs-gallery.lbs-spin-active .woocommerce-product-gallery__trigger,
.lb-store .lbs-gallery.lbs-spin-active .wd-show-product-gallery {
  display: none !important;
}

/* V11: viewer is a sibling of FlexSlider viewport, not its animated child. */
.lb-store .lbs-gallery { position: relative !important; }
.lb-store .lbs-gallery > .lbs-spin-stage {
  position: absolute !important; inset: auto !important; aspect-ratio: auto !important;
  z-index: 25 !important; margin: 0 !important; background: #fff !important;
  overflow: hidden !important; border-radius: 12px !important;
}
.lb-store .lbs-gallery > .lbs-spin-stage[hidden] { display: none !important; }
.lb-store .lbs-gallery > .lbs-spin-stage > img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* V12: overlay the stationary viewport, not the animated slide strip or rail. */
.lb-store .lbs-gallery .flex-viewport { position: relative !important; }
.lb-store .lbs-gallery .flex-viewport > .lbs-spin-stage {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  z-index: 25 !important;
  margin: 0 !important;
  background: #fff !important;
  border-radius: inherit !important;
  overflow: hidden !important;
}
.lb-store .lbs-gallery .flex-viewport > .lbs-spin-stage[hidden] { display: none !important; }
.lb-store .lbs-gallery.lbs-spin-active .flex-control-thumbs img.flex-active {
  border-color: transparent !important;
  background: var(--lb-design-mist, #f1f1f1) !important;
}

/* V13: keep back navigation and thumbnail rail interactive while 360 is active.
   The 360 stage stays confined to the viewport, not the entire gallery. */
.lb-store .lbs-gallery.lbs-spin-active > .lbs-gallery-previous {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 40 !important;
}
.lb-store .lbs-gallery.lbs-spin-active > .lbs-gallery-next {
  display: none !important;
}
.lb-store .lbs-gallery.lbs-spin-active > .lbs-gallery-rail {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative;
  z-index: 40 !important;
}
.lb-store .lbs-gallery.lbs-spin-active .flex-control-thumbs,
.lb-store .lbs-gallery.lbs-spin-active .flex-control-thumbs li,
.lb-store .lbs-gallery.lbs-spin-active .flex-control-thumbs img {
  pointer-events: auto !important;
}


/* V23.3 – 360 thumbnail uses the SAME image box as native gallery photos.
   The button is only an interaction wrapper: it has no visual border/padding.
   This rule must remain at the end of the gallery stylesheet. */
.lb-store .lbs-gallery .flex-control-thumbs li.lbs-spin-thumb-item > button.lbs-spin-thumb {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  line-height: normal !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}
.lb-store .lbs-gallery .flex-control-thumbs li.lbs-spin-thumb-item > button.lbs-spin-thumb > img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 4px !important;
  border: 2px solid transparent !important;
  border-radius: 16px !important;
  background: var(--lb-design-mist, #f1f1f1) !important;
  object-fit: contain !important;
  object-position: center !important;
  box-sizing: border-box !important;
  transform: none !important;
  opacity: 1 !important;
}
.lb-store .lbs-gallery .flex-control-thumbs li.lbs-spin-thumb-item > button.lbs-spin-thumb[aria-pressed="true"] > img {
  border-color: var(--lb-design-brand, #ffa719) !important;
  background: var(--lb-design-tint, #ffeccc) !important;
}
.lb-store .lbs-gallery .flex-control-thumbs li.lbs-spin-thumb-item > button.lbs-spin-thumb > span {
  position: absolute !important;
  left: 50% !important;
  bottom: 5px !important;
  transform: translateX(-50%) !important;
  z-index: 2 !important;
  pointer-events: none !important;
}
