/* ===== CSS Variables ===== */
:root {
  --primary: #FF4136;
  --primary-dark: #C0392B;
  --accent: #FF851B;
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --surface-2: #F1F3F5;
  --border: #DEE2E6;
  --text-primary: #1A1A2E;
  --text-secondary: #6C757D;
  --text-muted: #ADB5BD;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; }
img { display: block; max-width: 100%; }

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}
.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo-text span { color: var(--primary); }
.search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 10px 16px 10px 44px;
  border: 2px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,65,54,0.12);
  background: white;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn-alert {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}
.btn-alert:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ===== Hero Banner ===== */
.hero {
  background: linear-gradient(135deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
  color: white;
  padding: 40px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,65,54,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner { max-width: 1280px; margin: 0 auto; position: relative; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,65,54,0.2);
  border: 1px solid rgba(255,65,54,0.4);
  color: #FF8A80;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(24px, 4vw, 40px); font-weight: 800; letter-spacing: -1px; margin-bottom: 10px; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 15px; color: rgba(255,255,255,0.7); margin-bottom: 24px; }
.hero-stats { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 28px; font-weight: 800; color: var(--accent); }
.hero-stat-label { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* ===== Main Layout ===== */
.main { max-width: 1280px; margin: 0 auto; padding: 28px 20px 60px; }

/* ===== Category Tabs ===== */
.categories {
  position: relative;
  margin-bottom: 24px;
}
/* 오른쪽 페이드 — 스크롤 가능함을 시각적으로 표시 */
.categories::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 72px;
  height: calc(100% - 4px);   /* padding-bottom 4px 제외 */
  background: linear-gradient(to right, transparent, var(--bg) 80%);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s;
}
/* 끝까지 스크롤하면 페이드 숨김 — JS로 .scrolled-end 클래스 토글 */
.categories.scrolled-end::after { opacity: 0; }

.categories-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  padding-right: 72px;   /* 페이드 너비만큼 여유 확보 → 마지막 탭 잘림 방지 */
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.cat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all var(--transition);
  flex-shrink: 0;   /* 탭이 압축되지 않도록 고정 */
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(255,65,54,0.3);
}

/* ===== Toolbar ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-count { font-size: 14px; color: var(--text-secondary); }
.result-count strong { color: var(--text-primary); font-weight: 700; }
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-select {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--primary); }
.sort-group { display: flex; gap: 6px; }
.sort-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.sort-btn.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: white;
}

/* ===== Deal Grid ===== */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ===== Deal Card ===== */
.deal-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255,65,54,0.3);
}
.deal-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--surface-2);
}
.deal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.deal-card:hover .deal-img { transform: scale(1.05); }
.deal-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
  transition: opacity 0.2s ease;
}
/* 호버 시 툴팁이 배지를 대체 — 부드럽게 숨김 */
.deal-card:hover .deal-badges { opacity: 0; pointer-events: none; }

/* ===== 이미지 호버 툴팁 (상세 정보) ===== */
.img-tooltip {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 30, 0.88);
  backdrop-filter: blur(4px);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
  opacity: 0;
  transition: opacity 0.22s ease;
  z-index: 3;   /* 배지(2)보다 위 — 배지가 가리지 않음 */
  padding: 12px 13px;
  text-align: left;
}
.deal-card:hover .img-tooltip { opacity: 1; }

/* 상단: 할인율 + 태그 배지 */
.img-tooltip-header {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding-right: 44px; /* 찜·공유 버튼(34px) + 여백 — 텍스트가 버튼 아래로 파고들지 않도록 */
}
.img-tooltip-disc {
  font-size: 15px;
  font-weight: 900;
  color: #FF6B6B;
  background: rgba(255,107,107,0.18);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: -0.3px;
}
.img-tooltip-tag {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,0.13);
  padding: 2px 7px;
  border-radius: 999px;
}

/* 중단: 상품명 */
.img-tooltip-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 7px 0;
  opacity: 0.95;
  padding-right: 44px; /* 찜·공유 버튼 겹침 방지 */
}

