:root {
  --header-height: 58px;
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --font-family: "Pretendard Variable", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-surface: #131b2e;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e3a8a33;
  --border-color: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ==========================================================================
   Header Section
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s, border-color 0.2s;
  height: var(--header-height);
  display: flex;
  align-items: center;
}

[data-theme="dark"] .app-header {
  background-color: rgba(19, 27, 46, 0.92);
}

.header-container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.header-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
  flex-shrink: 0;
}

.brand-badge {
  font-size: 0.65rem;
  background-color: var(--primary);
  color: #ffffff;
  padding: 0.12rem 0.38rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  line-height: 1.1;
}

/* Header Search */
.header-search {
  flex: 1;
  max-width: 440px;
  min-width: 0;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 0.48rem 2.2rem 0.48rem 2.2rem;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 0.65rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-sm {
  padding: 0.38rem 0.65rem;
  font-size: 0.78rem;
}

.refresh-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.column-toggle {
  display: flex;
  background-color: var(--bg-secondary);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.col-btn {
  background: none;
  border: none;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.col-btn.active {
  background-color: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn, .notif-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.38rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s;
  position: relative;
}

.theme-toggle-btn:hover, .notif-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--accent-red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* ==========================================================================
   Main Container
   ========================================================================== */
.main-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

/* ==========================================================================
   Rank Deals Section (지금 주목받는 핫딜)
   ========================================================================== */
.rank-section {
  margin-bottom: 1.25rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  letter-spacing: -0.01em;
}

.fire-icon {
  font-size: 1.1rem;
}

.section-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.carousel-container {
  position: relative;
  overflow: hidden;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.carousel-track {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-placeholder {
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  width: 100%;
}

.rank-card {
  flex: 0 0 230px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  display: flex;
  gap: 0.65rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.rank-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.rank-thumb-wrapper {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.rank-badge-number {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background-color: var(--primary);
  color: #fff;
  border-bottom-right-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  z-index: 2;
}

.rank-card:nth-child(1) .rank-badge-number { background-color: #ef4444; }
.rank-card:nth-child(2) .rank-badge-number { background-color: #f97316; }
.rank-card:nth-child(3) .rank-badge-number { background-color: #eab308; }

.rank-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-color: var(--bg-secondary);
}

.rank-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.rank-store {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-title {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.rank-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-red);
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Sticky Filter Bar (Categories & Sites)
   ========================================================================== */
.filter-sticky-bar {
  position: sticky;
  top: var(--header-height);
  z-index: 35;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s, border-color 0.2s;
}

.category-scroll {
  overflow-x: auto;
  margin-bottom: 0.55rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-pills {
  display: inline-flex;
  gap: 0.4rem;
  white-space: nowrap;
}

.cat-pill {
  background-color: var(--bg-secondary);
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.cat-pill:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.cat-pill.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.25);
}

.sub-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
  min-width: 0;
}

.site-chips-scroll {
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-width: 0;
}

.site-chips-scroll::-webkit-scrollbar {
  display: none;
}

.site-chips {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.site-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-right: 0.15rem;
  white-space: nowrap;
}

.site-chip {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.74rem;
  padding: 0.22rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-weight: 600;
}

.site-chip:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.site-chip.active {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.sort-selector-wrapper {
  flex-shrink: 0;
}

.sort-select {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.sort-select:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   Status Bar
   ========================================================================== */
.deals-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.deal-count-text {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 0.88rem;
}

/* ==========================================================================
   Deals Grid
   ========================================================================== */
.deals-grid {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.deals-grid.col-1 {
  grid-template-columns: minmax(0, 1fr);
}

.deals-grid.col-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Deal Card */
.deal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.deal-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-top {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  min-width: 0;
}

.card-thumb-wrapper {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-secondary);
  cursor: pointer;
}

.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-color: var(--bg-secondary);
  transition: transform 0.2s;
}

.deal-card:hover .card-thumb-img {
  transform: scale(1.03);
}

.card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.badges-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.store-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.site-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}

.site-badge img {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  object-fit: contain;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  word-break: break-word;
  overflow-wrap: anywhere;
  transition: color 0.15s;
}

.card-title:hover {
  color: var(--primary);
}

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.card-price {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--accent-red);
  letter-spacing: -0.01em;
}

.delivery-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.38rem;
  border-radius: 4px;
  white-space: nowrap;
}

.delivery-badge.free {
  background-color: #dcfce7;
  color: #15803d;
}

[data-theme="dark"] .delivery-badge.free {
  background-color: #14532d;
  color: #86efac;
}

.delivery-badge.paid {
  background-color: var(--bg-secondary);
  color: var(--text-muted);
}

.unit-price {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Card Bottom Reactions & Link */
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 0.6rem;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.reactions-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  min-width: 0;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.reaction-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.reaction-btn.active {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.stat-item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 0.2rem;
  white-space: nowrap;
}

.outbound-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  transition: all 0.15s;
  white-space: nowrap;
  margin-left: auto;
}

.outbound-link-btn:hover {
  background-color: var(--primary);
  color: #ffffff;
}

/* ==========================================================================
   Load More Section
   ========================================================================== */
.load-more-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.75rem;
  gap: 0.75rem;
}

.btn-outline {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.55rem 1.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.no-more-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-container {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  padding: 1.35rem;
  border: 1px solid var(--border-color);
}

.modal-close-btn {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-header-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.modal-price-box {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-price-val {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent-red);
}

.modal-links-row {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.modal-btn {
  flex: 1;
  text-align: center;
  justify-content: center;
  padding: 0.65rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
}

/* Comments */
.comments-section {
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

.comments-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.comment-input-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.comment-input-box input,
.comment-input-box textarea {
  width: 100%;
  padding: 0.55rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.comment-item {
  background-color: var(--bg-secondary);
  padding: 0.65rem;
  border-radius: var(--radius-sm);
}

.comment-user {
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
  color: var(--text-secondary);
}

.comment-content {
  font-size: 0.82rem;
  word-break: break-word;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
  opacity: 0;
  z-index: 200;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Keyword Tags */
.keyword-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.keyword-tag button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
}

.notif-item {
  background-color: var(--bg-secondary);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  cursor: pointer;
  border-left: 3px solid var(--primary);
  transition: background-color 0.15s;
}

.notif-item:hover {
  background-color: var(--bg-tertiary);
}

.notif-item-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.notif-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   Responsive Media Queries (Pixel-Perfect Breakpoints)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 54px;
  }

  .header-container {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .brand-logo {
    font-size: 1.15rem;
  }

  .main-container {
    padding: 0.75rem 0.65rem 3rem;
  }

  .deals-grid.col-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-sticky-bar {
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-md);
  }

  .rank-card {
    flex: 0 0 210px;
  }
}

@media (max-width: 640px) {
  .header-actions .btn-text {
    display: none;
  }

  .column-toggle {
    display: none;
  }

  .header-actions .btn-sm {
    padding: 0.38rem;
  }

  .sub-filter-row {
    gap: 0.4rem;
  }

  .sort-select {
    font-size: 0.74rem;
    padding: 0.25rem 0.45rem;
  }

  .modal-container {
    padding: 1rem;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 480px) {
  .card-top {
    gap: 0.6rem;
  }

  .card-thumb-wrapper {
    width: 76px;
    height: 76px;
  }

  .card-title {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
  }

  .card-price {
    font-size: 0.95rem;
  }

  .reaction-btn {
    padding: 0.2rem 0.42rem;
    font-size: 0.68rem;
  }

  .stat-item {
    font-size: 0.68rem;
  }

  .outbound-link-btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.48rem;
  }
}

/* ==============================================================================
   Monetization & Sponsored Deal Badges & Cards
============================================================================== */
.ad-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 4px;
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #fde047;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .ad-badge {
  background: #713f12;
  color: #fef08a;
  border-color: #a16207;
}

.deal-card.sponsored-card {
  border: 1.5px solid #facc15;
  background: linear-gradient(180deg, rgba(254, 240, 138, 0.08) 0%, var(--bg-surface) 100%);
}

[data-theme="dark"] .deal-card.sponsored-card {
  border-color: #ca8a04;
  background: linear-gradient(180deg, rgba(202, 138, 4, 0.12) 0%, var(--bg-surface) 100%);
}

/* Coupang Dynamic Search Slot */
.coupang-dynamic-slot {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(135deg, #eff6ff 0%, #fdf2f8 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .coupang-dynamic-slot {
  background: linear-gradient(135deg, #1e293b 0%, #1e1b4b 100%);
  border-color: #3b82f6;
}

.coupang-slot-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.coupang-slot-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.coupang-slot-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.coupang-slot-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.coupang-slot-btn {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  background: #dc2626;
  color: #fff;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.coupang-slot-btn:hover {
  opacity: 0.9;
}

/* In-feed Ad Card */
.infeed-ad-card {
  grid-column: 1 / -1;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.4rem 0;
  transition: border-color 0.2s;
}

.infeed-ad-card:hover {
  border-color: var(--primary);
}

.infeed-ad-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Modal Coupang Search Bar */
.modal-coupang-search {
  margin-top: 1.2rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

[data-theme="dark"] .modal-coupang-search {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

.modal-coupang-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-coupang-btn {
  background: #e11d48;
  color: #ffffff;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

