/* =====================================================
   롯데월드몰 맛집 비교 — 커스텀 스타일 v2
   Design: Premium Editorial
   ===================================================== */

/* ── 폰트 & 기본 변수 ── */
:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --border: #E8E6E1;
  --text-primary: #1C1917;
  --text-secondary: #78716C;
  --text-muted: #A8A29E;
  --accent: #DC2626;
  --hero-bg: #1C1917;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --radius: 14px;
  --radius-sm: 8px;
}
.dark {
  --bg: #111110;
  --surface: #1C1C1B;
  --border: #2A2A28;
  --text-primary: #FAFAF9;
  --text-secondary: #C4C0BB;
  --text-muted: #78716C;
  --hero-bg: #0C0C0B;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
}

/* ── 스크롤바 ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── 가로 스크롤 숨김 ── */
.hide-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.hide-scroll::-webkit-scrollbar { display: none; }

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero {
  background: var(--hero-bg);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(220,38,38,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 40%);
  pointer-events: none;
}
.hero-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #FFFFFF;
}
.hero-subtitle {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.01em;
}
.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}
.hero-stat strong {
  color: #FFFFFF;
  font-weight: 700;
}

/* =====================================================
   STICKY 검색/필터 바
   ===================================================== */
.filter-bar {
  background: rgba(247, 246, 243, 0.92);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}
.dark .filter-bar {
  background: rgba(17, 17, 16, 0.92);
}
.filter-bar.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* 검색 인풋 */
.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input:focus {
  border-color: #1C1917;
  box-shadow: 0 0 0 3px rgba(28,25,23,0.06);
}
.dark .search-input:focus {
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
.search-input::placeholder { color: var(--text-muted); }

/* 카테고리 필터 필 */
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.cat-pill:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.cat-pill.active {
  border-color: transparent;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.cat-pill-all.active { background: var(--text-primary); }

/* 정렬/필터 셀렉트 */
.filter-select {
  padding: 7px 10px;
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 500;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A8A29E' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}
.filter-select:focus { border-color: var(--text-primary); }

/* 태그 필 */
.tag-pill {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tag-pill:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.tag-pill.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #FFFFFF;
}

/* =====================================================
   결과 헤더 + 가중치 패널
   ===================================================== */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.result-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}
.result-count span { color: var(--accent); }

/* 가중치 패널 */
.weight-panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.weight-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s ease;
}
.weight-row:last-child { border-bottom: none; }
.weight-row:hover { background: rgba(0,0,0,0.015); }
.dark .weight-row:hover { background: rgba(255,255,255,0.02); }
.weight-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 44px;
  flex-shrink: 0;
}
.weight-track {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.weight-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--text-primary);
  transition: width 0.2s ease;
}
.dark .weight-fill { background: rgba(255,255,255,0.7); }
.weight-pct {
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* 슬라이더 커스텀 */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  outline: none;
  background: var(--border);
  flex: 1;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2.5px solid var(--surface);
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dark input[type="range"]::-webkit-slider-thumb {
  background: #FAFAF9;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2.5px solid var(--surface);
  cursor: pointer;
}

/* =====================================================
   RESTAURANT CARDS
   ===================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 12px;
}
@media (min-width: 560px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }

.card-list-view { display: flex; flex-direction: column; gap: 8px; }

/* 카드 베이스 */
.r-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.15s ease;
  will-change: transform;
}
.r-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-md);
  border-color: rgba(0,0,0,0.12);
  z-index: 2;
}
.dark .r-card:hover { border-color: rgba(255,255,255,0.12); }
.r-card:active { transform: translateY(-2px) scale(0.99); }

