/* ====== 기본(페이지 내) 이미지/비주얼 스와이퍼 ====== */
.branch-image-swiper { position: relative; width: 100%; height: 100%; }
.branch-image-swiper__slider { width: 100%; height: 100%; }

.branch-image-swiper__slide { position: relative; width: 100%; height: 100%; }
.branch-image-swiper__slide img { width: 100%; height: 100%; object-fit: cover; }

.branch-image-swiper__nav {
  position: absolute; bottom: 0; left: 0; z-index: 1;
  padding: 40px 0 0 0; display: flex; width: 100%; height: 132px;
  column-gap: 18px; justify-content: center; align-items: center;
  background-color: #FAF6EE; border-radius: 200px 200px 0 0;
}
.branch-image-swiper__thumbnails {
  margin: 0; padding: 0; display: flex; width: 100%; max-width: 912px;
  height: auto; justify-content: center; column-gap: 18px;
}
.branch-image-swiper__thumbnail { width: 123px; height: 92px; border-radius: 10px; overflow: hidden; }
.branch-image-swiper__thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.branch-image-swiper__prev, .branch-image-swiper__next {
  margin: 0; padding: 0; height: 100%; border: none; background: transparent;
  appearance: none; cursor: pointer;
}

/* branch_visual_swiper */
.branch-visual-swiper,
.branch-visual-swiper__slider,
.branch-visual-swiper__slide { width: 100%; height: 100%; }

.branch-visual-swiper__prev, .branch-visual-swiper__next {
  position: absolute; top: 50%; z-index: 1; margin: 0; padding: 0;
  width: auto; height: auto; appearance: none; border: none; background: transparent;
  transform: translateY(-50%); cursor: pointer; background-color: #FFF;
  border-radius: 100%; box-shadow: 0 0 6px 0 rgba(0,0,0,.4);
}
.branch-visual-swiper__prev { left: 20px; }
.branch-visual-swiper__next { right: 20px; }

/* ====== 라이트박스 ====== */
.bv-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.9);
}
.bv-lightbox.is-open { display: flex; }
.bv-lightbox__overlay { position: absolute; inset: 0; }

.bv-lightbox__inner {
  position: relative; width: min(96vw, 1280px); height: min(92vh, 900px);
  display: flex; flex-direction: column; gap: 12px; z-index: 1;
}

/* 폭 증가 루프 방지: flex item 축소 허용 + 내부 overflow 관리 */
.bv-lightbox__main, .bv-lightbox__thumbs { min-width: 0; overflow: hidden; }
/* Swiper 컨테이너도 축소 허용 */
.bv-lightbox__main .swiper, .bv-lightbox__thumbs .swiper { min-width: 0; }

/* 라이트박스 Swiper 래퍼 보정 (전역 absolute/inset 덮어쓰기 차단) */
.bv-lightbox__main .swiper-wrapper,
.bv-lightbox__thumbs .swiper-wrapper {
  display: flex !important;
  position: relative !important;
  inset: auto !important;
  height: 100%;
  box-sizing: content-box;
}

.bv-lightbox__close {
  position: absolute; top: 6px; right: 6px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.5); color: #fff; font-size: 24px; line-height: 1;
  cursor: pointer; z-index: 2;
}

.bv-lightbox__main { flex: 1 1 auto; min-height: 0; }
.bv-lightbox__main .swiper-slide {
  /* 핵심: 한 장 = 100% 폭 고정 */
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
}
.bv-lightbox__main img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  user-select: none; -webkit-user-drag: none;
}

/* 메인 내비 버튼 */
.bv-lightbox__prev, .bv-lightbox__next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.45); color: #fff; font-size: 22px;
  cursor: pointer; z-index: 3;
}
.bv-lightbox__prev { left: 8px; }
.bv-lightbox__next { right: 8px; }

/* 썸네일 바 */
.bv-lightbox__thumbs { height: 96px; position: relative; }
.bv-lightbox__thumbs .swiper-slide {
  /* 썸네일 한 칸 너비 고정 */
  flex: 0 0 96px !important;
  width: 96px !important; height: 96px;
  opacity: .55; transition: opacity .2s ease, transform .2s ease; cursor: pointer;
}
.bv-lightbox__thumbs .swiper-slide-thumb-active {
  opacity: 1; transform: scale(1.02);
  box-shadow: 0 0 0 2px rgba(255,255,255,.7) inset;
}
.bv-lightbox__thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* 썸네일 내비 버튼(옵션) */
.bv-thumbs__prev, .bv-thumbs__next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.45); color: #fff; z-index: 2;
}
.bv-thumbs__prev { left: 6px; }
.bv-thumbs__next { right: 6px; }

/* 접근성: 호버 강조 */
@media (hover:hover) {
  .bv-lightbox__prev:hover, .bv-lightbox__next:hover, .bv-lightbox__close:hover { filter: brightness(1.15); }
}

/* 반응형 */
@media screen and (max-width: 768px) {
  .branch-image-swiper__nav {
    padding: 0 15px; border-radius: 100px 100px 0 0; column-gap: 10px;
  }
  .branch-image-swiper__thumbnails { max-width: 100%; column-gap: 10px; }
  .branch-image-swiper__thumbnail { width: 56px; height: 42px; }

  .bv-lightbox__inner { width: 100vw; height: 100vh; border-radius: 0; }
  .bv-lightbox__thumbs { height: 80px; }
  .bv-lightbox__thumbs .swiper-slide {
    flex-basis: 80px !important; width: 80px !important; height: 80px;
  }
}
