/* KingEvent Pro Product Gallery — scoped to its own components */
.keg-images-wrap { min-width: 0; max-width: 100%; }
.keg-images-wrap .keg-gallery { width: 100% !important; float: none !important; }
.keg-replaced-native > .keg-gallery { max-width: 100%; width: 100%; }

.keg-gallery,
.keg-gallery * { box-sizing: border-box; }
.keg-gallery {
  --keg-accent: #c00022;
  --keg-line: #e8eaf0;
  --keg-round: 15px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 25px;
  color: #1b2030;
  font-family: inherit;
  position: relative;
  isolation: isolate;
}
.keg-main {
  position: relative;
  border-radius: var(--keg-round);
  border: 1px solid var(--keg-line);
  background: #fff;
  overflow: hidden;
}
.keg-track {
  display: flex;
  flex-wrap: nowrap;
  direction: ltr;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #fff;
  touch-action: pan-x pan-y;
  outline: none;
}
.keg-track:focus-visible { outline: 3px solid var(--keg-accent); outline-offset: -3px; }
.keg-track::-webkit-scrollbar, .keg-thumbs::-webkit-scrollbar { display: none; }
.keg-aspect-portrait .keg-track { aspect-ratio: 4 / 5; }
.keg-aspect-auto .keg-track { aspect-ratio: auto; height: min(66vw, 500px); min-height: 240px; }
.keg-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #fff;
  user-select: none;
  -webkit-user-select: none;
}
.keg-main-image {
  display: block !important;
  position: relative !important;
  object-fit: contain !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 6px !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  pointer-events: none;
  user-select: none;
  transition: none !important;
  transform-origin: center center;
}
.keg-track.keg-can-open .keg-slide { cursor: zoom-in; }
.keg-is-main-zoomed .keg-slide { cursor: grab; }
.keg-control {
  display: grid !important;
  place-items: center;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  padding: 0 !important;
  position: absolute;
  z-index: 3;
  border: 1px solid rgba(15, 23, 42, .08) !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.95) !important;
  color: #263043 !important;
  box-shadow: 0 2px 13px rgba(0,0,0,.10);
  cursor: pointer;
  line-height: 1 !important;
  opacity: 1 !important;
  transition: background .15s ease, transform .15s ease;
}
.keg-control:hover { background: #f6f7f9 !important; transform: translateY(-50%) scale(1.06); }
.keg-control:focus-visible, .keg-thumb:focus-visible { outline: 3px solid var(--keg-accent); outline-offset: 2px; }
.keg-control svg { display: block; width: 20px; height: 20px; }
.keg-arrow { top: 50%; transform: translateY(-50%); }
.keg-arrow:hover { transform: translateY(-50%) scale(1.06); }
.keg-arrow-prev { right: 11px; }
.keg-arrow-next { left: 11px; }
.keg-open { top: 12px; left: 12px; }
.keg-open:hover { transform: scale(1.06); }
.keg-counter {
  display: flex;
  flex-direction: row;
  direction: ltr;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: absolute;
  bottom: 13px;
  right: 13px;
  z-index: 3;
  height: 30px;
  min-width: 58px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(24,30,40,.72);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  pointer-events: none;
}
.keg-counter-divide { opacity: .65; }
.keg-zoom-hint {
  position: absolute;
  bottom: 16px;
  left: 16px;
  color: rgba(20,28,40,.60);
  pointer-events: none;
  display: flex;
}
.keg-zoom-hint svg { width: 18px; height: 18px; }
.keg-thumbs-wrap { width: 100%; margin-top: 12px; position: relative; min-width: 0; }
.keg-thumbs {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  flex-wrap: nowrap;
  direction: rtl;
  gap: 9px;
  padding: 3px 2px 9px;
  margin: 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.keg-thumb {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 76px;
  width: 76px !important;
  min-width: 76px;
  max-width: 76px;
  height: 76px !important;
  min-height: 76px;
  margin: 0 !important;
  padding: 4px !important;
  line-height: 1 !important;
  border: 2px solid var(--keg-line) !important;
  border-radius: 11px !important;
  box-shadow: none !important;
  background: #fff !important;
  cursor: pointer;
  opacity: .70;
  scroll-snap-align: start;
  transition: border-color .16s ease, opacity .16s ease, box-shadow .16s ease;
}
.keg-thumb:hover { opacity: 1; }
.keg-thumb.is-active {
  opacity: 1;
  border-color: var(--keg-accent) !important;
  box-shadow: 0 0 0 1px var(--keg-accent) !important;
}
.keg-thumb-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  box-shadow: none !important;
  object-fit: contain !important;
  pointer-events: none;
}
/* Fullscreen-style overlay is mounted only when requested. */
body.keg-dialog-visible { overflow: hidden !important; }
.keg-modal[hidden], .keg-modal [hidden], .keg-fallback-host[hidden] { display: none !important; }
.keg-modal, .keg-modal * { box-sizing: border-box; }
.keg-modal {
  position: fixed !important;
  z-index: 2147483000 !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  direction: rtl;
  color: #fff;
  font-family: inherit;
  background: rgba(9,13,21,.98);
}
.keg-modal-backdrop { position: absolute; inset: 0; cursor: zoom-out; }
.keg-modal-stage {
  position: absolute;
  inset: 65px 56px 71px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.keg-modal-zoomed { cursor: grab; }
.keg-modal-image {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0;
  min-height: 0;
  object-fit: contain !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform;
}
.keg-modal-button, .keg-modal-tool {
  display: grid !important;
  place-items: center;
  position: absolute;
  margin: 0 !important;
  padding: 0 !important;
  background: rgba(255,255,255,.13) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: #fff !important;
  border-radius: 50% !important;
  cursor: pointer;
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
}
.keg-modal-button:hover, .keg-modal-tool:hover { background: rgba(255,255,255,.28) !important; }
.keg-modal-button:focus-visible, .keg-modal-tool:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.keg-modal-button { width: 44px !important; height: 44px !important; z-index: 5; }
.keg-modal-close { top: max(12px, env(safe-area-inset-top)); left: 16px; font-size: 32px; }
.keg-modal-prev { top: 50%; right: 10px; transform: translateY(-50%); }
.keg-modal-next { top: 50%; left: 10px; transform: translateY(-50%); }
.keg-modal-toolbar {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  direction: ltr;
}
.keg-modal-counter { font-size: 14px; font-weight: 600; white-space: nowrap; margin-right: 9px; }
.keg-modal-tool { position: relative; width: 39px !important; height: 39px !important; font-size: 22px; }
.keg-modal-tool[data-keg-zoom-reset] { font-size: 13px; }
@media (max-width: 767px) {
  .keg-gallery { --keg-round: 12px; margin-bottom: 18px; }
  .keg-arrow { width: 32px !important; height: 32px !important; min-width: 32px !important; }
  .keg-arrow-prev { right: 7px; }
  .keg-arrow-next { left: 7px; }
  .keg-open { width: 34px !important; height: 34px !important; min-width: 34px !important; top: 8px; left: 8px; }
  .keg-thumb { flex-basis: 63px; width: 63px !important; min-width: 63px; max-width: 63px; height: 63px !important; min-height: 63px; border-radius: 9px !important; }
  .keg-thumbs { gap: 7px; }
  .keg-modal-stage { inset: 66px 8px 86px; }
  .keg-modal-prev, .keg-modal-next { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); transform: none; width: 38px !important; height: 38px !important; }
  .keg-modal-prev { right: 10px; }
  .keg-modal-next { left: 10px; }
  .keg-modal-toolbar { gap: 6px; }
  .keg-modal-tool { width: 34px !important; height: 34px !important; }
  .keg-modal-counter { font-size: 12px; margin-right: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .keg-gallery *, .keg-modal * { scroll-behavior: auto !important; transition: none !important; }
}
