/* Ctrl+K 빠른 이동 팔레트 (기획 2번) — 클래스 접두어 qs- */

/* ── 사이드바 [빠른 이동] 버튼 ─────────────────────────────── */
.nav-search-wrap .qs-launch {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; margin: 6px 0 4px; padding: 6px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.2); border-radius: 9px;
  background: transparent; color: rgba(255, 255, 255, 0.72);
  font: inherit; font-size: 12px; line-height: 1.4; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-search-wrap .qs-launch:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.nav-search-wrap .qs-launch:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; color: #fff; }
.nav-search-wrap .qs-launch .qs-kbd {
  font: inherit; font-size: 10.5px; letter-spacing: .2px; padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 5px; color: rgba(255, 255, 255, 0.8);
}
@media (hover: none) { .nav-search-wrap .qs-launch .qs-kbd { display: none; } }

/* ── 팔레트 ────────────────────────────────────────────────── */
.qs-overlay {
  position: fixed; inset: 0; z-index: 1500;       /* 일반 팝업(1000)·사이드바(100) 위, 토스트(2000) 아래 */
  display: flex; align-items: flex-start; justify-content: center;
  padding: 11vh 16px 16px;
  background: rgba(8, 12, 30, 0.5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: qs-fade .14s ease;
}
.qs-overlay[hidden] { display: none; }
@keyframes qs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes qs-pop { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }

.qs-panel {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; max-width: 640px;
  max-height: min(72vh, 600px);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: qs-pop .16s cubic-bezier(.2, .8, .3, 1);
}

.qs-search {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 16px;
  border-bottom: 1px solid var(--border);
}
.qs-search-ico { font-size: 15px; opacity: .7; }
.qs-input {
  flex: 1; min-width: 0;
  padding: 14px 4px; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 16px;               /* 16px: iOS 확대 방지 */
  border-radius: 8px;
}
.qs-input::placeholder { color: var(--text-muted); }
.qs-input:focus { outline: none; }
.qs-input:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.qs-close {
  flex-shrink: 0; padding: 5px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text-muted);
  font: inherit; font-size: 12px; cursor: pointer;
}
.qs-close:hover { color: var(--text); background: var(--bg-hover); }
.qs-close:focus-visible, .qs-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.qs-list {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 8px 8px;
}

.qs-group-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 8px 4px;
  background: var(--surface);
  color: var(--text-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
}
.qs-count {
  min-width: 18px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted);
  font-size: 10.5px; font-weight: 600; line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.qs-clear {
  margin-left: auto; padding: 1px 8px; border: 0; border-radius: 6px; background: transparent;
  color: var(--text-muted); font: inherit; font-size: 11.5px; font-weight: 500; cursor: pointer;
}
.qs-clear:hover { color: var(--text); background: var(--bg-hover); }

.qs-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer; user-select: none;
}
.qs-opt.is-active { background: var(--rose-bg); box-shadow: inset 3px 0 0 var(--accent); }
.qs-ico { flex-shrink: 0; width: 24px; text-align: center; font-size: 17px; line-height: 1; }
.qs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.qs-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--text); }
.qs-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-muted); }
.qs-extra {
  flex-shrink: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: var(--text-muted); text-align: right;
}
.qs-extra.qs-price {
  font-size: 14px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -.1px;
}
.qs-mark {
  background: rgba(var(--accent-rgb, 199, 104, 126), .24); color: inherit;
  border-radius: 3px; padding: 0 1px;
}

.qs-note { padding: 10px 12px; font-size: 12.5px; color: var(--text-muted); }
.qs-note.qs-err { color: var(--red); }
.qs-empty { padding: 30px 16px 26px; text-align: center; color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }
.qs-empty-ico { font-size: 26px; margin-bottom: 6px; opacity: .85; }
.qs-empty p { margin: 0; }
.qs-empty .qs-empty-sub { margin-top: 2px; font-size: 12px; opacity: .85; }

.qs-foot {
  display: flex; gap: 16px; padding: 8px 16px;
  border-top: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-muted); font-size: 11.5px;
}
.qs-foot kbd, .qs-kbd-inline {
  display: inline-block; min-width: 18px; margin-right: 3px; padding: 0 5px;
  border: 1px solid var(--border); border-radius: 5px; background: var(--surface);
  font: inherit; font-size: 11px; line-height: 17px; text-align: center; color: var(--text-muted);
}
@media (hover: none) { .qs-foot { display: none; } }

/* 스크린리더 전용 안내문 */
.qs-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── 이동한 뒤 찾은 항목 강조 ────────────────────────────────── */
.qs-flash {
  outline: 2px solid var(--accent); outline-offset: -2px;
  animation: qs-flash 2.6s ease-out;
}
@keyframes qs-flash {
  0%, 65% { background-color: rgba(var(--accent-rgb, 199, 104, 126), .2); outline-color: var(--accent); }
  100%    { background-color: transparent; outline-color: transparent; }
}
input.qs-flash { border-radius: 6px; }

/* ── 휴대폰: 화면 폭 전체 시트 ───────────────────────────────── */
@media (max-width: 600px) {
  .qs-overlay { padding: 0; }
  .qs-panel {
    max-width: none; max-height: 88vh; max-height: 88dvh;
    border-radius: 0 0 16px 16px; border-width: 0 0 1px;
  }
  .qs-opt { padding: 10px; }
  .qs-extra { max-width: 46%; }
}

@media (prefers-reduced-motion: reduce) {
  .qs-overlay, .qs-panel { animation: none; }
  .qs-flash { animation: none; background-color: rgba(var(--accent-rgb, 199, 104, 126), .16); }
}

/* 메뉴 결과: 사이드바와 같은 선 아이콘 (img/icons.svg) */
.qs-ico .qs-nav-ico { width: 18px; height: 18px; color: var(--text-muted); display: block; }
.qs-opt.is-active .qs-ico .qs-nav-ico { color: var(--accent); }
