/* ============================================================
   행동기반 시간제 특별쿠폰 · UI            2026-08-19 신규
   ------------------------------------------------------------
   · 헤더 «안» 을 건드리지 않는다. 헤더 아래에 뜨는 별도 fixed 레이어다(§22).
     헤더 마크업/레이아웃에 손대면 전 페이지 CLS 예약(fitHead)이 깨진다.
   · z-index 지도
       고정 헤더            1000
       상품 갤러리 버튼묶음 8600
   ▶ 카운터 배지          8650   ← 갤러리 버튼 위, 공용팝업 아래
       공용 팝업(.v2pp)     8700
       하단 네비            9000
       헤더 검색 딤        2147481000
   ▶ 쿠폰 팝업        2147481500   ← 무엇보다 위(발급 순간 1회)
   · 브레이크포인트는 사이트 기존 경계와 같다: 모바일 ~600 / 태블릿 601~1023 / PC 1024~
   ============================================================ */

/* ---------- 카운터 배지 (캡슐형) ---------- */
.v2bc-badge{
    position: fixed;
    top: var(--v2bc-top, 92px);
    right: 10px;
    z-index: 8650;

    display: none;                 /* JS 가 상태를 확인한 뒤에만 보인다 */
    align-items: center;
    gap: 6px;

    max-width: calc(100vw - 20px);
    padding: 7px 12px;
    box-sizing: border-box;

    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #1f1f22 0%, #3a2f18 55%, #7a5c1d 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,.28);

    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.2px;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    animation: v2bcPop .28s cubic-bezier(.2,.9,.3,1.2);
}
.v2bc-badge.is-on{ display: inline-flex; }
.v2bc-badge:focus-visible{ outline: 2px solid #ffd479; outline-offset: 2px; }

@keyframes v2bcPop{ from{ opacity:0; transform: translateY(-6px) scale(.92);} to{ opacity:1; transform:none; } }

.v2bc-badge__amt{ color:#ffd479; }
.v2bc-badge__sep{ opacity:.45; font-weight:600; }
.v2bc-badge__time{ font-variant-numeric: tabular-nums; font-feature-settings:"tnum"; }

/* 남은 시간 10분 미만 — 조용히 붉게. 깜빡임(애니메이션)은 쓰지 않는다(접근성). */
.v2bc-badge.is-urgent{ background: linear-gradient(135deg,#3a1414 0%,#7a1f1f 100%); }
.v2bc-badge.is-urgent .v2bc-badge__amt{ color:#ffb3b3; }

/* PC — 우측 여백에 조금 더 크게, 본문을 가리지 않는 위치 (§23) */
@media (min-width:1024px){
    .v2bc-badge{ right: 18px; padding: 9px 15px; font-size: 13px; }
}

/* ---------- 최초 발급 팝업 ---------- */
.v2bc-modal{
    position: fixed;
    inset: 0;
    z-index: 2147481500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12,12,14,.62);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.v2bc-modal.is-on{ display: flex; }

.v2bc-card{
    position: relative;
    width: 100%;
    max-width: 340px;
    padding: 26px 22px 20px;
    box-sizing: border-box;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(0,0,0,.35);
    text-align: center;
    animation: v2bcCard .3s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes v2bcCard{ from{ opacity:0; transform: translateY(14px) scale(.96);} to{ opacity:1; transform:none; } }

.v2bc-card__x{
    position: absolute; top: 8px; right: 8px;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: 0; background: transparent;
    font-size: 20px; line-height: 1; color: #9a9aa2; cursor: pointer;
}
.v2bc-card__title{ margin: 0 0 6px; font-size: 19px; font-weight: 900; color:#17171a; letter-spacing:-.4px; }
.v2bc-card__desc { margin: 0 0 16px; font-size: 13px; color:#6b6b74; line-height:1.55; }

.v2bc-card__amt{
    margin: 0 0 4px;
    font-size: 34px; font-weight: 900; letter-spacing: -1px;
    background: linear-gradient(135deg,#8a6a1e,#c9a24a);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color:#8a6a1e;
}
.v2bc-card__amt small{ font-size: 15px; font-weight: 800; }
.v2bc-card__valid{ margin: 0 0 14px; font-size: 12px; color:#8a8a93; }

.v2bc-card__clock{
    display: inline-block;
    margin: 0 0 18px; padding: 9px 18px;
    border-radius: 12px;
    background: #f4f4f6;
    font-size: 22px; font-weight: 900; color:#17171a;
    font-variant-numeric: tabular-nums; font-feature-settings:"tnum";
    letter-spacing: 1px;
}
.v2bc-card__min{ margin: -10px 0 14px; font-size: 11px; color:#a0a0a8; }

.v2bc-card__go{
    display: block; width: 100%;
    padding: 14px 16px;
    border: 0; border-radius: 13px;
    background: #17171a; color:#fff;
    font-size: 14px; font-weight: 800; letter-spacing:-.2px;
    cursor: pointer;
}
.v2bc-card__later{
    display: block; width: 100%;
    margin-top: 9px; padding: 6px;
    border: 0; background: transparent;
    font-size: 12px; color:#9a9aa2; cursor: pointer;
}

/* 아주 좁은 화면(430px 이하 포함)에서도 버튼/문구가 잘리지 않게 */
@media (max-width:360px){
    .v2bc-card{ padding: 22px 16px 16px; }
    .v2bc-card__amt{ font-size: 29px; }
    .v2bc-card__clock{ font-size: 19px; padding: 8px 14px; }
}

/* 헤더 검색이 열려 있는 동안에는 배지를 숨긴다(검색 UI 를 가리지 않도록) */
html.v2hd-searching .v2bc-badge{ display: none !important; }

@media (prefers-reduced-motion: reduce){
    .v2bc-badge, .v2bc-card{ animation: none; }
}

/* ============================================================
   비회원 가입유도 팝업 (2026-08-19 · 08-20 모바일 UX 개편)
   ------------------------------------------------------------
   회원용 «발급 축하» 팝업(.v2bc-modal)과 «별개 DOM» 이다.
   같은 노드를 재사용해 문구만 바꾸면, 한번 게스트용으로 덮어쓴 제목/본문이
   그대로 남아 회원 팝업이 엉뚱한 문구로 뜬다. 그래서 분리한다.

   ── 두 가지 형태 (JS 가 클래스로 고른다) ──────────────────────
     .v2bcg--sheet : 모바일/태블릿. 기존 하단 네비 «바로 위» 에서 올라오는 시트.
                     · 전체화면 암막 없음 → 뒤 상품을 계속 볼 수 있다
                     · 컨테이너가 화면을 덮지 않는다 → 뒤 페이지 스크롤/터치 그대로
                     · bottom 값은 CSS 에 박지 않는다. JS 가 실제 네비 rect 를 재서
                       --v2bcg-bottom 에 넣는다(네비 높이·safe-area 변화에 자동 추종).
     .v2bcg--modal : PC(1024~). 종전 중앙 모달 + 암막 유지.

   ── z-index 실측 근거 ────────────────────────────────────────
     상품 갤러리 버튼 8600 · 공용팝업 .v2pp 8700 · 하단 네비 9000
     ▶ 시트 9100  — 네비보다 위에 «보이되» 네비를 덮지 않는다(위에 얹힘)
     사이즈프로필 .bi-modal 30000 · 헤더 검색 딤 2147481000 (둘 다 시트보다 위)
     ▶ PC 모달 2147481500 — 종전과 동일
   ============================================================ */

/* ── 공통 컨테이너 ── */
.v2bcg{ display: none; }
.v2bcg.is-on{ display: block; }

/* ── 모바일/태블릿: 하단 네비 위 Bottom Sheet ────────────────── */
.v2bcg--sheet{
    position: fixed;
    left: 0; right: 0;
    bottom: var(--v2bcg-bottom, 0px);   /* JS 가 실제 네비 상단으로 채운다 */
    top: auto;
    z-index: 9100;
    background: none;                    /* ★ 전체화면 암막 없음 */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    pointer-events: none;                /* 컨테이너는 터치를 통과시킨다 */
}
.v2bcg--sheet .v2bcg__sheet{
    pointer-events: auto;                /* 시트 본체만 터치를 받는다 */
    position: relative;
    width: auto;
    max-width: 600px;                    /* 하단 네비와 같은 폭 기준 */
    margin: 0 auto;
    margin-left: max(14px, calc(50% - 300px + 14px));
    margin-right: max(14px, calc(50% - 300px + 14px));
    padding: 16px 16px 14px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 -6px 28px rgba(0,0,0,.20), 0 0 0 1px rgba(0,0,0,.05);
    text-align: center;
    animation: v2bcgUp .26s cubic-bezier(.22,.9,.3,1);
}
.v2bcg--sheet.is-closing .v2bcg__sheet{ animation: v2bcgDown .2s ease-in forwards; }

@keyframes v2bcgUp  { from{ transform: translateY(calc(100% + 24px)); opacity: .4; }
                      to  { transform: none; opacity: 1; } }
@keyframes v2bcgDown{ from{ transform: none; opacity: 1; }
                      to  { transform: translateY(calc(100% + 24px)); opacity: 0; } }

.v2bcg--sheet .v2bcg__grip{ display: none; }

/* ── PC: 중앙 모달(종전 유지) ────────────────────────────────── */
.v2bcg--modal{
    position: fixed;
    inset: 0;
    z-index: 2147481500;
    background: rgba(12,12,14,.62);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.v2bcg--modal.is-on{ display: flex; align-items: center; justify-content: center; padding: 20px; }
.v2bcg--modal .v2bcg__sheet{
    position: relative;
    width: 100%; max-width: 420px;
    padding: 24px 22px 20px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(0,0,0,.35);
    text-align: center;
    animation: v2bcgIn .28s cubic-bezier(.2,.9,.3,1.15);
}
@keyframes v2bcgIn{ from{ opacity:0; transform: translateY(14px) scale(.96);} to{ opacity:1; transform:none; } }
.v2bcg--modal .v2bcg__grip{ display: none; }

/* ── 내용 (형태 공통) ── */
.v2bcg__x{
    position: absolute; top: 6px; right: 6px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: 0; background: transparent;
    font-size: 20px; line-height: 1; color: #9a9aa2; cursor: pointer;
}
.v2bcg__title{ margin: 0 0 3px; font-size: 15.5px; font-weight: 900; color:#17171a; letter-spacing:-.4px; }
.v2bcg__desc { margin: 0 0 11px; font-size: 12px; color:#6b6b74; line-height:1.45; }

/* 쿠폰 카드 — 모바일에서는 «10,000원 / 신규가입 쿠폰» 만 압축해서 보여준다 */
.v2bcg__card{
    position: relative;
    margin: 0 auto 10px;
    max-width: 300px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1f1f22 0%, #3a2f18 58%, #7a5c1d 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
    overflow: hidden;
}
.v2bcg__card::before,
.v2bcg__card::after{
    content:''; position: absolute; top: 50%;
    width: 16px; height: 16px; margin-top: -8px;
    border-radius: 50%; background: #fff;
}
.v2bcg__card::before{ left: -8px; }
.v2bcg__card::after { right: -8px; }

.v2bcg__amt{
    display: block;
    font-size: 30px; font-weight: 900; letter-spacing: -1.2px; line-height: 1.1;
    color: #ffd479;
}
.v2bcg__amt small{ font-size: 14px; font-weight: 800; letter-spacing: -.4px; }
.v2bcg__kind{ display: block; margin-top: 2px; font-size: 11.5px; font-weight: 800; color:#fff; opacity:.92; }

/* 지급조건 문구 — 모바일 시트에서는 카드 밖 한 줄로 빼서 카드를 더 압축한다 */
.v2bcg__dash{ display: none; }
.v2bcg__notice{
    margin: 0 0 10px; font-size: 10.5px; line-height: 1.45;
    color: #8a8a93; font-weight: 600;
}
.v2bcg__item{ display: none; }              /* 시트에서는 생략 — 높이 절약 */

.v2bcg__go{
    display: block; width: 100%;
    min-height: 48px; padding: 13px 16px;
    border: 0; border-radius: 12px;
    background: #17171a; color:#fff;
    font-size: 14.5px; font-weight: 800; letter-spacing:-.2px;
    cursor: pointer;
}
.v2bcg__later{
    display: block; width: 100%;
    min-height: 36px; margin-top: 4px; padding: 6px;
    border: 0; background: transparent;
    font-size: 12px; color:#9a9aa2; cursor: pointer;
}

/* PC 모달에서는 카드/문구를 조금 키워 종전 인상을 유지 */
@media (min-width:1024px){
    .v2bcg--modal .v2bcg__title{ font-size: 19px; margin-bottom: 4px; }
    .v2bcg--modal .v2bcg__desc { font-size: 12.5px; margin-bottom: 14px; }
    .v2bcg--modal .v2bcg__card { padding: 18px 16px 16px; margin-bottom: 12px; }
    .v2bcg--modal .v2bcg__amt  { font-size: 42px; }
    .v2bcg--modal .v2bcg__notice{ font-size: 11px; margin-bottom: 14px; }
    .v2bcg--modal .v2bcg__go   { min-height: 50px; }
}

/* 아주 좁은 화면(375px 등) */
@media (max-width:380px){
    .v2bcg--sheet .v2bcg__sheet{ padding: 14px 13px 12px; margin-left: 12px; margin-right: 12px; }
    .v2bcg__amt{ font-size: 27px; }
    .v2bcg__title{ font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce){
    .v2bcg__sheet{ animation: none !important; }
}
