/* ══════════════════════════════════════
   쿠팡 추천 페이지 - 스타일
   ══════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface2: #22222e;
  --accent: #ff4d6d;
  --accent2: #ffd166;
  --accent3: #06d6a0;
  --accent4: #118ab2;
  --text: #f0f0f5;
  --text-dim: #8888a0;
  --radius: 16px;
  --tab-accent: #ff4d6d;
  --tab-gradient-from: #ff4d6d;
  --tab-gradient-to: #ff758f;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 100px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.header {
  padding: 32px 20px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,77,109,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.header-emoji { font-size: 48px; margin-bottom: 8px; }
.header h1 {
  font-size: 24px; font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header p { color: var(--text-dim); font-size: 13px; margin-top: 6px; }
.update-badge {
  display: inline-block; margin-top: 10px;
  background: var(--surface2); padding: 4px 12px; border-radius: 20px;
  font-size: 11px; color: var(--accent3);
}
.update-badge::before { content: '●'; margin-right: 5px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── Search Bar ── */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 16px 0;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  transition: border-color 0.2s;
}
.search-bar:focus-within {
  border-color: var(--tab-accent);
}
.search-icon { font-size: 16px; flex-shrink: 0; }
.search-bar input {
  flex: 1; border: none; outline: none;
  background: transparent; color: var(--text);
  font-size: 14px; font-family: inherit;
}
.search-bar input::placeholder { color: var(--text-dim); }
.search-clear {
  width: 24px; height: 24px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--surface2); color: var(--text-dim);
  font-size: 12px;
  display: none; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.search-clear.visible { display: flex; }
.search-clear:active { transform: scale(0.9); }

.search-results {
  display: none;
  margin: 8px 16px 0;
}
.search-results.active { display: block; }
.search-count {
  font-size: 12px; color: var(--text-dim);
  margin-bottom: 8px; padding: 0 4px;
}
.search-results .product-card {
  animation: fadeUp 0.3s ease;
}
.search-tab-label {
  display: inline-block;
  padding: 2px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* ── Tab Navigation ── */
.tab-nav {
  display: flex; gap: 6px;
  padding: 0 16px; margin: 16px 0;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  padding: 10px 16px; border-radius: 25px;
  font-size: 13px; font-weight: 700;
  border: none; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  background: var(--surface2); color: var(--text-dim);
  white-space: nowrap;
}
.tab-btn.active {
  color: #fff;
  box-shadow: 0 4px 15px rgba(255,77,109,0.3);
}

/* ── Tab Content ── */
.tab-content {
  padding: 0 16px;
  min-height: 300px;
}
.tab-content-inner {
  animation: fadeUp 0.4s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: none; }
}

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ── Section Header ── */
.section-header {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 14px; padding: 0 4px;
}
.section-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.section-header h2 { font-size: 17px; font-weight: 900; }
.section-header .sub { font-size: 12px; color: var(--text-dim); }

/* ── Timer Badge ── */
.timer {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,77,109,0.15); border: 1px solid rgba(255,77,109,0.3);
  padding: 6px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 700; color: var(--accent);
  margin: 0 4px 12px; animation: timerPulse 3s infinite;
}
@keyframes timerPulse {
  0%,100% { border-color: rgba(255,77,109,0.3); }
  50% { border-color: rgba(255,77,109,0.7); }
}

/* ── Filter Toggle ── */
.filter-bar {
  display: flex; gap: 8px; margin: 0 4px 12px;
  flex-wrap: wrap;
}
.filter-toggle {
  padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--surface2); color: var(--text-dim);
  cursor: pointer; transition: all 0.2s;
}
.filter-toggle.active {
  background: rgba(255,77,109,0.15);
  color: var(--accent);
  border-color: rgba(255,77,109,0.3);
}

/* ── Product Card ── */
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.product-card:active { transform: scale(0.98); }
.product-card.highlight {
  border-color: var(--tab-accent);
  box-shadow: 0 0 20px rgba(255,77,109,0.2);
  animation: highlightPulse 2s ease-out;
}
@keyframes highlightPulse {
  0% { box-shadow: 0 0 30px rgba(255,77,109,0.4); }
  100% { box-shadow: 0 0 0 transparent; }
}

