/* ══════════════════════════════════════════════════════
 *  상단 메뉴형 틀 (B안) — 헤더 · 2단 메뉴 · 사용자 메뉴 · 푸터 · 모바일 서랍 · 하단 탭 (R4, 2026-11-09)
 *  /css/zones/top-shell.css   — inc/layout/shell-top.php 짝
 *  출처: 시안 v1 top.css · style.css(드로어) · app.css(하단 탭). 존이 달라도 같은 틀을 쓴다.
 * ══════════════════════════════════════════════════════ */
body.ui-v1.shell-top { background: var(--warm); }
.shell-top .page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 72px; min-height: calc(100vh - 70px - 120px); }

/* ── 상단 헤더 ── */
.th { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--ink-10); }
.th-in { max-width: 1240px; margin: 0 auto; height: 70px; display: flex; align-items: center; gap: 26px; padding: 0 32px; }
.th .logo > span:last-child { display: flex; flex-direction: column; gap: 2px; line-height: 1.05; }
.th-nav { display: flex; gap: 2px; }
.th-nav a { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: var(--r-full); font-size: 15px; font-weight: 600; color: var(--ink-70); white-space: nowrap; }
.th-nav a:hover { color: var(--ink); background: var(--warm); }
.th-nav a[aria-current] { color: var(--accent-dk); background: var(--accent-lt); }
.th-nav .nbadge { height: 18px; min-width: 18px; padding: 0 5px; font-size: 10.5px; margin-left: 0; }
.th-act { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.th-public { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--ink-15); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink-70); white-space: nowrap; }
.th-public:hover { color: var(--ink); border-color: var(--ink-30); }
/* 영업장 전환 (업체 조직 A, 2026-11-19) — 영업장이 2곳 이상일 때만 */
.th-place { height: 40px; max-width: 220px; padding: 0 30px 0 14px; border-radius: var(--r-full); border: 1px solid var(--ink-15); background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); text-overflow: ellipsis; }
.th-place:hover { border-color: var(--ink-30); }
.th .burger { display: none; }

/* 이름 칩 + 사용자 메뉴 */
.me { position: relative; }
.me-chip { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 4px; border-radius: var(--r-full); border: 1px solid var(--ink-15); background: #fff; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.me-chip .av { width: 34px; height: 34px; }
.me-chip small { font-weight: 500; color: var(--ink-60); font-size: 12px; margin-left: 2px; }
.me-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; }
.me-menu[hidden] { display: none; }
.me-menu a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink-70); }
.me-menu a:hover { background: var(--warm); color: var(--ink); }
.me-menu a[aria-current] { background: var(--accent-lt); color: var(--accent-dk); }
.me-menu .nbadge { margin-left: auto; }
.me-menu hr { border: 0; border-top: 1px solid var(--ink-10); margin: 6px 4px; }

/* ── 2단 메뉴 (현재 묶음의 하위 화면) ── */
.subnav { max-width: 1240px; margin: 0 auto; padding: 20px 32px 0; display: flex; gap: 8px; align-items: center; }
.subnav a { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: var(--r-full); background: #fff; border: 1px solid var(--ink-15); font-size: 14px; font-weight: 600; color: var(--ink-70); white-space: nowrap; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.subnav .nbadge { height: 18px; min-width: 18px; padding: 0 5px; font-size: 10.5px; margin-left: 0; }

/* ── 하단 푸터 ── */
.tfoot { margin-top: 24px; background: #fff; border-top: 1px solid var(--ink-10); }
.tfoot-in { max-width: 1240px; margin: 0 auto; padding: 26px 32px 30px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; font-size: 13px; color: var(--ink-60); }
.tfoot-in nav { display: flex; gap: 18px; flex-wrap: wrap; }
.tfoot-in nav a:hover { color: var(--ink); }
.tfoot-in .copy { margin-left: auto; }
.tfoot-brand { color: var(--ink); }

/* ── 모바일 서랍 ── */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .4); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 70; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); background: var(--warm); z-index: 80; transform: translateX(100%); visibility: hidden;
  transition: transform .28s ease, visibility 0s .28s; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overscroll-behavior: contain; }