/* 카드 - 이미지 영역 */
.card-img-area {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.r-card:hover .card-img { transform: scale(1.05); }

/* 이모지 fallback */
.card-emoji {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.r-card:hover .card-emoji { transform: scale(1.1) rotate(-3deg); }

/* 카드 - 카테고리 하단 띠 (이미지 아래) */
.card-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  width: 100%;
  transition: height 0.2s ease;
}
.r-card:hover .card-strip { height: 5px; }

/* 점수 서클 - 이미지 위에 오버레이 */
.score-badge {
  position: absolute;
  bottom: 10px;
  left: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  z-index: 2;
}
.r-card:hover .score-badge { transform: scale(1.08); }
.score-badge-num {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.score-badge-label {
  font-size: 0.5rem;
  font-weight: 600;
  opacity: 0.6;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* 카드 - 정보 섹션 */
.card-body { padding: 0 16px 16px; }
.card-rank {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}
.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 3px;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* 미니 평점 바 (가로 2개) */
.mini-ratings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 12px;
}
.mini-rating-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.mini-rating-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  width: 22px;
  flex-shrink: 0;
  font-weight: 500;
}
.mini-rating-bar {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.mini-rating-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.mini-rating-val {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 20px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* 카드 하단 (태그 + 미니차트) */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.card-tag {
  font-size: 0.6875rem;
  padding: 2px 7px;
  border-radius: 100px;
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.dark .card-tag { background: rgba(255,255,255,0.06); }

/* ── 비교 오버레이 ── */
.compare-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28,25,23,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
  border-radius: var(--radius);
}
.r-card.compare-mode:hover .compare-overlay { opacity: 1; }
.r-card.compare-selected .compare-overlay {
  opacity: 1;
  background: rgba(220,38,38,0.85);
}
.compare-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* 즐겨찾기 버튼 */
.fav-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  font-size: 1.1rem;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
}
.fav-btn:hover { transform: scale(1.3); }
.fav-btn.active { animation: heartPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* ── 리스트 뷰 카드 ── */
.r-card-list {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}
.r-card-list:hover {
  border-color: rgba(0,0,0,0.15);
  box-shadow: var(--shadow-md);
  transform: translateX(2px);
}
.dark .r-card-list:hover { border-color: rgba(255,255,255,0.15); }
.list-rank {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.list-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
}
.list-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.list-thumb-emoji {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.list-info { flex: 1; min-width: 0; }
.list-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.list-score { text-align: right; flex-shrink: 0; }
.list-score-num {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.list-score-sub { font-size: 0.6875rem; color: var(--text-muted); font-weight: 500; margin-top: 1px; }
.list-left-bar {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
}

/* =====================================================
   카드 입장 애니메이션
   ===================================================== */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.card-enter {
  animation: cardEnter 0.38s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

/* 필터 변경 시 카드 fade */
@keyframes cardRefresh {
  0% { opacity: 1; }
  30% { opacity: 0; transform: translateY(6px); }
  31% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}
.card-refreshing .r-card,
.card-refreshing .r-card-list {
  animation: cardRefresh 0.4s ease both;
}

/* =====================================================
   스켈레톤 로딩
   ===================================================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
.skeleton-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-backdrop {
  backdrop-filter: blur(6px) brightness(0.7);
  -webkit-backdrop-filter: blur(6px) brightness(0.7);
}
.modal-surface {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
}
@media (min-width: 640px) {
  .modal-surface { border-radius: var(--radius); }
}

/* 모달 헤더 */
.modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dark .modal-header { background: rgba(28,28,27,0.96); }
.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.modal-close:hover {
  background: var(--border);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* 디테일 섹션 구분 */
.detail-section {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.detail-section:last-child { border-bottom: none; }
.detail-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* 평점 바 (상세) */
.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.detail-rating-row:last-child { margin-bottom: 0; }
.detail-rating-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 40px;
  flex-shrink: 0;
}
.detail-rating-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.detail-rating-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.detail-rating-val {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* 메뉴 아이템 */
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.menu-item:last-child { border-bottom: none; }
.menu-name { font-size: 0.875rem; color: var(--text-primary); font-weight: 500; }
.menu-price { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.menu-signature {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #FEF3C7;
  color: #92400E;
  flex-shrink: 0;
}
.dark .menu-signature { background: rgba(146,64,14,0.25); color: #FCD34D; }

/* 리뷰 하이라이트 */
.review-bubble {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: var(--bg);
  border-left: 3px solid var(--border);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  line-height: 1.5;
  margin-bottom: 8px;
  transition: border-color 0.2s ease;
}
.review-bubble:hover { border-left-color: var(--text-secondary); }
.review-bubble:last-child { margin-bottom: 0; }

/* =====================================================
   비교 트레이
   ===================================================== */
.compare-tray {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.1);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
}
.tray-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.tray-remove {
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
}
.tray-remove:hover { color: var(--accent); }

/* =====================================================
   비교 테이블
   ===================================================== */
.cmp-table { width: 100%; border-collapse: collapse; }
.cmp-table th, .cmp-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}
.cmp-table th {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  background: var(--bg);
}
.cmp-table td { color: var(--text-secondary); }
.cmp-table .winner {
  color: #16A34A;
  font-weight: 700;
}
.dark .cmp-table .winner { color: #4ADE80; }
.cmp-total { background: var(--bg); }
.cmp-total td { font-weight: 800; font-size: 1rem; color: var(--text-primary); }

/* =====================================================
   토스트
   ===================================================== */
@keyframes toastIn {
  from { transform: translateY(-10px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: scale(0.95); }
}
.toast {
  display: inline-block;
  padding: 10px 16px;
  background: var(--text-primary);
  color: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* =====================================================
   스크롤탑 버튼
   ===================================================== */
.scroll-top {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 30;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--surface);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}
.scroll-top:hover { transform: translateY(-3px) scale(1.05); }

/* =====================================================
   스낵바 / 폴백 배너
   ===================================================== */
.fallback-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: #92400E;
  margin-bottom: 16px;
}
.dark .fallback-banner {
  background: rgba(92,60,0,0.2);
  border-color: rgba(253,230,138,0.2);
  color: #FCD34D;
}

/* =====================================================
   뷰 모드 토글
   ===================================================== */
.view-toggle {
  display: inline-flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-btn {
  padding: 6px 10px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: all 0.15s ease;
}
.view-btn.active {
  background: var(--text-primary);
  color: var(--surface);
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
  .no-print { display: none !important; }
  .comparison-table { break-inside: avoid; }
}

/* =====================================================
   NUMBER COUNTER ANIMATION
   ===================================================== */
.count-anim {
  display: inline-block;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.count-anim.counting {
  animation: countPulse 0.2s ease;
}
@keyframes countPulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

/* =====================================================
   RIPPLE EFFECT
   ===================================================== */
.ripple {
  position: relative;
  overflow: hidden;
}
.ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
  border-radius: inherit;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.ripple:active::after {
  transform: scale(2);
  opacity: 1;
  transition: none;
}

/* =====================================================
   필터 적용 시 리셋 힌트
   ===================================================== */
.active-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-bottom: 10px;
}
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--text-primary);
  color: var(--surface);
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
}

/* =====================================================
   SORT HIGHLIGHT — 정렬 기준에 따른 항목 강조
   ===================================================== */
/* 미니 레이팅 바 강조 */
.mini-rating-item { transition: opacity 0.2s ease; }
.mini-rating-item.sort-active .mini-rating-label {
  color: var(--text-primary);
  font-weight: 700;
}
.mini-rating-item.sort-active .mini-rating-val {
  color: var(--text-primary);
  font-weight: 800;
}
.mini-rating-item.sort-active .mini-rating-fill {
  filter: brightness(1.1) saturate(1.2);
}
/* 비강조 항목은 살짝 흐리게 */
.sort-mode-on .mini-rating-item:not(.sort-active) {
  opacity: 0.45;
}

/* 가격/리뷰 텍스트 강조 */
.sort-highlight-text {
  color: var(--text-primary) !important;
  font-weight: 700;
  transition: all 0.2s ease;
}

/* 점수 뱃지 강조 (weighted 정렬 시) */
.score-badge-active {
  box-shadow: 0 0 0 2.5px currentColor !important;
  transform: scale(1.08);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease;
}
