.autogp-gallery-lightbox[hidden] {
  display: none !important;
}

.autogp-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 76px 64px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.94);
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.autogp-gallery-lightbox button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(25, 25, 25, 0.72);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  line-height: 1;
  box-shadow: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.autogp-gallery-lightbox button:hover,
.autogp-gallery-lightbox button:focus-visible {
  background: #bd1220;
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.autogp-gallery-lightbox__close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 34px;
  padding: 0;
}

.autogp-gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 64px;
  margin-top: -32px;
  border-radius: 8px;
  font-size: 52px;
  padding: 0 0 6px;
}

.autogp-gallery-lightbox__previous { left: 18px; }
.autogp-gallery-lightbox__next { right: 18px; }

.autogp-gallery-lightbox__figure {
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.autogp-gallery-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100% - 28px);
  object-fit: contain;
  border: 0;
  border-radius: 2px;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.35);
}

.autogp-gallery-lightbox__caption {
  margin-top: 10px;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
}

.autogp-gallery-lightbox__counter {
  position: absolute;
  left: 50%;
  bottom: 19px;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(25, 25, 25, 0.72);
  border-radius: 20px;
  padding: 7px 13px;
}

@media (max-width: 650px) {
  .autogp-gallery-lightbox { padding: 58px 12px 66px; }
  .autogp-gallery-lightbox__nav { width: 40px; height: 52px; margin-top: -26px; font-size: 42px; }
  .autogp-gallery-lightbox__previous { left: 8px; }
  .autogp-gallery-lightbox__next { right: 8px; }
  .autogp-gallery-lightbox__close { top: 10px; right: 10px; width: 42px; height: 42px; }
  .autogp-gallery-lightbox__image { max-width: 100%; max-height: calc(100% - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  .autogp-gallery-lightbox button { transition: none; }
}