/* 한줄 설명 */
.img-tooltip-desc {
  font-size: 10.5px;
  color: rgba(255,255,255,0.68);
  line-height: 1.5;
  margin-bottom: 8px;
  padding-right: 44px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 하단: 가격 비교 + 메타 */
.img-tooltip-prices { width: 100%; }
.img-tooltip-orig {
  font-size: 11px;
  text-decoration: line-through;
  opacity: 0.55;
  margin-bottom: 1px;
}
.img-tooltip-sale {
  font-size: 19px;
  font-weight: 900;
  color: #FF6B6B;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.img-tooltip-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

/* ===== 스파크라인 (가격 추이 미니 차트) ===== */
.sparkline-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.10);
  opacity: 0.9;
}
.sparkline-days {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  white-space: nowrap;
}

/* ===== 업데이트 날짜 뱃지 (구 타이머 대체) ===== */
.update-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.82);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 2;
  letter-spacing: 0.2px;
  transition: opacity 0.2s ease;
}
/* 호버 시 툴팁이 대신 정보 보여줌 */
.deal-card:hover .update-badge { opacity: 0; }

/* ===== Card action buttons (wish ❤️ + share) ===== */
.card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 4;   /* 툴팁(3)보다 위 — 항상 클릭 가능 */
}
.deal-card:hover .card-actions,
.card-actions:focus-within { opacity: 1; transform: translateY(0); }

