/*
  Lightbox — full-screen image overlay opened from any element carrying
  [data-lightbox-trigger][data-full]. Generic/reusable component (not tied
  to a single page), wired up in js/main.js. First used on
  szerelvenygyartas.html's .product-intro__gallery.
*/

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(20, 33, 47, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-base) var(--ease-out), visibility 0s linear var(--duration-base);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--duration-base) var(--ease-out);
}

.lightbox__figure {
  position: relative;
  max-width: min(1200px, 100%);
  max-height: 100%;
  transform: scale(0.96);
  transition: transform var(--duration-base) var(--ease-spring);
}

.lightbox.is-open .lightbox__figure {
  transform: scale(1);
}

.lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - var(--space-8) * 2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.lightbox__close {
  /* Fixed to the overlay's own corner, not the figure — a wide image can
     fill almost the full viewport width/height, which would push a
     figure-relative button off-screen. */
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-navy-900);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--duration-base) var(--ease-spring), box-shadow var(--duration-base) var(--ease-out);
}

.lightbox__close svg {
  width: 18px;
  height: 18px;
}

.lightbox__close:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-lg);
}

.lightbox__close:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.lightbox__close:active {
  transform: scale(0.96);
}

.lightbox__nav {
  position: fixed;
  top: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-navy-900);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform var(--duration-base) var(--ease-spring), box-shadow var(--duration-base) var(--ease-out);
}

.lightbox__nav svg {
  width: 22px;
  height: 22px;
}

.lightbox__nav--prev {
  left: var(--space-5);
}

.lightbox__nav--next {
  right: var(--space-5);
}

.lightbox__nav:hover {
  box-shadow: var(--shadow-lg);
}

.lightbox__nav--prev:hover {
  transform: translate(-3px, -50%);
}

.lightbox__nav--next:hover {
  transform: translate(3px, -50%);
}

.lightbox__nav:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.lightbox__nav:active {
  transform: translateY(-50%) scale(0.94);
}

.lightbox__nav.is-hidden,
.lightbox__counter.is-hidden {
  display: none;
}

.lightbox__counter {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--color-white);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  letter-spacing: 0.02em;
}

@media (max-width: 560px) {
  .lightbox {
    padding: var(--space-8) var(--space-4);
  }

  .lightbox__close {
    top: var(--space-3);
    right: var(--space-3);
  }

  .lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .lightbox__nav svg {
    width: 18px;
    height: 18px;
  }

  .lightbox__nav--prev {
    left: var(--space-3);
  }

  .lightbox__nav--next {
    right: var(--space-3);
  }
}
