/* Galería Sirvoy v238.3: vive en la ventana principal y no modifica el iframe. */
.haa-sirvoy-gallery {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  height: var(--haa-gallery-vh, 100dvh);
  padding: clamp(10px, 2vw, 22px);
  background: rgba(0, 0, 0, .9);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: contain;
}

.haa-sirvoy-gallery.is-open { display: flex; }

.haa-sirvoy-gallery__panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1120px, 100%);
  height: min(780px, 100%);
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 18px;
  background: rgba(18, 18, 18, .96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.haa-sirvoy-gallery__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 9px 12px 9px 18px;
  color: #fff;
}

.haa-sirvoy-gallery__title {
  min-width: 0;
  overflow: hidden;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.haa-sirvoy-gallery__close,
.haa-sirvoy-gallery__nav {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

.haa-sirvoy-gallery__close {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 29px;
  line-height: 1;
}

.haa-sirvoy-gallery__stage {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: 10px 68px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.haa-sirvoy-gallery__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  border-radius: 12px;
  object-fit: contain;
  object-position: center center;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
  opacity: 1;
}

.haa-sirvoy-gallery__image.is-loading { opacity: .3; }

.haa-sirvoy-gallery__status {
  position: absolute;
  inset: 50% auto auto 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  color: #fff;
  text-align: center;
}

.haa-sirvoy-gallery__nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  transform: translateY(-50%);
  font-size: 32px;
  line-height: 1;
}

.haa-sirvoy-gallery__nav--previous { left: 12px; }
.haa-sirvoy-gallery__nav--next { right: 12px; }
.haa-sirvoy-gallery__nav[hidden] { display: none; }

.haa-sirvoy-gallery__caption {
  min-height: 46px;
  padding: 11px 18px 15px;
  color: rgba(255, 255, 255, .9);
  line-height: 1.4;
  text-align: center;
}

.haa-sirvoy-gallery__close:hover,
.haa-sirvoy-gallery__close:focus-visible,
.haa-sirvoy-gallery__nav:hover,
.haa-sirvoy-gallery__nav:focus-visible {
  outline: 2px solid #efd174;
  outline-offset: 2px;
  background: rgba(255, 255, 255, .22);
}

html.haa-sirvoy-gallery-open,
body.haa-sirvoy-gallery-open { overscroll-behavior: none; }

@media (max-width: 700px), (max-height: 560px) {
  .haa-sirvoy-gallery { padding: 8px; }
  .haa-sirvoy-gallery__panel { border-radius: 13px; }
  .haa-sirvoy-gallery__header { min-height: 50px; padding: 5px 7px 5px 12px; }
  .haa-sirvoy-gallery__close { width: 40px; height: 40px; }
  .haa-sirvoy-gallery__stage { padding: 6px 49px; }
  .haa-sirvoy-gallery__nav { width: 40px; height: 40px; font-size: 27px; }
  .haa-sirvoy-gallery__nav--previous { left: 5px; }
  .haa-sirvoy-gallery__nav--next { right: 5px; }
  .haa-sirvoy-gallery__caption { min-height: 38px; padding: 7px 10px 10px; font-size: .9rem; }
}