.drawer-open .drawer { transform: none; visibility: visible; transition: transform .28s ease; }
.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 4px; }
.drawer .d-label { font-size: 12px; font-weight: 700; color: var(--ink-60); margin: 14px 12px 4px; }
.drawer a.d-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: var(--r-sm); font-weight: 600; font-size: 15px; }
.drawer a.d-link:hover { background: var(--paper); }
.drawer a.d-link[aria-current] { background: var(--accent-lt); color: var(--accent-dk); }
html.drawer-open { overflow: hidden; }

/* ── 하단 탭 (모바일) ── */
.tab5 { display: none; }

/* ── 반응형 ── */
@media (max-width: 1180px) {
  .th-in { gap: 16px; padding: 0 24px; }
  .th-nav a { padding: 0 11px; font-size: 14.5px; }
  .th-public span, .me-chip small { display: none; }
}
@media (max-width: 960px) {
  .th-nav, .th-public, .me { display: none; }
  .th .burger { display: inline-grid; }
}
@media (max-width: 768px) {
  .th-in { height: 58px; padding: 0 16px; }
  .th-place { max-width: 140px; height: 36px; font-size: 13px; padding: 0 26px 0 10px; }
  .subnav { padding: 14px 16px 0; overflow-x: auto; scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .shell-top .page { padding: 18px 16px calc(100px + env(safe-area-inset-bottom)); }
  .tfoot { display: none; }
  .tab5 { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px); border-top: 1px solid var(--ink-15);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tab5 a, .tab5 button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center;
    font-size: 11.5px; font-weight: 600; color: var(--ink-60); border: 0; background: none; position: relative; }
  .tab5 [aria-current] { color: var(--accent); }
  .tab5 .nbadge { position: absolute; top: 2px; left: 55%; height: 17px; min-width: 17px; font-size: 10px; padding: 0 5px; margin: 0; }
}

/* ── 왼쪽 메뉴 (R8 회원 화면 설정 · body.menu-side) — PC 에서만. 휴대폰은 위와 같은 머리말 + 서랍 + 하단 탭 ──
   같은 메뉴 정의를 펼친 것. 선택 표시는 연한 강조 배경(왼쪽 색띠 쓰지 않음) */
.sn { display: none; }
@media (min-width: 961px) {
  body.menu-side .th-nav, body.menu-side .subnav { display: none; }
  body.menu-side .th-in { max-width: none; }
  body.menu-side .sn { display: flex; flex-direction: column; gap: 2px; position: fixed; top: 70px; bottom: 0; left: 0; width: 236px; z-index: 40;
    padding: 18px 12px 28px; overflow-y: auto; overscroll-behavior: contain; background: #fff; border-right: 1px solid var(--ink-10); }
  /* 본문은 메뉴를 뺀 나머지 폭의 가운데 (넓은 화면) — 좁으면 메뉴 바로 옆 */
  body.menu-side .page { margin-left: max(236px, calc((100% - 1240px) / 2 + 118px)); margin-right: auto; }
  body.menu-side .tfoot { margin-left: 236px; }
  .sn-label { font-size: 12px; font-weight: 700; color: var(--ink-60); margin: 16px 12px 4px; }
  .sn-label:first-child { margin-top: 2px; }
  .sn-link { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 12px; font-size: 14.5px; font-weight: 600; color: var(--ink-70); }
  .sn-link svg { width: 18px; height: 18px; flex: none; }
  .sn-link:hover { background: var(--warm); color: var(--ink); }
  .sn-link[aria-current] { background: var(--accent-lt); color: var(--accent-dk); }
  .sn .nbadge { margin-left: auto; height: 18px; min-width: 18px; padding: 0 5px; font-size: 10.5px; }
}

/* 사업자 정보 (전자상거래법 제10조, 2026-11-13) — businessInfoHtml(). 바닥글 맨 아래 한 줄(좁으면 여러 줄) */
.tfoot-in .biz-info { flex-basis: 100%; margin: 0; font-size: 12px; line-height: 1.7; color: var(--ink-60, #5c5650); word-break: keep-all; }
.tfoot-in .biz-info .biz-check { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tfoot-in .biz-info .biz-check:hover { color: var(--ink, #1A1410); }

/* 권한 없는 화면 안내 (업체 조직 B, 2026-11-19) */
.org-denied { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--gold-lt, #FEF3C7); color: var(--ink); font-size: 14px; line-height: 1.5; }
