body.item .catlo-item-detail .catlo-item-gallery {
  container-type: inline-size;
  display: block;
  float: none;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0 0 22px;
  padding: 0;
}

body.item .catlo-item-gallery__stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: min(65vw, 540px);
  height: clamp(400px, 65cqw, 540px);
  min-height: 400px;
  max-height: 540px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #26363b;
  border-radius: 14px;
  background: #222b2d;
  box-sizing: border-box;
}

body.item .catlo-item-gallery__stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 18, 21, .18), rgba(8, 18, 21, .48));
  pointer-events: none;
}

body.item .catlo-item-gallery__ambient {
  position: absolute;
  z-index: 0;
  inset: -8%;
  display: block;
  width: 116%;
  height: 116%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  filter: blur(28px) brightness(.52) saturate(.85);
  opacity: .9;
  transform: scale(1.08);
  user-select: none;
  pointer-events: none;
}

body.item .catlo-item-gallery__main-wrap {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: clamp(10px, 2cqw, 18px);
  align-items: center;
  justify-content: center;
}

body.item .catlo-item-gallery__main-link,
body.item .catlo-item-gallery__picture {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

body.item .catlo-item-gallery__main {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  image-rendering: auto;
  transition: opacity 180ms ease;
}

body.item .catlo-item-gallery__main.is-loading {
  opacity: .42;
}

body.item .catlo-item-gallery__main.is-small-image {
  box-shadow: 0 8px 28px rgba(3, 11, 14, .2);
}

body.item .catlo-item-gallery__loading {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid rgba(255, 255, 255, .38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: catlo-gallery-spin .7s linear infinite;
  pointer-events: none;
}

body.item .catlo-item-gallery__fallback {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: linear-gradient(145deg, #202b2f, #151d20);
  color: #d8e2e5;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

body.item .catlo-item-gallery__fallback[hidden],
body.item .catlo-item-gallery__loading[hidden] {
  display: none;
}

body.item .catlo-item-gallery__fallback svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

body.item .catlo-item-gallery__zoom {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: grid;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  background: rgba(16, 29, 33, .72);
  color: #fff;
  box-shadow: 0 3px 12px rgba(3, 11, 14, .2);
  backdrop-filter: blur(7px);
  cursor: pointer;
}

body.item .catlo-item-gallery__zoom:hover {
  border-color: rgba(255, 255, 255, .82);
  background: rgba(12, 112, 99, .88);
  color: #fff;
}

body.item .catlo-item-gallery__zoom:focus-visible,
body.item .catlo-item-gallery__thumb:focus-visible,
body.item .catlo-item-gallery__main-link:focus-visible {
  outline: 3px solid rgba(68, 211, 182, .78);
  outline-offset: 2px;
}

body.item .catlo-item-gallery__zoom svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

body.item .catlo-item-gallery__counter {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 12px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(8, 18, 21, .72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  backdrop-filter: blur(6px);
}

body.item .catlo-item-gallery__status {
  position: absolute;
  z-index: 3;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 100px);
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, .76);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

body.item .catlo-item-gallery__status:empty {
  display: none;
}

body.item .catlo-item-gallery__thumbs {
  display: flex;
  min-width: 0;
  margin: 12px 0 0;
  padding: 3px 2px 4px;
  gap: 9px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.item .catlo-item-gallery__thumbs::-webkit-scrollbar {
  display: none;
}

body.item .catlo-item-gallery__thumb {
  position: relative;
  display: block;
  flex: 0 0 70px;
  box-sizing: border-box;
  width: 70px;
  height: 70px;
  padding: 2px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  scroll-snap-align: start;
}

body.item .catlo-item-gallery__thumb:hover {
  border-color: #82c7ba;
}

body.item .catlo-item-gallery__thumb.is-active {
  border-color: #087f6f;
  box-shadow: 0 0 0 1px rgba(8, 127, 111, .12);
}

body.item .catlo-item-gallery__thumb.is-active::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #087f6f;
}

body.item .catlo-item-gallery__thumb.is-error {
  opacity: .45;
}

body.item .catlo-item-gallery__thumb-image {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border-radius: 5px;
  object-fit: cover;
}

body.item .catlo-item-gallery__noscript {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

body.item .catlo-item-gallery__noscript a {
  font-size: 14px;
}

.catlo-item-gallery-lightbox .fancybox-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.catlo-item-gallery-lightbox .fancybox-bg {
  background: #071013;
  opacity: .96;
}

@media (max-width: 900px) and (min-width: 640px) {
  body.item .catlo-item-gallery__stage {
    height: clamp(380px, 62cqw, 430px);
    min-height: 380px;
    max-height: 430px;
  }
}

@media (max-width: 639px) {
  body.item .catlo-item-detail .catlo-item-gallery {
    width: calc(100vw - 16px);
    margin-bottom: 20px;
    margin-left: calc(50% - 50vw + 8px);
  }

  body.item .catlo-item-gallery__stage {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
  }

  body.item .catlo-item-gallery__ambient {
    filter: blur(21px) brightness(.5) saturate(.82);
  }

  body.item .catlo-item-gallery__main-wrap {
    padding: 10px;
  }

  body.item .catlo-item-gallery__thumbs {
    margin-top: 10px;
    gap: 8px;
  }

  body.item .catlo-item-gallery__thumb {
    flex-basis: 60px;
    width: 60px;
    height: 60px;
    border-radius: 8px;
  }

  body.item .catlo-item-gallery__zoom {
    top: 9px;
    right: 9px;
    width: 38px;
    height: 38px;
  }

  body.item .catlo-item-gallery__counter {
    right: 9px;
    bottom: 9px;
  }

  body.item .catlo-item-gallery__status {
    left: 9px;
    bottom: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.item .catlo-item-gallery__main {
    transition: none;
  }

  body.item .catlo-item-gallery__loading {
    animation: none;
  }
}

@keyframes catlo-gallery-spin {
  to { transform: rotate(360deg); }
}
