.wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 60px;
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: var(--antracit);
  z-index: 9999;
  display: none;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  height: 100dvh;
}

.lightbox[aria-hidden="false"] {
  display: grid;
}

.stage {  
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

.stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

.thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 20px;
  justify-content: center;
}

.thumbs img {
  flex: 0 0 auto;
  width: 85px;
  height: 85px;
  object-fit: cover;
  border-radius: 10px;
  opacity: .75;
  cursor: pointer;
  border: 2px solid transparent;
}

.thumbs img.is-active {
  opacity: 1;
  border-color: var(--beige-light);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.close-btn::before,
.close-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 2px;
  background: var(--beige-light);
  transition: transform 0.3s, background 0.3s;
}

.close-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.close-btn:hover::before,
.close-btn:hover::after {
  background: #f44336;
}

.close-btn:hover {
  transform: scale(1.2);
}

/**********************/
.stage-text {
  position: absolute;
  right: 150px;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  text-align: center;
  font-size: 1.2rem;
  color: #eee;
}

/* --- tady přidáš moje DOPLŇKY pro responzivitu --- */

/* Lepší výška na mobilech */
.lightbox {
  height: 100svh; /* místo 100dvh */
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}

.thumbs {
  -webkit-overflow-scrolling: touch;
}

.close-btn {
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
}

/* --- Mobilní layout --- */
@media (max-width: 768px) {
  .stage {
    padding-top: 0;
    min-height: 0;
  }

  .stage img {
    max-height: calc(100svh - 200px);
  }

  .stage-text {
    position: static;
    transform: none;
    width: auto;
    margin: 6px 0 0;
    text-align: center;
    font-size: 1rem;
    color: #eee;
    max-height: 6lh;
    overflow: auto;
  }

  .thumbs {
    padding: 8px 2px max(10px, env(safe-area-inset-bottom));
    gap: 8px;
    justify-content: flex-start;
  }

  .thumbs img {
    width: 72px;
    height: 72px;
  }
}

/* --- Desktop zachová původní chování --- */
@media (min-width: 769px) {
  .stage-text {
    position: absolute;
    right: 150px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    text-align: center;
    font-size: 1.2rem;
    color: #eee;
  }

  .thumbs {
    justify-content: center;
  }

  .thumbs img {
    width: 85px;
    height: 85px;
  }
}
