.woocommerce div.product div.images.teplitsa-gallery {
  --gallery-mint: #eaf6f0;
  --gallery-ink: #163b31;
  --gallery-accent: #22856e;
  min-width: 0;
  margin-bottom: 24px;
}

.teplitsa-gallery__frame {
  position: relative;
  padding: 10px 10px 52px;
  border-radius: 20px;
  background: var(--gallery-mint);
}

.teplitsa-gallery__stage {
  display: block;
  aspect-ratio: 4 / 3;
  min-width: 0;
  overflow: hidden;
  border-radius: 13px;
  background: #f5f8f6;
  touch-action: pan-y pinch-zoom;
}

.woocommerce div.product div.images.teplitsa-gallery .teplitsa-gallery__stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.teplitsa-gallery__controls {
  position: absolute;
  inset: auto 10px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gallery-ink);
}

.teplitsa-gallery__controls[hidden] { display: none; }

.teplitsa-gallery__count {
  padding: 4px 10px;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.teplitsa-gallery__arrows { display: flex; gap: 8px; }

.teplitsa-gallery__arrows button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #c9e1d6;
  border-radius: 50%;
  background: #fff;
  color: var(--gallery-ink);
  cursor: pointer;
}

.teplitsa-gallery__arrows button:hover { background: #d9eee5; }

.teplitsa-gallery__arrows span {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateX(-2px) rotate(-45deg);
}

.teplitsa-gallery__arrows [data-step="-1"] span { transform: translateX(2px) rotate(135deg); }

.teplitsa-gallery__strip {
  display: flex;
  gap: 8px;
  min-width: 0;
  margin-top: 9px;
  padding: 4px 3px 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: #7fac9b var(--gallery-mint);
}

.teplitsa-gallery__thumb {
  flex: 0 0 clamp(56px, 11vw, 76px);
  aspect-ratio: 1.2;
  overflow: hidden;
  border: 2px solid #dcece4;
  border-radius: 9px;
  background: var(--gallery-mint);
}

.teplitsa-gallery__thumb[aria-current="true"] { border-color: var(--gallery-accent); }

.woocommerce div.product div.images.teplitsa-gallery .teplitsa-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teplitsa-gallery a:focus-visible,
.teplitsa-gallery button:focus-visible {
  outline: 2px solid #125b47;
  outline-offset: 2px;
}

.teplitsa-gallery__stage[aria-haspopup="dialog"],
.teplitsa-description-photos a[aria-haspopup="dialog"] { cursor: zoom-in; }

:root:has(.teplitsa-lightbox[open]) { overflow: hidden; }

.teplitsa-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 68px clamp(66px, 8vw, 120px);
  border: 0;
  box-sizing: border-box;
  overflow: hidden;
  background: transparent;
  color: #fff;
}

.teplitsa-lightbox:not([open]) { display: none; }
.teplitsa-lightbox[open] { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; }
.teplitsa-lightbox::backdrop { background: rgba(10, 21, 16, .94); }

.teplitsa-lightbox .teplitsa-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.teplitsa-lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #bad4c6;
  border-radius: 50%;
  background: #f4f8f4;
  color: #163b31;
  cursor: pointer;
}

.teplitsa-lightbox button:hover { background: #d9eee5; color: #163b31; }
.teplitsa-lightbox__arrow[hidden] { display: none; }
.tr-design .teplitsa-lightbox button:focus-visible { outline: 2px solid #c4e6d3; outline-offset: 2px; }

.teplitsa-lightbox__count {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  padding: 5px 11px;
  border-radius: 20px;
  background: #20372b;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.teplitsa-lightbox__close {
  top: max(14px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
}

.teplitsa-lightbox__close::before,
.teplitsa-lightbox__close::after {
  grid-area: 1 / 1;
  width: 18px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
  content: "";
}

.teplitsa-lightbox__close::after { transform: rotate(-45deg); }

.teplitsa-lightbox__arrow { top: 50%; transform: translateY(-50%); }
.teplitsa-lightbox__arrow[data-step="-1"] { left: max(12px, env(safe-area-inset-left)); }
.teplitsa-lightbox__arrow[data-step="1"] { right: max(12px, env(safe-area-inset-right)); }

.teplitsa-lightbox__arrow span {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateX(-2px) rotate(-45deg);
}

.teplitsa-lightbox__arrow[data-step="-1"] span { transform: translateX(2px) rotate(135deg); }

@media (max-width: 600px) {
  .teplitsa-lightbox { padding: 62px 12px 74px; }
  .teplitsa-lightbox button { width: 44px; height: 44px; }
  .teplitsa-lightbox__arrow { top: auto; bottom: max(16px, env(safe-area-inset-bottom)); transform: none; }
  .teplitsa-lightbox__arrow[data-step="-1"] { left: calc(50% - 53px); }
  .teplitsa-lightbox__arrow[data-step="1"] { right: calc(50% - 53px); }
}

.teplitsa-description-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.teplitsa-description-photos figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #eef5f0;
}

.teplitsa-description-photos a { display: block; }

.teplitsa-description-photos img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

@media (max-width: 480px) {
  .teplitsa-description-photos { grid-template-columns: minmax(0, 1fr); }
}
