body.no-scroll {
  overflow: hidden;
}

.custom-popup {
  display: none;
}

.custom-popup.active {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  z-index: 9999;
}

.custom-popup.active .custom-popup__inner {
  position: relative;
  aspect-ratio: 600/800;
  max-height: 60vh;
}

.custom-popup.active .custom-popup__inner a {
  display: inline-block;
  width: 100%;
  height: 100%;
}

.custom-popup.active .custom-popup__inner .custom-popup__content {
  width: 100%;
  height: 100%;
}

.custom-popup.active .custom-popup__inner img {
  width: 100%;
  height: auto;
  -o-object-fit: cover;
     object-fit: cover;
}

.custom-popup .custom-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #333;
  transition: background-color 0.3s ease;
}

.custom-popup .custom-popup__close:hover {
  background: rgba(255, 255, 255, 1);
}

.custom-popup .custom-popup__close:before {
  content: "×";
  font-size: 20px;
  line-height: 1;
}

/* Text mode popup */
.custom-popup--text.active .custom-popup__inner {
  aspect-ratio: auto;
  max-height: 80vh;
  max-width: 700px;
  width: 90vw;
  background: #fff;
  border-radius: 8px;
  overflow-y: auto;
}

.custom-popup__content--text {
  padding: 40px;
  color: #333;
  font-size: 16px;
  line-height: 1.6;
}

.custom-popup__content--text h1,
.custom-popup__content--text h2,
.custom-popup__content--text h3,
.custom-popup__content--text h4 {
  margin-top: 0;
}

.custom-popup__content--text p:last-child {
  margin-bottom: 0;
}

.custom-popup__content--text a {
  color: inherit;
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .custom-popup.active .custom-popup__inner {
    max-height: 70vh;
    margin: 0 20px;
  }
}

@media (max-width: 480px) {
  .custom-popup.active .custom-popup__inner {
    max-height: 80vh;
    margin: 0 15px;
  }
}