
.custom-popup {
  position: fixed;
  z-index: 2147483647;
  background: #fff;
  border: 1px solid #222;
  box-shadow: 2px 2px 15px rgba(0,0,0,0.3);
  overflow: hidden;
  border-radius: 8px;
}
.popup-header {
  height: 45px;
  display: flex;
  align-items: center;
  background: #222;
  color: #fff;
  padding: 8px 12px;
  font-weight: bold;
  cursor: move;
  justify-content: space-between;
}
.popup-header-btns {
  display: flex;
  align-items: center;
  gap: 5px;
}
.fold-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 5px 8px;
}
.popup-body {
  height: calc(100% + 40px)!important;
}
.popup-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.popup-footer {
  background: #f9f9f9;
  padding: 0px 12px;
  height: 40px;
  text-align: right;
  font-size: 0.9em;
  position: absolute;
  bottom: 0px;
  left: 0px;
  width: 100%;
  display: flex;
  align-items: center;
}
.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 25px;
  cursor: pointer;
}
.custom-popup.mobile-slide {
  left: 0 !important;
  right: 0 !important;
  bottom: -100%;
  width: 100% !important;
  max-width: 100vw !important;
  height: auto !important;
  border-radius: 12px 12px 0 0;
  animation: slideUp 0.5s forwards;
  box-sizing: border-box;
  border-left: none;
  border-right: none;
}
.custom-popup.mobile-slide.hide {
  animation: slideDown 0.5s forwards;
}
@keyframes slideUp {
  from { bottom: -100%; }
  to   { bottom: 0; }
}
@keyframes slideDown {
  from { bottom: 0; }
  to   { bottom: -100%; }
}
.popup-img { display: none; }
.popup-content { display: block; }

@media screen and (min-width: 769px) {
  .popup-img-pc { display: block; }
}
@media screen and (max-width: 768px) {
  .popup-img-mo { display: block; }

  /* 모바일 슬라이드 팝업 본문 스타일 */
  .custom-popup.mobile-slide .popup-body {
    max-height: 70vh;
    overflow-y: auto;
  }
  .custom-popup.mobile-slide .popup-content {
    padding: 15px;
  }
  .custom-popup.mobile-slide .popup-content img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
  }

  /* 모바일 팝업 접힌 상태 - 헤더만 하단에 표시 */
  .custom-popup.mobile-slide.folded {
    animation: none;
    bottom: 0;
  }
  .custom-popup.mobile-slide.folded .popup-body,
  .custom-popup.mobile-slide.folded .popup-footer {
    display: none;
  }
  .custom-popup.mobile-slide.folded .popup-header {
    border-radius: 12px 12px 0 0;
  }
}

.popup-body {
  height: 100%;
  padding-bottom: 40px;
}

/* ✅ Swiper 팝업 스타일 (모바일 2개 이상) */
.popup-swiper {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.popup-swiper .swiper-wrapper {
  box-sizing: border-box;
}
.popup-swiper .swiper-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.popup-swiper .swiper-slide img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}
.popup-swiper .swiper-slide a {
  display: block;
  width: 100%;
}
.popup-swiper .slide-title {
  width: 100%;
  padding: 10px 15px;
  font-weight: bold;
  font-size: 14px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
}
.popup-swiper .swiper-pagination {
  position: relative;
  margin-top: 10px;
  padding-bottom: 10px;
}
.popup-swiper .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: #ccc;
  opacity: 1;
}
.popup-swiper .swiper-pagination-bullet-active {
  background: #222;
}
#mobile-popup-swiper-wrap {
  overflow: hidden;
}
#mobile-popup-swiper-wrap .popup-body {
  max-height: 70vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 40px;
}
#mobile-popup-swiper-wrap .popup-content {
  padding: 0;
}
#mobile-popup-swiper-wrap.folded .popup-body,
#mobile-popup-swiper-wrap.folded .popup-footer {
  display: none;
}
#mobile-popup-swiper-wrap.folded .popup-header {
  border-radius: 12px 12px 0 0;
}