/* ============================================================================
   /css/rental-gallery-modal-20261205.css — 렌탈 상세 갤러리 (2026-12-05)
   ----------------------------------------------------------------------------
   · 상단 썸네일: 7장 이상이면 앞 5개 + 6번째 칸에 어두운 +N 오버레이, 7번째부터 숨김
   · 대화면 갤러리 팝업: 상품명 + 닫기 / 큰 이미지 + 확대·축소 / 하단 썸네일 줄
   · 이 파일은 새 클래스(rt-gal5, rt-gm*)만 정의한다. 기존 썸네일·상세 규칙은 건드리지 않는다.
   ============================================================================ */

/* ---------- 1. 상단 썸네일 5개 + +N (7장 이상일 때만 JS가 rt-gal5를 붙인다) ---------- */
.rt-thumbs.rt-gal5 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  padding-bottom: 0;
  margin-bottom: 0;
  scroll-snap-type: none;
}
.rt-thumbs.rt-gal5 > li { flex: 0 0 auto; min-width: 0; }
.rt-thumbs.rt-gal5 > li:nth-child(n+7) { display: none; }
.rt-thumbs.rt-gal5 .rt-thumb {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  padding: 5px;
  border-radius: 14px;
}
.rt-thumbs.rt-gal5 .rt-thumb img { width: 100%; height: 100%; }
.rt-gal5__more {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: rgba(15, 18, 25, .58);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
  transition: background-color .15s ease;
  pointer-events: none;
}
.rt-thumbs.rt-gal5 .rt-thumb:hover .rt-gal5__more { background: rgba(15, 18, 25, .70); }
.rt-thumbs.rt-gal5 .rt-thumb:focus-visible .rt-gal5__more { background: rgba(15, 18, 25, .70); }

@media (max-width: 640px) {
  .rt-thumbs.rt-gal5 { gap: 8px; }
  .rt-thumbs.rt-gal5 .rt-thumb { padding: 3px; border-radius: 10px; }
  .rt-gal5__more { font-size: 14px; }
}

/* ---------- 2. 대화면 갤러리 팝업 ---------- */
html.rt-gm-lock, body.rt-gm-lock { overflow: hidden; }

.rt-gm { position: fixed; inset: 0; z-index: 6000; display: none; }
.rt-gm.is-open { display: block; }
.rt-gm__backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 12, 16, .62);
}
.rt-gm__dialog {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(1240px, 94vw); height: min(900px, 92vh);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.rt-gm__head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px 16px 24px;
  border-bottom: 1px solid #eceef2;
}
.rt-gm__title {
  flex: 1 1 auto; min-width: 0;
  margin: 0;
  font-size: 16px; font-weight: 700; line-height: 1.4; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rt-gm__close {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: #f3f4f6; color: #111827;
  font-size: 17px; line-height: 1; cursor: pointer;
}
.rt-gm__close:hover { background: #e5e7eb; }
.rt-gm__close:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

.rt-gm__body {
  position: relative;
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 18px 76px;
  background: #fff;
}
.rt-gm__stage {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
}
.rt-gm__stage.is-zoom { cursor: grab; }
.rt-gm__stage.is-drag { cursor: grabbing; }
.rt-gm__img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.rt-gm__zoom {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  z-index: 3;
  display: flex; flex-direction: column; gap: 8px;
}
.rt-gm__zbtn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid #d7dbe2; border-radius: 50%;
  background: #fff; color: #111827;
  font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}
.rt-gm__zbtn:hover:not(:disabled) { background: #f8fafc; }
.rt-gm__zbtn:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.rt-gm__zbtn:disabled { opacity: .35; cursor: default; }

.rt-gm__thumbs {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px 14px;
  border-top: 1px solid #eceef2;
  background: #fff;
}
.rt-gm__arrow {
  flex: 0 0 auto;
  width: 34px; height: 44px;
  border: 0; border-radius: 8px;
  background: transparent; color: #111827;
  font-size: 26px; line-height: 1; cursor: pointer;
}
.rt-gm__arrow:hover { background: #f3f4f6; }
.rt-gm__arrow[hidden] { visibility: hidden; }
.rt-gm__strip {
  flex: 1 1 auto;
  display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}
.rt-gm__strip::-webkit-scrollbar { height: 5px; }
.rt-gm__strip::-webkit-scrollbar-thumb { background: #d7dbe2; border-radius: 999px; }
.rt-gm__strip::-webkit-scrollbar-track { background: transparent; }
.rt-gm__thumb {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  padding: 4px;
  border: 1px solid #e2e5eb; border-radius: 10px;
  background: #fff; cursor: pointer;
  overflow: hidden;
}
.rt-gm__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.rt-gm__thumb:hover { border-color: #b9bfc9; }
.rt-gm__thumb.is-active { border-color: #111827; box-shadow: 0 0 0 2px rgba(17, 24, 39, .12); }
.rt-gm__thumb:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

@media (max-width: 640px) {
  .rt-gm__dialog { top: 0; left: 0; transform: none; width: 100%; height: 100%; border-radius: 0; }
  .rt-gm__head { padding: 12px 12px 12px 16px; gap: 10px; }
  .rt-gm__title { font-size: 14px; }
  .rt-gm__close { width: 36px; height: 36px; font-size: 16px; }
  .rt-gm__body { padding: 8px 56px 8px 8px; }
  .rt-gm__zoom { right: 8px; gap: 6px; }
  .rt-gm__zbtn { width: 38px; height: 38px; font-size: 20px; }
  .rt-gm__thumbs { padding: 8px 5px 10px; gap: 4px; }
  .rt-gm__arrow { width: 28px; height: 40px; font-size: 22px; }
  .rt-gm__thumb { width: 54px; height: 54px; }
}