/* Rank badge */
.rank-badge {
  position: absolute; top: 12px; left: 12px;
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #fff;
}
.rank-1 { background: linear-gradient(135deg, #ffd700, #ff8c00); }
.rank-2 { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0522d); }

/* Product layout */
.product-top {
  display: flex; gap: 14px; align-items: flex-start;
}
.product-img {
  width: 90px; height: 90px; border-radius: 12px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; flex-shrink: 0;
}
.product-info { flex: 1; min-width: 0; }
.product-info .category {
  font-size: 11px; color: var(--accent4);
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.product-info .name {
  font-size: 15px; font-weight: 700; margin: 4px 0;
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-info .rating {
  font-size: 12px; color: var(--accent2);
}

/* Price */
.price-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; flex-wrap: wrap;
}
.price-original {
  font-size: 13px; color: var(--text-dim);
  text-decoration: line-through;
}
.price-current { font-size: 20px; font-weight: 900; }
.discount-badge {
  padding: 3px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 900;
  background: rgba(255,77,109,0.15); color: var(--accent);
}
.lowest-badge {
  padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 900;
  background: rgba(6,214,160,0.15); color: var(--accent3);
  border: 1px solid rgba(6,214,160,0.3);
}
.rocket-badge {
  padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700;
  background: rgba(17,138,178,0.15); color: var(--accent4);
}
.trend-badge {
  padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 900;
  background: rgba(255,0,110,0.15); color: #ff006e;
}
.custom-badge {
  padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700;
  background: rgba(155,93,229,0.15); color: #9b5de5;
}

/* CTA Button */
.cta-btn {
  display: block; width: 100%; margin-top: 14px;
  padding: 13px; border-radius: 12px;
  font-size: 14px; font-weight: 700;
  border: none; cursor: pointer;
  color: #fff; text-align: center;
  text-decoration: none;
  transition: all 0.2s;
  background: linear-gradient(135deg, var(--tab-gradient-from), var(--tab-gradient-to));
}
.cta-btn:active { transform: scale(0.97); }

/* ── Price Chart (mini sparkline) ── */
.price-chart {
  display: flex; align-items: flex-end; gap: 2px;
  height: 30px; margin: 8px 0 4px;
}
.price-bar {
  flex: 1; border-radius: 2px 2px 0 0;
  background: var(--surface2);
  transition: all 0.3s;
}
.price-bar.current { background: var(--accent3); }
.chart-label {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-dim);
}

/* ── Budget Tags ── */
.budget-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 12px 4px;
}
.budget-tag {
  padding: 8px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 700;
  background: var(--surface2); color: var(--text-dim);
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.2s;
}
.budget-tag.active {
  background: rgba(155,93,229,0.15);
  color: #9b5de5;
  border-color: rgba(155,93,229,0.3);
}

/* ── Trending ── */
.trend-score {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: #ff006e;
}
.trend-bar {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--surface2); overflow: hidden;
}
.trend-bar-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #ff006e, #ff4d6d);
}

/* ── Bundle ── */
.bundle-items {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.bundle-item {
  padding: 4px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 500;
  background: var(--surface2); color: var(--text-dim);
}

/* ── Compare ── */
.compare-group {
  margin-bottom: 20px;
}
.compare-group-title {
  font-size: 15px; font-weight: 900;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.spec-table {
  display: grid; gap: 4px;
  margin-top: 8px;
}
.spec-row {
  display: flex; gap: 8px;
  font-size: 11px;
}
.spec-label {
  color: var(--text-dim);
  min-width: 50px;
  font-weight: 500;
}
.spec-value {
  color: var(--text);
  font-weight: 700;
}
.pros-cons {
  display: flex; gap: 12px;
  margin-top: 8px; font-size: 11px;
}
.pros { color: var(--accent3); }
.cons { color: var(--accent); }

/* ── Reviews Tab ── */
.channel-filters {
  display: flex; gap: 6px;
  margin: 12px 4px;
}
.channel-filter {
  padding: 8px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  background: var(--surface2); color: var(--text-dim);
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.2s;
}
.channel-filter.active {
  background: rgba(6,214,160,0.15);
  color: var(--accent3);
  border-color: rgba(6,214,160,0.3);
}

.content-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.04);
}
.content-card .content-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.content-card .channel-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.content-card .content-title {
  font-size: 14px; font-weight: 700; flex: 1;
}
.content-card .content-date {
  font-size: 11px; color: var(--text-dim);
}
.content-card .content-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--accent3);
  text-decoration: none; margin-top: 8px;
}
.content-products {
  padding-left: 0;
  margin-bottom: 16px;
}

/* ── Subsection Divider ── */
.subsection-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 24px 0 14px;
  padding: 0 4px;
}
.subsection-divider::before,
.subsection-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.subsection-divider span {
  font-size: 13px; font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ── Load More ── */
.load-more-btn {
  display: block; width: 100%;
  padding: 14px; margin: 16px 0;
  border-radius: 12px;
  font-size: 14px; font-weight: 700;
  background: var(--surface2); color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer; transition: all 0.2s;
  text-align: center;
}
.load-more-btn:active { transform: scale(0.97); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty-state .emoji { font-size: 40px; margin-bottom: 10px; }
.empty-state .msg { font-size: 14px; }

/* ── Blog Section ── */
.blog-section {
  margin: 28px 16px 0;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.06);
}
.blog-section h3 {
  font-size: 15px; font-weight: 900; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.blog-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 10px;
  background: var(--surface2); margin-bottom: 8px;
  text-decoration: none; color: var(--text);
  transition: all 0.2s;
}
.blog-link:last-child { margin-bottom: 0; }
.blog-link:active { transform: scale(0.98); }
.blog-link .emoji { font-size: 20px; }
.blog-link .title { font-size: 13px; font-weight: 500; flex: 1; }
.blog-link .arrow { color: var(--text-dim); font-size: 14px; }

/* ── Footer ── */
.footer {
  margin: 32px 16px; padding: 20px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer p { font-size: 11px; color: var(--text-dim); line-height: 1.6; }
.social-links {
  display: flex; justify-content: center; gap: 12px; margin: 16px 0;
}
.social-link {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; text-decoration: none;
  transition: transform 0.2s;
}
.social-link:active { transform: scale(0.9); }

/* ── Notification Bar ── */
.notification-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: linear-gradient(135deg, rgba(15,15,19,0.95), rgba(26,26,36,0.98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 10px;
  z-index: 100;
}
.notification-bar .bell { font-size: 20px; }
.notification-bar .text { flex: 1; font-size: 12px; color: var(--text-dim); }
.notification-bar .tg-btn {
  padding: 8px 16px; border-radius: 20px;
  background: linear-gradient(135deg, #229ED9, #1a8bc7);
  color: #fff; font-size: 12px; font-weight: 700;
  border: none; cursor: pointer;
  text-decoration: none;
}
