@charset "utf-8";

/* B6 — 모바일 하단 고정 바 + 바텀시트 (980px 이하)
   980px 이하에서 우측 패널(.item-detail__aside)이 시트로 전환되는 규칙은 이 파일이 소유한다.
   앱 세이프존: Bottom2(구형 iOS) → Bottom1(최신) 이중 선언 필수.
   정본 규격: .claude/skills/style/item-detail-page.md */

.item-book-bar { display: none; }
.item-book-sheet__handle { display: none; }
.item-book-sheet__backdrop { display: none; }

/* 레거시 item.css 가 ≤1024 에서 우측 컬럼(.css-qdh81c)을 감춘다. 하단 바·백드롭·시트(#side-bar)가
   모두 그 컬럼 안에 있어 그대로 두면 모바일에서 예약 UI 가 통째로 사라진다. 리뉴얼에서만 되살린다. */
.item-detail .css-qdh81c { display: block; }

@media (max-width: 980px) {
    /* 하단 고정 바 높이만큼 본문 여백 확보 */
    .item-detail { padding-bottom: 86px; }

    /* 되살린 컬럼이 본문 옆 자리를 차지하지 않게 한다 (인라인 margin-left 를 덮어씀) */
    .item-detail .css-qdh81c { width: 0; margin-left: 0 !important; }

    /* ===== 우측 패널 → 바텀시트 =====
       전면 CBase 단계는 .item-detail__aside, 레거시 삽입 단계는 #side-bar 가 스티키 컬럼이다 */
    .item-detail__aside,
    .item-detail #side-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 120;
        max-height: 86vh;
        margin: 0;
        padding: 0 8px 18px;
        padding-bottom: calc(var(--safeAreaBottom2, 0px) + 18px);
        padding-bottom: calc(var(--safeAreaBottom1, 0px) + 18px);
        overflow-y: auto;
        border-radius: 18px 18px 0 0;
        background: #fff;
        box-shadow: 0 -6px 24px rgba(20, 30, 55, .2);
        transform: translateY(110%);
        transition: transform .28s ease;
    }

    .item-detail--sheet-open .item-detail__aside,
    .item-detail--sheet-open #side-bar { transform: translateY(0); }

    .item-detail__aside .item-book-panel,
    .item-detail #side-bar .item-book-panel {
        border: 0;
        box-shadow: none;
    }

    /* 시트로 올라온 상태에서는 사이드바 하위 배너·관리자 링크를 감춘다 */
    .item-detail #side-bar .css-r8ib8s,
    .item-detail #side-bar .item-side-banners,
    .item-detail #side-bar .item-extra-banner,
    .item-detail #side-bar #hotel-map-banner { display: none; }

    /* 시트 핸들 — 패널 상단에 JS 가 삽입 */
    .item-book-sheet__handle {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px 0 8px;
    }

    .item-book-sheet__bar {
        width: 42px;
        height: 4px;
        border-radius: 2px;
        background: #d4d8df;
    }

    .item-book-sheet__close {
        position: absolute;
        right: 8px;
        top: 6px;
        border: 0;
        background: none;
        color: #888;
        font-size: 20px;
        cursor: pointer;
    }

    /* ===== 백드롭 ===== */
    .item-book-sheet__backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 115;
        background: rgba(20, 30, 55, .45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s;
    }

    .item-detail--sheet-open .item-book-sheet__backdrop {
        opacity: 1;
        visibility: visible;
    }

    /* ===== 하단 고정 바 ===== */
    .item-book-bar {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        padding: 12px 16px;
        padding-bottom: calc(var(--safeAreaBottom2, 0px) + 12px);
        padding-bottom: calc(var(--safeAreaBottom1, 0px) + 12px);
        border-top: 1px solid var(--tp-line);
        background: #fff;
        box-shadow: 0 -4px 16px rgba(20, 30, 55, .08);
    }

    .item-book-bar__inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    /* 공유·찜 — 레거시 하단 바 자리로 되돌렸다(2026-11-02). 시트 머리글 아이콘도 그대로 둔다(사용자 결정) */
    .item-book-bar__icons {
        display: flex;
        flex-shrink: 0;
        gap: 6px;
    }

    .item-book-bar__icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--tp-line);
        border-radius: 50%;
        background: #fff;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .item-book-bar__icon:active { background: var(--tp-bg); }
    .item-book-bar__icon img { display: block; }

    /* 찜 — 레거시 핸들러가 button 에 .on 을 토글한다. 하트는 예약 패널(B5)과 같은 글자 아이콘 */
    .item-book-bar__icon.itemGreat button {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 50%;
        background: none;
        color: var(--tp-gray);
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
    }

    .item-book-bar__icon.itemGreat button::before { content: '♡'; }
    .item-book-bar__icon.itemGreat button.on { color: var(--tp-sun); }
    .item-book-bar__icon.itemGreat button.on::before { content: '♥'; }

    .item-book-bar__icon:focus-visible,
    .item-book-bar__icon.itemGreat button:focus-visible { outline: 2px solid var(--tp-blue); outline-offset: 2px; }

    /* 왼쪽 요약 = 누르면 선택내역 시트가 열리는 칩(2026-10-06 QA). 글자만 있으면 탭 영역으로 보이지 않아
       테두리 면 + 위 셰브론 + 선택 개수 배지로 바텀시트 관례를 따른다. 높이는 CTA(48px)와 맞춘다. */
    .item-book-bar__total {
        position: relative;
        display: flex;
        flex: 1 1 0;
        min-width: 0;
        flex-direction: column;
        justify-content: center;
        min-height: 48px;
        padding: 5px 38px 5px 12px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .item-book-bar__total--filled {
        
    }

    .item-book-bar__total:active { filter: brightness(.96); }
    .item-book-bar__total:focus-visible { outline: 2px solid var(--tp-blue); outline-offset: 2px; }

    .item-book-bar__lbl-row {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
    }

    .item-book-bar__lbl {
        display: block;
        min-width: 0;
        color: var(--tp-gray);
        font-size: 12px;
        line-height: 1.4;
    }

    .item-book-bar__total--filled .item-book-bar__lbl { color: var(--tp-text); font-weight: 400; }

    /* 고른 항목 수 */
    .item-book-bar__count {
        flex-shrink: 0;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 50%;
        background: var(--tp-blue);
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        line-height: 18px;
        text-align: center;
    }

    .item-book-bar__count[hidden] { display: none; }

    .item-book-bar__amt {
        display: block;
        overflow: hidden;
        font-size: 18px;
        font-weight: 700;
        line-height: 1.3;
        white-space: nowrap;
        text-overflow: ellipsis;
        color: var(--tp-blue);
    }

    /* 위 셰브론 — 원 안의 꺾쇠. 시트가 열리면 아래로 뒤집혀 닫힘을 알린다 */
    .item-book-bar__chev {
        position: absolute;
        top: 50%;
        right: 9px;
        width: 22px;
        height: 22px;
        margin-top: -11px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 0 0 1px var(--tp-line);
        transition: transform .2s ease;
    }

    .item-book-bar__chev::before {
        content: "";
        position: absolute;
        top: 9px;
        left: 7px;
        width: 6px;
        height: 6px;
        border-top: 2px solid var(--tp-blue);
        border-left: 2px solid var(--tp-blue);
        transform: rotate(45deg);
    }

    .item-detail--sheet-open .item-book-bar__chev { transform: rotate(180deg); }

    /* 처음 담는 순간 한 번만 칩을 살짝 들어 올린다(detail.js renderBar) */
    .item-book-bar__total--nudge { animation: item-book-bar-nudge .9s ease-in-out 1; }

    @keyframes item-book-bar-nudge {
        0%, 50%, 100% { transform: translateY(0); }
        25%, 75% { transform: translateY(-4px); }
    }

    @media (prefers-reduced-motion: reduce) {
        .item-book-bar__total--nudge { animation: none; }
        .item-book-bar__chev { transition: none; }
    }

    /* 공유·찜이 왼쪽에 들어와 CTA 는 글자 폭만 쓴다 — 남는 폭은 선택내역 금액에 준다 */
    .item-book-bar__cta {
        flex: 0 0 auto;
        min-height: 48px;
        padding: 15px 18px;
        white-space: nowrap;
        border: 0;
        border-radius: 8px;
        background: var(--tp-blue);
        color: #fff;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
    }

    .item-book-bar__cta:disabled { background: var(--tp-disabled); cursor: not-allowed; }
    .item-book-bar__cta:active:not(:disabled) { background: var(--tp-blue-dark); }

    /* 모바일 공용 푸터의 레거시 CTA는 B6와 중복된다. 한줄 이벤트만 새 고정 바 바로 위에 둔다. */
    .tapInfo_Bottom.item-detail-footer-bar {
        display: none;
    }

    /* 이벤트 줄은 고정 바 바로 위에 붙인다. 바 높이는 카테고리·폰트마다 달라(일반 76px · 호텔 67px 실측) 고정값 72px 로는
       호텔은 5px 틈, 일반은 4px 겹침이 생겼다(2026-10-02 QA) — detail.js initFloatingButtons 가 실측한 --item-book-bar-h 를 쓴다.
       실측값에는 바 자신의 세이프존 패딩이 이미 들어 있다. 실측 전(JS 미실행) 폴백만 세이프존 이중 선언으로 둔다. */
    .tapInfo_Bottom.item-detail-footer-bar--has-event {
        display: block;
        bottom: var(--item-book-bar-h, calc(var(--safeAreaBottom2, 0px) + 72px));
        bottom: var(--item-book-bar-h, calc(var(--safeAreaBottom1, 0px) + 72px));
        height: 50px !important;
        padding-bottom: 0;
    }

    .tapInfo_Bottom.item-detail-footer-bar .inBox {
        display: none;
    }

    /* 공용 푸터의 우측 하단 버튼(카카오톡·최상단)을 고정 바(76px)·이벤트 줄(72px 위 50px) 위로 올린다.
       푸터 스크립트(m_/include/footer_basic.php checkVisibleMain)가 "10px + 레거시 하단 바 높이"를 인라인 bottom 으로
       스크롤마다 박는다 — 레거시 바는 바닥에 있어 맞았지만 리뉴얼에서는 버튼이 두 바 뒤에 깔렸다(2026-10-02 QA).
       인라인을 이겨야 하므로 !important. body 상태 클래스는 detail.js initFloatingButtons 가 붙인다. */
    body.item-detail--has-bar div.footer_scroll_event {
        bottom: calc(var(--item-book-bar-h, calc(var(--safeAreaBottom2, 0px) + 76px)) + 10px) !important;
        bottom: calc(var(--item-book-bar-h, calc(var(--safeAreaBottom1, 0px) + 76px)) + 10px) !important;
    }

    body.item-detail--has-bar.item-detail--has-event div.footer_scroll_event {
        bottom: calc(var(--item-book-bar-h, calc(var(--safeAreaBottom2, 0px) + 72px)) + 60px) !important;
        bottom: calc(var(--item-book-bar-h, calc(var(--safeAreaBottom1, 0px) + 72px)) + 60px) !important;
    }
}

/* 공유·찜 두 칸이 들어와 360px 에서 CTA 가 `예약신청 3명` 으로 길어지면 칩 글자가 세로로 쪼개졌다.
   좁은 폰에서는 아이콘·CTA·칩 여백을 줄여 칩 금액 폭을 확보한다(호텔은 itemHotelDetail.css 가 따로 맞춘다). */
@media (max-width: 480px) {
    .item-book-bar__icons { gap: 4px; }
    .item-book-bar__icon { width: 38px; height: 38px; }
    .item-book-bar__total { padding: 5px 30px 5px 10px; }
    .item-book-bar__chev { right: 6px; }
    .item-book-bar__lbl { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .item-book-bar__amt { font-size: 16px; }
    .item-book-bar__cta { padding: 0 12px; font-size: 15px; }
}
