/* 상세페이지 공통 반응형 사진 갤러리 */
.detail-wrap .detail-back-row{width:min(100% - 32px,1100px);margin:0 auto 18px;text-align:center}
.detail-wrap .detail-back-link{display:inline-flex;align-items:center;min-height:48px;padding:0 18px;border:1px solid #1d4ed8;border-radius:12px;background:#2563eb;color:#fff;text-decoration:none;font-weight:900;box-shadow:0 5px 16px rgba(37,99,235,.28)}
.detail-wrap .detail-back-link:hover{border-color:#1e40af;color:#fff;background:#1d4ed8;box-shadow:0 7px 20px rgba(37,99,235,.36)}
.detail-wrap .img-slider-wrap{width:min(100% - 32px,960px);margin-inline:auto}
.detail-wrap .main-imgbox{width:100%;min-height:0!important;aspect-ratio:16/10;margin-bottom:12px!important;border-radius:16px;overflow:hidden;background:#edf2f8;position:relative;touch-action:pan-y;box-shadow:0 10px 32px rgba(15,23,42,.1)}
.detail-wrap .main-imgbox #mainImg{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:contain;border-radius:0!important;box-shadow:none!important;background:#edf2f8;cursor:zoom-in;user-select:none;-webkit-user-drag:none}
.detail-wrap .slide-arrow{position:absolute;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:50px;height:50px;padding:0!important;border:1px solid rgba(255,255,255,.55);border-radius:50%!important;background:rgba(15,23,42,.62)!important;color:#fff;font-size:30px!important;line-height:1;z-index:4;backdrop-filter:blur(5px);box-shadow:0 4px 18px rgba(0,0,0,.2)}
.detail-wrap .slide-arrow:hover{background:rgba(37,99,235,.9)!important}
.detail-wrap .slide-arrow.left{left:14px!important}.detail-wrap .slide-arrow.right{right:14px!important}
.detail-wrap .slide-arrow[hidden]{display:none}
.gallery-counter{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);z-index:4;padding:6px 11px;border-radius:999px;background:rgba(15,23,42,.72);color:#fff;font-size:14px;font-weight:800;letter-spacing:.02em;pointer-events:none}
.gallery-expand{position:absolute;right:12px;bottom:12px;z-index:5;display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0 13px;border:1px solid rgba(255,255,255,.6);border-radius:12px;background:rgba(15,23,42,.72);color:#fff;font-weight:800;cursor:pointer;backdrop-filter:blur(5px)}
.gallery-expand:hover{background:rgba(37,99,235,.95)}
.detail-wrap .thumbs-row{width:100%;display:flex!important;justify-content:flex-start!important;flex-wrap:nowrap!important;gap:9px!important;padding:4px 2px 9px;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;scrollbar-width:thin}
.detail-wrap .thumbs-row img{flex:0 0 104px;width:104px!important;height:72px!important;border:3px solid transparent!important;border-radius:10px!important;object-fit:cover;scroll-snap-align:start;background:#edf2f8;cursor:pointer;opacity:.72;box-sizing:border-box}
.detail-wrap .thumbs-row img.selected{border-color:#2563eb!important;opacity:1;box-shadow:0 0 0 2px rgba(37,99,235,.15)!important}

#imgModal.gallery-modal{display:none;position:fixed!important;inset:0!important;width:100%!important;height:100%!important;z-index:2147483000!important;background:rgba(2,6,23,.94);align-items:center;justify-content:center;animation:fadein .16s}
#imgModal.gallery-modal.active{display:flex}
#imgModal.gallery-modal .modal-img-wrap{position:absolute;inset:64px 64px 74px;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}
#imgModal.gallery-modal #modalImg{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:8px;box-shadow:0 12px 50px rgba(0,0,0,.55);background:#111827;cursor:grab;user-select:none;-webkit-user-drag:none;transform-origin:center;will-change:transform;transition:none!important;backface-visibility:hidden;-webkit-backface-visibility:hidden;contain:layout paint}
#imgModal.gallery-modal #modalImg.is-dragging{cursor:grabbing}
#imgModal.gallery-modal .close-btn{position:fixed!important;top:max(12px,env(safe-area-inset-top))!important;right:16px!important;width:auto!important;min-width:88px;height:48px!important;padding:0 16px!important;border:1px solid rgba(255,255,255,.7)!important;border-radius:12px!important;background:#2563eb!important;color:#fff!important;font-size:17px!important;line-height:1!important;font-weight:900;z-index:2147483647!important;cursor:pointer;box-shadow:0 6px 22px rgba(0,0,0,.35)}
#imgModal.gallery-modal .close-btn:hover{background:#1d4ed8!important}
.gallery-modal-nav{position:fixed;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:52px;height:58px;border:1px solid rgba(255,255,255,.3);border-radius:14px;background:rgba(15,23,42,.72);color:#fff;font-size:34px;z-index:5;cursor:pointer}
.gallery-modal-nav.prev{left:14px}.gallery-modal-nav.next{right:14px}.gallery-modal-nav[hidden]{display:none}
.gallery-modal-top{position:fixed;top:max(18px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:5;padding:7px 13px;border-radius:999px;background:rgba(15,23,42,.75);color:#fff;font-weight:800}
.gallery-toolbar{position:fixed;left:50%;bottom:max(14px,env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:center;gap:8px;z-index:5;padding:7px;border:1px solid rgba(255,255,255,.22);border-radius:14px;background:rgba(15,23,42,.78);backdrop-filter:blur(8px)}
.gallery-toolbar button{min-width:44px;height:44px;padding:0 12px;border:0;border-radius:10px;background:rgba(255,255,255,.13);color:#fff;font-size:20px;font-weight:900;cursor:pointer}
.gallery-toolbar button:hover{background:#2563eb}.gallery-toolbar .zoom-value{min-width:54px;color:#fff;text-align:center;font-size:14px;font-weight:800}
#imgModal.gallery-modal .zoom-tip{display:none!important}

@media (max-width:700px){
  .detail-wrap{margin-top:22px!important}
  .detail-wrap .detail-back-row{width:calc(100% - 24px);margin-bottom:12px}
  .detail-wrap .img-slider-wrap{width:100%}
  .detail-wrap .main-imgbox{aspect-ratio:4/3;border-radius:0}
  .detail-wrap .slide-arrow{width:44px;height:44px;font-size:26px!important}
  .detail-wrap .slide-arrow.left{left:8px!important}.detail-wrap .slide-arrow.right{right:8px!important}
  .gallery-expand{right:8px;bottom:8px;padding:0 11px}
  .gallery-counter{bottom:8px}
  .detail-wrap .thumbs-row{padding:8px 12px 10px}
  .detail-wrap .thumbs-row img{flex-basis:82px;width:82px!important;height:58px!important}
  #imgModal.gallery-modal .modal-img-wrap{inset:64px 0 76px}
  .gallery-modal-nav{top:auto;bottom:max(15px,env(safe-area-inset-bottom));width:46px;height:46px;border-radius:50%;font-size:28px}
  .gallery-modal-nav.prev{left:12px}.gallery-modal-nav.next{right:12px}
  .gallery-toolbar{bottom:max(14px,env(safe-area-inset-bottom))}
  #imgModal.gallery-modal .close-btn{top:max(10px,env(safe-area-inset-top))!important;right:10px!important;min-width:82px;height:46px!important;padding:0 13px!important}
}

@media (prefers-reduced-motion:reduce){
  #imgModal.gallery-modal{animation:none}.detail-wrap .card-link{transition:none}
}
