/* 역대짬뽕 다중 레이어 팝업 — PC 가로 펼침 / 모바일 캐러셀 */

/* 팝업 열림 시 상단 GNB·서브메뉴 클릭 가능 (레이어 팝업 z-index 10000 위) */
body.layer-popup-open .header {
  z-index: 10001;
}

.layer-popup--multi .layer-popup__footer:not(.layer-popup__footer--today-only) {
  display: none !important;
}

.layer-popup--multi .layer-popup__footer--today-only {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 8px;
  background: #000;
  border-top: none;
}

.layer-popup--multi .layer-popup__footer--today-only .layer-popup__today {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: #fff;
  font-family: Pretendard Variable, Pretendard, sans-serif;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}

.layer-popup--multi .layer-popup__footer--today-only .layer-popup__today-input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: #e85d04;
  cursor: pointer;
}

.layer-popup--multi .layer-popup__close {
  width: 24px;
  height: 24px;
  top: 6px;
  right: 6px;
}

.layer-popup--multi .layer-popup__close svg {
  width: 14px;
  height: 14px;
}

.layer-popup--multi .layer-popup__overlay {
  padding: 16px;
}

.layer-popup--multi .layer-popup__stage {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.layer-popup--multi .layer-popup__track {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.layer-popup--multi .layer-popup__dialog {
  flex: 0 0 auto;
  max-width: min(560px, 92vw);
  max-height: 90vh;
  overflow: hidden;
}

.layer-popup--multi .layer-popup__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.layer-popup--multi .layer-popup__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(90vh - 24px);
  object-fit: contain;
  object-position: top center;
}

.layer-popup--multi .layer-popup__footer--today-only {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  min-height: 20px;
}

.layer-popup--multi .layer-popup__nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #fff;
  cursor: pointer;
  background: rgb(0 0 0 / 55%);
  border: none;
  border-radius: 50%;
  transform: translateY(-50%);
  transition: background-color 0.2s ease;
}

.layer-popup--multi .layer-popup__nav:hover {
  background: rgb(0 0 0 / 75%);
}

.layer-popup--multi .layer-popup__nav svg {
  width: 18px;
  height: 18px;
}

.layer-popup--multi .layer-popup__nav--prev {
  left: 4px;
}

.layer-popup--multi .layer-popup__nav--next {
  right: 4px;
}

/* PC: 나란히 펼침 */
@media (min-width: 1024px) {
  .layer-popup--multi .layer-popup__overlay {
    align-items: center;
    justify-content: center;
  }

  .layer-popup--multi .layer-popup__stage {
    width: auto;
    max-width: calc(100vw - 32px);
  }

  .layer-popup--multi .layer-popup__track {
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: center;
    overflow: visible;
  }

  .layer-popup--multi .layer-popup__dialog {
    width: min(400px, calc((100vw - 56px) / var(--layer-popup-count, 3) - 12px));
    max-width: min(400px, calc((100vw - 56px) / var(--layer-popup-count, 3) - 12px));
    max-height: 90vh;
  }
}

/* 모바일: 가로 스크롤 캐러셀 */
@media (max-width: 1023px) {
  .layer-popup--multi .layer-popup__stage {
    width: min(92vw, 420px);
    margin: 0 auto;
  }

  .layer-popup--multi .layer-popup__track {
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .layer-popup--multi .layer-popup__track::-webkit-scrollbar {
    display: none;
  }

  .layer-popup--multi .layer-popup__dialog {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    scroll-snap-align: center;
  }

  .layer-popup--multi.layer-popup--carousel .layer-popup__nav {
    position: fixed;
    top: 50%;
    display: flex;
    transform: translateY(-50%);
  }

  .layer-popup--multi.layer-popup--carousel .layer-popup__nav--prev {
    left: 5px;
  }

  .layer-popup--multi.layer-popup--carousel .layer-popup__nav--next {
    right: 5px;
  }

  .layer-popup--multi.layer-popup--carousel .layer-popup__nav[disabled] {
    opacity: 0.35;
    cursor: default;
  }
}
