/* 고정 퀵메뉴 — 고객 요청 「화면을 내려도 계속 떠 있는 전화·예약 문의」.
   폭 1280px·높이 600px 이상 = 오른쪽 세로 4칸 / 그 밖 = 화면 아래 띠 4칸(11/23 고객 「모바일 추가」 요청으로 2칸→4칸). 높이 600 미만은 막대 아래끝이 맨위 버튼에 붙음(실측). 오른쪽 세로 막대는 1280 미만에서 지도 확대 단추·본문 끝을 가려서(실측) 아래 띠로 바꾼다.
   층위: 모달 덮개(99~101)·공지 팝업(1001)보다 아래 */
.yj-quick, .yj-quick-spacer { display: none; }

@media screen and (min-width: 1280px) and (min-height: 600px) {
    .yj-quick {
        display: block;
        position: fixed;
        top: 50%;
        right: 0;
        z-index: 98;
        width: 100px;
        transform: translateY(-50%);
        background: #fff;
        border-radius: 12px 0 0 12px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
        overflow: hidden;
    }
    .yj-quick ul { margin: 0; padding: 0; list-style: none; }
    .yj-quick li + li { border-top: 1px solid #e4e4e4; }
    .yj-quick a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 80px;
        padding: 12px 4px;
        box-sizing: border-box;
        color: #222;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.3;
        text-align: center;
        text-decoration: none;
        word-break: keep-all;
    }
    .yj-quick svg { width: 26px; height: 26px; flex: 0 0 auto; color: #4e7009; }
    /* 주 전환은 전화 — 흰 글자 대비 확보 위해 짙은 녹색(#799f2a 는 대비 3:1 남짓) */
    .yj-quick .yj-quick-tel a { min-height: 112px; background: #4e7009; color: #fff; }
    .yj-quick .yj-quick-tel svg { color: #fff; }
    .yj-quick-txt { display: flex; flex-direction: column; align-items: center; gap: 6px; }
    .yj-quick-num { display: block; font-size: 15px; letter-spacing: -.02em; }
    .yj-quick a:hover { background: #f3f7ea; }
    .yj-quick .yj-quick-tel a:hover { background: #3f5c07; }
    .yj-quick a:focus-visible { outline: 3px solid #e0d94a; outline-offset: -3px; }
    .yj-quick a[aria-current="page"] { color: #4e7009; text-decoration: underline; text-underline-offset: 4px; }
    /* 오시는길 지도는 화면 끝까지 차서 오른쪽 확대·축소 단추가 퀵바 밑에 깔림(실측) — 퀵바 폭만큼 비움 */
    .map .wayto .kakao_map { padding-right: 100px; box-sizing: border-box; }
}

/* 아래 띠: 오른쪽 막대 조건(폭 1280↑·높이 600↑)이 아닌 모든 화면 — 두 조건 사이에 아무것도 안 뜨는 빈틈이 없게 정확히 반대로 건다.
   (옛 사파리도 읽는 「not all and」 문법. 인쇄는 맨 아래 규칙이 숨김) 높이 64px(낮은 가로 화면 52px) + 아이폰 홈 막대 자리(safe-area) */
@media not all and (min-width: 1280px) and (min-height: 600px) {
    :root { --yjq-h: 64px; }
    .yj-quick {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 98;
        background: #363e40;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, .18);
    }
    .yj-quick ul { display: flex; margin: 0; padding: 0; list-style: none; }
    /* 칸마다 줄 수가 달라도 링크(초록 배경·누르는 자리)가 칸 끝까지 차게 */
    .yj-quick li { display: flex; flex: 1 1 0; min-width: 0; }
    .yj-quick li > a { flex: 1 1 auto; min-width: 0; }
    .yj-quick li + li { border-left: 1px solid rgba(255, 255, 255, .14); }
    .yj-quick .yj-quick-tel { flex-grow: 1.5; }
    .yj-quick a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: var(--yjq-h);
        padding: 4px 8px;
        box-sizing: border-box;
        color: #fff;
        font-size: 17px;
        font-weight: 700;
        line-height: 1.2;
        text-decoration: none;
        text-align: center;
        /* 휴대폰 글자 크기를 키워 칸을 넘으면 「전화/문의」처럼 <wbr> 자리에서 칸 안 줄바꿈하고 띠가 높아진다(그래도 넘치면 아무 데서나) */
        word-break: keep-all;
        overflow-wrap: anywhere;
    }
    .yj-quick .yj-quick-tel a { background: #4e7009; }
    .yj-quick svg { width: 24px; height: 24px; flex: 0 0 auto; }
    .yj-quick-txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; text-align: left; }
    .yj-quick-txt > span:first-child { font-size: 13px; font-weight: 500; opacity: .9; }
    .yj-quick-num { font-size: 18px; letter-spacing: -.01em; }
    .yj-quick a:focus-visible { outline: 3px solid #e0d94a; outline-offset: -3px; }
    .yj-quick a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
    /* 아래 셋은 띠의 실제 높이(--yjq-real: footer.php 가 ul 을 재서 넣음, safe-area 제외)를 쓴다 — 글자를 키워 띠가 높아져도 꼬리말 가림·맨위 버튼 겹침이 없게.
       --yjq-h 는 칸의 최소 높이로만 쓰고 측정값을 되먹이지 않는다(한번 커지면 줄지 않는 고착 방지). 재지 못하는 옛 브라우저는 --yjq-h */
    /* body 가 세로 flex 라 줄어들지 않게 고정(0px 로 눌려 꼬리말 저작권 줄이 띠에 가렸음, 실측) */
    .yj-quick-spacer { display: block; flex: 0 0 auto; height: calc(var(--yjq-real, var(--yjq-h)) + env(safe-area-inset-bottom, 0px)); }
    /* body 가 스크롤 영역 — 키보드로 옮겨 간 초점이 띠 밑에 숨지 않게 */
    body { scroll-padding-bottom: calc(var(--yjq-real, var(--yjq-h)) + env(safe-area-inset-bottom, 0px)); }
    /* 맨위 버튼(z999)을 띠 위로 — :has 없는 옛 브라우저에서도 되게 형제 선택자로(퀵메뉴가 맨위 버튼 앞에 있음) */
    .yj-quick ~ .area_btn_top .btn_top { bottom: calc(var(--yjq-real, var(--yjq-h)) + 12px + env(safe-area-inset-bottom, 0px)); }
    /* 글 입력 중(휴대폰 키보드가 올라온 상태)에는 띠가 입력칸·「작성완료」를 가리므로 잠시 숨김 — 자리는 그대로 */
    .yj-typing .yj-quick { display: none; }
    /* 공지 팝업이 떠 있는 동안은 띠를 숨김(:has 없는 브라우저는 팝업이 띠 위에 그려질 뿐) */
    body:has(#yjPopupLayer:not([hidden])) .yj-quick { display: none; }
}
/* 세로 휴대폰 폭(600 미만): 4칸이면 한 칸 80~100px 이라 아이콘 옆 글자가 안 들어감 — 아이콘 위·글자 아래로 쌓고 전화번호 숫자는 뺀다(누르면 바로 걸림).
   600~767(눕힌 휴대폰)은 칸이 넓어 위의 가로 배치·번호 표시 그대로. 글자 확대 시 줄바꿈·높이 증가는 위 공통 규칙 */
@media not all and (min-width: 600px) {
    .yj-quick .yj-quick-tel { flex-grow: 1; }
    .yj-quick a { flex-direction: column; gap: 4px; padding: 4px 2px; font-size: 14px; }
    .yj-quick svg { width: 22px; height: 22px; }
    .yj-quick-txt { align-items: center; text-align: center; }
    .yj-quick-txt > span:first-child { font-size: inherit; font-weight: inherit; opacity: 1; }
    .yj-quick-num { display: none; }
}
@media screen and (max-height: 450px) {
    :root { --yjq-h: 52px; }
}

@media print { .yj-quick, .yj-quick-spacer { display: none !important; } }
