/* ==========================================================================
   GreenBacklink - 쇼핑몰형 우측 퀵바 (floating quick bar)
   PC: 화면 우측 세로 고정 / Mobile: 하단 가로 바
   ========================================================================== */
:root {
    --qb-green: #0f6e3f;
    --qb-green-dark: #0b5530;
    --qb-dark: #14201b;
}

#gbQuickBar {
    position: fixed;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    z-index: 9990;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid #e4ece8;
    border-radius: 18px;
    box-shadow: 0 12px 38px rgba(15, 110, 63, 0.16);
}

#gbQuickBar .qb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 64px;
    padding: 10px 4px;
    border: none;
    background: transparent;
    border-radius: 12px;
    color: var(--qb-dark);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .15s ease;
}
#gbQuickBar .qb-item i { font-size: 19px; color: var(--qb-green); transition: color .18s ease; }
#gbQuickBar .qb-item:hover { background: #e8f5ee; color: var(--qb-green-dark); transform: translateY(-2px); }
#gbQuickBar .qb-item:hover i { color: var(--qb-green-dark); }

/* 강조 항목(충전하기) */
#gbQuickBar .qb-item.qb-accent {
    background: var(--qb-green);
    color: #fff;
}
#gbQuickBar .qb-item.qb-accent i { color: #fff; }
#gbQuickBar .qb-item.qb-accent:hover { background: var(--qb-green-dark); color: #fff; }

/* 카카오 고객센터 */
#gbQuickBar .qb-item.qb-kakao i { color: #3c1e1e; }
#gbQuickBar .qb-item.qb-kakao { background: #fee500; color: #3c1e1e; }
#gbQuickBar .qb-item.qb-kakao:hover { background: #f5dc00; color: #3c1e1e; }
#gbQuickBar .qb-item.qb-kakao:hover i { color: #3c1e1e; }

/* 배지 (장바구니 수량) */
#gbQuickBar .qb-item { position: relative; }
#gbQuickBar .qb-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

/* 구분선 */
#gbQuickBar .qb-divider { height: 1px; margin: 2px 8px; background: #e4ece8; }

/* TOP 버튼 - 스크롤 전 숨김 */
#gbQuickBar .qb-top { display: none; }
#gbQuickBar.is-scrolled .qb-top { display: flex; }

/* 테마 기본 top 버튼 중복 제거 */
#top_btn { display: none !important; }

/* 테마 기본 우측 스크롤 인디케이터(lqd-scrl-indc)와 퀵바 우측 충돌 제거.
   둘 다 화면 우측·세로중앙에 고정되어 겹침 → 퀵바 TOP 버튼이 동일 기능을 대체하므로
   퀵바가 로드되는 페이지에서는 우측 스크롤 인디케이터를 숨긴다. (좌측 스틱바는 보존) */
.lqd-stickybar-wrap.lqd-stickybar-right { display: none !important; }

/* 회원 드롭다운(.gbl-id.gbl-open)이 열릴 때 퀵바 숨김.
   드롭다운(z-index 99999)이 헤더 stacking context에 갇혀 body 직속 퀵바(9990)보다 아래로
   깔려 우측에서 겹쳐 보이는 문제 방지 — 드롭다운이 닫히면 자동 복원. */
#gbQuickBar { transition: opacity .18s ease, visibility .18s ease; }
body:has(.gbl-id.gbl-open) #gbQuickBar { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---- 모바일: 하단 가로 바 ------------------------------------------- */
@media (max-width: 767px) {
    #gbQuickBar {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        transform: none;
        flex-direction: row;
        gap: 0;
        padding: 6px 4px;
        border: none;
        border-top: 1px solid #e4ece8;
        border-radius: 16px 16px 0 0;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 -6px 24px rgba(15, 110, 63, 0.12);
        justify-content: space-around;
    }
    #gbQuickBar .qb-item {
        flex: 1;
        width: auto;
        padding: 7px 2px;
        border-radius: 10px;
        font-size: 10.5px;
    }
    #gbQuickBar .qb-item i { font-size: 17px; }
    #gbQuickBar .qb-item.qb-accent,
    #gbQuickBar .qb-item.qb-kakao { background: transparent; color: var(--qb-dark); }
    #gbQuickBar .qb-item.qb-accent i { color: var(--qb-green); }
    #gbQuickBar .qb-item.qb-kakao i { color: #3c1e1e; }
    #gbQuickBar .qb-divider { display: none; }
    #gbQuickBar .qb-top { display: flex; }
    /* 하단바에 가린 콘텐츠 여백 확보 */
    body { padding-bottom: 64px; }
}