.btn-wish,
.btn-share {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.14);
  transition: background 0.15s ease, transform 0.15s ease;
  line-height: 1;
}
.btn-wish:hover  { background: #ffe4e4; transform: scale(1.12); }
.btn-share:hover { background: #e8f0ff; transform: scale(1.12); }
.btn-wish:active, .btn-share:active { transform: scale(0.95); }
.btn-wish.active { color: #e63946; }
.btn-share svg   { display: block; color: #495057; }

/* ===== Wish badge on category tab ===== */
.wish-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}
.badge-discount {
  background: var(--primary);
  color: white;
  font-size: 13px;
  padding: 4px 10px;
}
.badge-hot { background: #FF851B; color: white; }
.badge-lowest { background: #2ECC40; color: white; }
.badge-timedeal { background: #7B2FBE; color: white; }
.badge-card { background: #0074D9; color: white; }
.timer-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: 16px 10px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-size: 12px;
  font-weight: 600;
}
.timer-icon { font-size: 13px; }
.timer { font-variant-numeric: tabular-nums; }
.deal-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.deal-store-row { display: flex; align-items: center; justify-content: space-between; }
.store-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.deal-rating { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.stars { color: #FFC107; font-size: 11px; }
.deal-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 딜 이름 → 상세 페이지 링크 */
a.deal-name-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}
a.deal-name-link:hover { color: var(--primary); text-decoration: underline; }
.deal-prices { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.original-price {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
}
.price-type-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #868e96;
  background: #f1f3f5;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 3px;
  text-decoration: none;
  vertical-align: middle;
  letter-spacing: -0.2px;
}
.sale-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.savings {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}
.deal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--surface-2);
  gap: 8px;
}
.deal-meta { display: flex; gap: 8px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.meta-tag { display: flex; align-items: center; gap: 3px; }
.affiliate-tag { color: #6f42c1; opacity: .75; font-size: 10px; cursor: help; }
.btn-buy {
  flex-shrink: 0;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(255,65,54,0.3);
}
.btn-buy:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(255,65,54,0.4);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; color: var(--text-secondary); margin-bottom: 8px; }

/* ===== Admin button ===== */
.btn-admin {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  font-size: 17px;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
.btn-admin:hover { background: var(--border); border-color: var(--text-muted); }

.btn-report {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  color: #f57f17;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn-report:hover { background: #fff3cd; border-color: #ffc107; }

/* ===== Affiliate unset badge ===== */
.affiliate-unset-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
  cursor: help;
}

/* ===== Alert Modal ===== */
/* ===== Modal category grid ===== */
.modal-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.modal-x:hover { background: var(--border); }
.modal-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.modal-cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.cat-checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 2px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  background: var(--surface);
  color: var(--text-secondary);
}
.cat-checkbox input { display: none; }
.cat-checkbox:hover { border-color: var(--primary); color: var(--primary); }
.cat-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
/* 웹 푸시 토글 */
.modal-push-wrap { border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.push-toggle-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.push-toggle-label input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.push-toggle-text { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }

.modal-notice {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
  line-height: 1.6;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.modal p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }
.modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}
.modal-input:focus { border-color: var(--primary); }
.modal-actions { display: flex; gap: 10px; }
.btn-modal-cancel {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.btn-modal-cancel:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.btn-modal-submit {
  flex: 2;
  padding: 12px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  transition: background var(--transition);
}
.btn-modal-submit:hover { background: var(--primary-dark); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-primary);
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.toast-success { background: #2ECC40; }
.toast.toast-warn    { background: #FF851B; }
.toast.toast-info    { background: var(--text-primary); }

/* ===== Footer ===== */
.footer {
  background: var(--text-primary);
  color: rgba(255,255,255,0.7);
  padding: 40px 20px;
  margin-top: 40px;
}
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-top { display: flex; gap: 40px; flex-wrap: wrap; margin-bottom: 32px; }
.footer-brand { flex: 1; min-width: 200px; }
.footer-logo { font-size: 20px; font-weight: 800; color: white; margin-bottom: 8px; }
.footer-logo span { color: var(--primary); }
.footer-desc { font-size: 13px; line-height: 1.7; }
.footer-links { flex: 2; display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col h4 { color: white; font-size: 13px; font-weight: 700; margin-bottom: 12px; letter-spacing: 0.5px; text-transform: uppercase; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col li { font-size: 13px; }
.footer-col a { color: rgba(255,255,255,0.6); transition: color var(--transition); }
.footer-col a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
}
.affiliate-notice {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 16px;
  line-height: 1.6;
}

/* ===== Responsive ===== */

/* ── 태블릿 (≤768px) ── */
@media (max-width: 768px) {
  /* 헤더: 검색창을 두 번째 줄로 내림 */
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px;
    gap: 8px;
  }
  .logo         { order: 1; }
  .header-actions { order: 2; margin-left: auto; }
  .search-wrap  { order: 3; flex: 1 1 100%; max-width: 100%; }

  .btn-alert span { display: none; }   /* 알림 버튼 아이콘만 */

  .hero { padding: 28px 16px; }
  .hero-stats { gap: 24px; }
  .main { padding: 20px 16px 40px; }
  .deals-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .footer-top { flex-direction: column; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* 터치 디바이스: hover 없으므로 액션 버튼 항상 표시 */
@media (hover: none) {
  .card-actions { opacity: 1; transform: translateY(0); }
}

/* ── 모바일 (≤480px) — 2열, 카드 내부 레이아웃 보정 ── */
@media (max-width: 480px) {
  .deals-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* 카드 본문 여백 축소 */
  .deal-body { padding: 10px; gap: 6px; }

  /* 텍스트 크기 */
  .deal-name     { font-size: 12px; }
  .original-price { font-size: 11px; }
  .sale-price    { font-size: 16px; }

  /* 별점은 공간 절약을 위해 숨김 */
  .deal-rating { display: none; }

  /* 카드 하단: 가로 → 세로 스택으로 변경 (핵심 수정) */
  .deal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  /* 좁은 화면에서 부수적인 뱃지 숨김 */
  .meta-tag.savings,
  .affiliate-tag { display: none; }

  /* 구매 버튼 전체 너비 */
  .btn-buy {
    width: 100%;
    text-align: center;
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ── 소형폰 (≤360px) — 1열로 전환 ── */
@media (max-width: 360px) {
  .deals-grid { grid-template-columns: 1fr; gap: 12px; }

  /* 1열에서는 다시 가로 레이아웃 복원 */
  .deal-body     { padding: 14px; gap: 8px; }
  .deal-name     { font-size: 14px; }
  .sale-price    { font-size: 20px; }
  .deal-footer   { flex-direction: row; align-items: center; }
  .deal-rating   { display: flex; }
  .meta-tag.savings { display: flex; }
  .btn-buy       { width: auto; }
}

/* ===== Skeleton Loader ===== */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card { background: var(--surface); border-radius: var(--radius); border: 1.5px solid var(--border); overflow: hidden; }
.skeleton-img { height: 200px; width: 100%; }
.skeleton-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-line { height: 14px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.long { width: 90%; }
.skeleton-price { height: 28px; width: 40%; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
