:root {
  --red: #c4292f;
  --red-deep: #840717;
  --line: rgba(196, 41, 47, 0.95);
  --muted: #e9e9e9;
  --heart-bg: #fdebed;
  --jpg-thumb-size: 80px;
  --jpg-thumb-gap: 14px;
  --jpg-indicator-gap: 12px;
  --jpg-carousel-visible: 6;
}

.jpg-product-gallery * {
  box-sizing: border-box;
}

.jpg-product-gallery .jpg-card {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 44px;
  padding: 26px 26px 24px;
  position: relative;
}

.jpg-product-gallery .jpg-top-indicators {
  display: grid;
  grid-template-columns: repeat(var(--jpg-image-count, 1), minmax(0, 1fr));
  gap: 12px;
  padding: 0 4px;
  margin-bottom: 18px;
}

.jpg-product-gallery .jpg-indicator {
  all: unset;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  cursor: pointer;
}

.jpg-product-gallery .jpg-indicator.is-active {
  background: var(--red);
}

.jpg-product-gallery .jpg-indicator:focus-visible {
  outline: 2px solid rgba(196, 41, 47, 0.6);
  outline-offset: 4px;
  border-radius: 999px;
}

.jpg-product-gallery .jpg-hero {
  position: relative;
  border-radius: 26px;
  max-height: 350px;
  height: 350px;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.jpg-product-gallery .jpg-hero:active {
  cursor: grabbing;
}

.jpg-product-gallery .jpg-hero-image {
  width: 100%;
  height: 100%;
  max-height: 350px;
  object-fit: contain;
  object-position: 50% 50%;
  transform: scale(0.98);
  pointer-events: none;
}

.jpg-product-gallery .jpg-hero-video {
  width: 100%;
  height: 100%;
  max-height: 350px;
  object-fit: contain;
  background: #ffffff;
  pointer-events: auto;
}

.jpg-product-gallery .jpg-hero-image.is-hidden,
.jpg-product-gallery .jpg-hero-video.is-hidden,
.jpg-product-gallery .jpg-video-expand.is-hidden {
  display: none !important;
}

.jpg-product-gallery .jpg-video-expand {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.jpg-product-gallery .jpg-video-expand:hover {
  background: rgba(17, 17, 17, 0.9);
}

.jpg-product-gallery .jpg-video-expand__icon {
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 2px;
  box-sizing: border-box;
}

/* Fullscreen lightbox: transparent panel, white X only */
.jpg-video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
}

.jpg-video-lightbox.is-hidden {
  display: none !important;
}

.jpg-video-lightbox__close {
  all: unset;
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 2;
  width: 44px;
  height: 44px;
  background: transparent;
  color: #ffffff;
  font-size: 36px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-sizing: border-box;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.jpg-video-lightbox__close:hover {
  color: #ffffff;
  opacity: 0.85;
}

.jpg-video-lightbox__panel {
  width: min(1100px, 92vw);
  height: auto;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
  display: block;
  box-shadow: none;
}

.jpg-video-lightbox__video {
  width: 100%;
  height: auto;
  max-height: 82vh;
  object-fit: contain;
  background: transparent;
  display: block;
}

body.jpg-lightbox-open {
  overflow: hidden;
}

/* Elementor lightbox overrides (if used) */
.elementor-lightbox .dialog-widget-content,
.elementor-lightbox .elementor-lightbox-image,
.elementor-lightbox .elementor-lightbox-item {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

.elementor-lightbox .dialog-lightbox-close-button,
.elementor-lightbox .dialog-close-button {
  background: transparent !important;
  background-color: transparent !important;
  color: #ffffff !important;
  box-shadow: none !important;
  border: 0 !important;
}

.elementor-lightbox .dialog-lightbox-close-button:hover,
.elementor-lightbox .dialog-close-button:hover {
  color: #ffffff !important;
  opacity: 0.85;
}

.jpg-product-gallery .jpg-wish {
  position: absolute;
  top: 10px;
  right: 0;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  border: none;
  background: rgba(253, 235, 237, 0.9);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.jpg-product-gallery .jpg-wish:hover {
  background: rgba(253, 235, 237, 1);
}

.jpg-product-gallery .jpg-wish:active {
  transform: scale(0.98);
}

.jpg-product-gallery .jpg-wish:focus-visible {
  outline: 2px solid rgba(196, 41, 47, 0.55);
  outline-offset: 6px;
}

.jpg-product-gallery .jpg-wish svg {
  width: 28px;
  height: 28px;
  display: block;
  color: var(--red);
}

.jpg-product-gallery .jpg-wish svg path {
  fill: transparent !important;
  stroke: currentColor !important;
  stroke-width: 40px !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 0.12s ease, stroke 0.12s ease;
}

.jpg-product-gallery .jpg-wish:hover svg path,
.jpg-product-gallery .jpg-wish.is-active svg path {
  fill: currentColor !important;
  stroke: currentColor !important;
  stroke-width: 40px !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 0.12s ease, stroke 0.12s ease;
}

.jpg-product-gallery .jpg-thumbs.jpg-thumbs--grid {
  margin-top: 22px;
  padding: 0 42px 6px;
  display: grid;
  grid-template-columns: repeat(var(--jpg-image-count, 1), minmax(0, var(--jpg-thumb-size)));
  justify-content: center;
  gap: var(--jpg-thumb-gap);
}

.jpg-product-gallery--carousel {
  --jpg-carousel-visible: 6;
}

.jpg-product-gallery--carousel .jpg-thumbs-carousel {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 0 10px 6px;
}

.jpg-product-gallery--carousel .jpg-thumbs-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  width: 100%;
  min-width: 0;
  container-type: inline-size;
  container-name: jpg-thumbs;
}

.jpg-product-gallery--carousel .jpg-thumbs-viewport::-webkit-scrollbar {
  display: none;
}

.jpg-product-gallery--carousel .jpg-thumbs-viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.jpg-product-gallery--carousel .jpg-thumbs-track {
  display: flex;
  align-items: center;
  gap: var(--jpg-thumb-gap);
  width: max-content;
  min-width: 100%;
}

.jpg-product-gallery--carousel .jpg-thumbs-viewport .jpg-thumb-btn {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.jpg-product-gallery--carousel .jpg-thumbs-track .jpg-thumb {
  --jpg-thumb-fit: calc(
    (100cqw - (var(--jpg-carousel-visible) - 1) * var(--jpg-thumb-gap)) /
      var(--jpg-carousel-visible)
  );
  flex: 0 0 min(var(--jpg-thumb-size), var(--jpg-thumb-fit));
  width: min(var(--jpg-thumb-size), var(--jpg-thumb-fit));
  max-width: min(var(--jpg-thumb-size), var(--jpg-thumb-fit));
  aspect-ratio: 1 / 1;
  height: auto;
  scroll-snap-align: start;
}

.jpg-product-gallery .jpg-carousel-arrow {
  all: unset;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--red);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.jpg-product-gallery .jpg-carousel-arrow:hover {
  opacity: 0.75;
}

.jpg-product-gallery .jpg-carousel-arrow.is-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.jpg-product-gallery .jpg-carousel-arrow:focus-visible {
  outline: 2px solid rgba(196, 41, 47, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

.jpg-product-gallery--single .jpg-top-indicators,
.jpg-product-gallery--single .jpg-thumbs,
.jpg-product-gallery--single .jpg-thumbs--grid,
.jpg-product-gallery--single .jpg-thumbs-carousel {
  display: none;
}

.jpg-product-gallery .jpg-thumb {
  width: 100%;
  max-width: var(--jpg-thumb-size);
  max-height: var(--jpg-thumb-size);
  aspect-ratio: 1 / 1;
  height: auto;
  justify-self: center;
  border-radius: 14px;
  border: 2px solid rgba(107, 114, 128, 0.95);
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.jpg-product-gallery .jpg-thumb.is-active {
  border-color: var(--red);
}

.jpg-product-gallery .jpg-thumb-btn {
  all: unset;
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.jpg-product-gallery .jpg-thumb-btn:focus {
  outline: none;
}

.jpg-product-gallery .jpg-thumb-btn:focus-visible {
  outline: 2px solid rgba(196, 41, 47, 0.65);
  outline-offset: 2px;
  border-radius: 12px;
}

.jpg-product-gallery .jpg-carousel-arrow:focus {
  outline: none;
}

.jpg-product-gallery .jpg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 25% 55%;
}

.jpg-product-gallery .jpg-thumb-video-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: #111111;
}

.jpg-product-gallery .jpg-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.28);
}

.jpg-product-gallery .jpg-thumb-play::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent #ffffff;
  margin-left: 2px;
}

@media (max-width: 1024px) {
  .jpg-product-gallery--carousel {
    --jpg-carousel-visible: 3;
  }
}

@media (max-width: 520px) {
  .jpg-product-gallery .jpg-wish {
    top: 28px;
    right: 28px;
    width: 64px;
    height: 64px;
  }

  .jpg-product-gallery .jpg-thumbs.jpg-thumbs--grid {
    padding: 0 12px 6px;
  }
}

