/* ============================================
   激安コム Design System
   ============================================ */

/* --- CSS Variables --- */
:root {
  /* Dark mode (default) */
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: rgba(25, 25, 60, 0.7);
  --bg-card-hover: rgba(35, 35, 80, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-controls: rgba(15, 15, 35, 0.95);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(108, 60, 224, 0.3);

  --text-primary: #f0f0ff;
  --text-secondary: #a0a0cc;
  --text-muted: #6a6a99;
  --text-brand: #b89cff;

  --accent: #6c3ce0;
  --accent-glow: rgba(108, 60, 224, 0.35);
  --accent-light: #9b72ff;

  --red: #ff3b5c;
  --red-bg: rgba(255, 59, 92, 0.12);
  --orange: #ff8c42;
  --orange-bg: rgba(255, 140, 66, 0.12);
  --yellow: #ffd23f;
  --yellow-bg: rgba(255, 210, 63, 0.12);
  --green: #2dcc70;
  --green-bg: rgba(45, 204, 112, 0.12);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.12);

  /* EC Platform Colors */
  --amazon: #FF9900;
  --rakuten: #BF0000;
  --yahoo: #FF0033;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border-card);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);

  /* Font */
  --font: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.25s;
}

[data-theme="light"] {
  --bg-primary: #f5f3ff;
  --bg-secondary: #eee8ff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(108, 60, 224, 0.04);
  --bg-controls: rgba(245, 243, 255, 0.98);
  --border-card: rgba(108, 60, 224, 0.12);
  --border-accent: rgba(108, 60, 224, 0.2);

  --text-primary: #1a1040;
  --text-secondary: #5a5080;
  --text-muted: #8a80aa;
  --text-brand: #6c3ce0;

  --shadow-card: 0 2px 16px rgba(108, 60, 224, 0.08), 0 0 0 1px var(--border-card);
  --shadow-elevated: 0 8px 32px rgba(108, 60, 224, 0.12);
  --shadow-glow: 0 0 20px rgba(108, 60, 224, 0.15);

  --red-bg: rgba(255, 59, 92, 0.08);
  --orange-bg: rgba(255, 140, 66, 0.08);
  --yellow-bg: rgba(255, 210, 63, 0.10);
  --green-bg: rgba(45, 204, 112, 0.08);
  --blue-bg: rgba(59, 130, 246, 0.08);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(108, 60, 224, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255, 59, 92, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* --- Header --- */
#header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  background: var(--bg-controls);
  border-bottom: 1px solid var(--border-card);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-md) var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.logo-icon {
  font-size: 1.8rem;
  animation: fire 1.5s ease-in-out infinite alternate;
}

@keyframes fire {
  0%   { transform: scale(1) rotate(-3deg); filter: brightness(1); }
  100% { transform: scale(1.1) rotate(3deg); filter: brightness(1.3); }
}

.logo-text {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-accent {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--red) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  padding-top: 4px;
}

.icon-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all var(--duration) var(--ease);
}

.icon-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: inline; }

/* --- EC Sale Banner --- */
.ec-sale-banner {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-card);
  position: relative;
  z-index: 1;
}

.ec-sale-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-lg) var(--sp-lg) var(--sp-md);
}

.ec-sale-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--sp-md);
  color: var(--text-secondary);
}

.ec-sale-cards {
  display: flex;
  gap: var(--sp-md);
  overflow-x: auto;
  padding-bottom: var(--sp-sm);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.ec-sale-cards::-webkit-scrollbar {
  height: 4px;
}
.ec-sale-cards::-webkit-scrollbar-track {
  background: transparent;
}
.ec-sale-cards::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

.ec-sale-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  position: relative;
  overflow: hidden;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.ec-sale-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.ec-sale-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.ec-sale-card[data-platform="Amazon"]::before { background: var(--amazon); }
.ec-sale-card[data-platform="楽天"]::before { background: var(--rakuten); }
.ec-sale-card[data-platform="Yahoo!ショッピング"]::before { background: var(--yahoo); }

.ec-sale-platform {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-xs);
}

.ec-sale-card[data-platform="Amazon"] .ec-sale-platform { color: var(--amazon); }
.ec-sale-card[data-platform="楽天"] .ec-sale-platform { color: var(--rakuten); }
.ec-sale-card[data-platform="Yahoo!ショッピング"] .ec-sale-platform { color: var(--yahoo); }

.ec-sale-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--sp-xs);
}

.ec-sale-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-sm);
  line-height: 1.5;
}

.ec-sale-countdown {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.ec-countdown-number {
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
  color: var(--accent-light);
}

.ec-sale-confirmed {
  display: inline-block;
  font-size: 0.6rem;
  background: var(--green-bg);
  color: var(--green);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  margin-left: var(--sp-xs);
}

.ec-sale-unconfirmed {
  display: inline-block;
  font-size: 0.6rem;
  background: var(--yellow-bg);
  color: var(--yellow);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  margin-left: var(--sp-xs);
}

/* --- Controls --- */
.controls {
  position: sticky;
  top: 65px;
  z-index: 90;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  background: var(--bg-controls);
  border-bottom: 1px solid var(--border-card);
}

.controls-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-md) var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

/* Search */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  opacity: 0.6;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 40px 12px 44px;
  font-family: var(--font);
  font-size: 0.95rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  outline: none;
  transition: all var(--duration) var(--ease);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 50%;
  transition: color var(--duration) var(--ease);
}

.search-clear:hover {
  color: var(--text-primary);
}

/* Sort */
.sort-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.sort-label,
.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 52px;
}

.sort-btns {
  display: flex;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

.sort-btn {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.sort-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.sort-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* Filter chips */
.filter-wrap {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-md);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Stats */
.stats-bar {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.stat-count {
  font-weight: 700;
  color: var(--accent-light);
  font-size: 0.95rem;
}

.stat-updated {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.6;
}

/* --- Deal Cards Grid --- */
#main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-lg);
  min-height: 50vh;
}

.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-md);
}

/* --- Deal Card --- */
.deal-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--sp-lg);
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
  animation: cardFadeIn 0.4s var(--ease) both;
  cursor: pointer;
}

.deal-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-elevated);
  border-color: var(--border-accent);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered animation delays */
.deal-card:nth-child(1)  { animation-delay: 0.02s; }
.deal-card:nth-child(2)  { animation-delay: 0.04s; }
.deal-card:nth-child(3)  { animation-delay: 0.06s; }
.deal-card:nth-child(4)  { animation-delay: 0.08s; }
.deal-card:nth-child(5)  { animation-delay: 0.10s; }
.deal-card:nth-child(6)  { animation-delay: 0.12s; }
.deal-card:nth-child(7)  { animation-delay: 0.14s; }
.deal-card:nth-child(8)  { animation-delay: 0.16s; }
.deal-card:nth-child(9)  { animation-delay: 0.18s; }
.deal-card:nth-child(10) { animation-delay: 0.20s; }
.deal-card:nth-child(n+11) { animation-delay: 0.22s; }

/* Discount badge */
.deal-badge {
  position: absolute;
  top: var(--sp-md);
  right: var(--sp-md);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  letter-spacing: -0.02em;
}

.deal-badge.tier-free {
  background: linear-gradient(135deg, #ff3b5c, #ff6b3b);
  color: #fff;
  box-shadow: 0 2px 16px rgba(255, 59, 92, 0.4);
  animation: pulseBadge 2s ease-in-out infinite;
}

.deal-badge.tier-1 {
  background: linear-gradient(135deg, #ff3b5c, #ff6b3b);
  color: #fff;
  box-shadow: 0 2px 16px rgba(255, 59, 92, 0.4);
  animation: pulseBadge 2s ease-in-out infinite;
}

.deal-badge.tier-2 {
  background: linear-gradient(135deg, #ff8c42, #ffb347);
  color: #1a1040;
  box-shadow: 0 2px 12px rgba(255, 140, 66, 0.3);
}

.deal-badge.tier-3 {
  background: linear-gradient(135deg, #ffd23f, #ffe580);
  color: #1a1040;
  box-shadow: 0 2px 12px rgba(255, 210, 63, 0.3);
}

.deal-badge.tier-4 {
  background: linear-gradient(135deg, #2dcc70, #48e68a);
  color: #1a1040;
}

.deal-badge.tier-amount {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
}

@keyframes pulseBadge {
  0%, 100% { box-shadow: 0 2px 16px rgba(255, 59, 92, 0.4); }
  50% { box-shadow: 0 2px 24px rgba(255, 59, 92, 0.7); }
}

/* Card top: brand + category */
.deal-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
}

.deal-brand {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-brand);
  background: var(--bg-glass);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-accent);
}

.deal-category {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.deal-type-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  margin-left: auto;
}

.deal-type-badge.type-half { background: var(--red-bg); color: var(--red); }
.deal-type-badge.type-free { background: var(--red-bg); color: var(--red); }
.deal-type-badge.type-increase { background: var(--blue-bg); color: var(--blue); }
.deal-type-badge.type-coupon { background: var(--green-bg); color: var(--green); }
.deal-type-badge.type-discount { background: var(--orange-bg); color: var(--orange); }
.deal-type-badge.type-point { background: var(--yellow-bg); color: var(--yellow); }

/* Card body: title + price */
.deal-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: var(--sp-sm);
  padding-right: 80px;
}

.deal-price-wrap {
  display: flex;
  align-items: baseline;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
}

.deal-original-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.deal-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.deal-current-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--red);
}

.deal-savings {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-bg);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.deal-increase-info {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--blue-bg);
  border-radius: var(--radius-sm);
}

.deal-increase-icon {
  font-size: 1.3rem;
}

.deal-increase-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--blue);
}

.deal-increase-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Card footer: description, period, source */
.deal-description {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--sp-sm);
}

.deal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--border-card);
}

.deal-period {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.deal-period.ending-soon {
  color: var(--red);
  font-weight: 600;
}

.deal-source {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 8px;
  background: var(--bg-glass);
  border-radius: var(--radius-pill);
  transition: color var(--duration) var(--ease);
}

.deal-source:hover {
  color: var(--accent-light);
}

.deal-footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* App link button */
.app-link-btn {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  background: var(--accent-glow);
  color: var(--accent-light);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all var(--duration) var(--ease);
}

.app-link-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.app-link-btn.line-btn {
  border-color: #06C755;
  background: rgba(6, 199, 85, 0.15);
  color: #06C755;
}

.app-link-btn.line-btn:hover {
  background: #06C755;
  color: #fff;
}

/* Subtype tag */
.deal-subtype {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
}

/* News search hint */
.news-search-hint {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.news-search-hint a {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 600;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  transition: all var(--duration) var(--ease);
}

.news-search-hint a:hover {
  background: var(--accent);
  color: #fff;
}

/* Settings button (desktop) */
.settings-btn {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 16px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.settings-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
}

/* Active filter tags in stats bar */
.active-filters-display {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  color: var(--accent-light);
}

.active-filter-clear {
  font-family: var(--font);
  font-size: 0.75rem;
  background: none;
  border: none;
  color: var(--accent-light);
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.active-filter-clear:hover {
  opacity: 1;
}

/* --- No Results --- */
.no-results {
  text-align: center;
  padding: var(--sp-2xl);
  color: var(--text-muted);
}

.no-results-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--sp-md);
  opacity: 0.4;
}

.clear-filters-btn {
  margin-top: var(--sp-md);
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 10px 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--accent-light);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.clear-filters-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* --- Footer --- */
#footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
  border-top: 1px solid var(--border-card);
}

.footer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-text small {
  opacity: 0.6;
}

/* === NOTIFICATION BANNER === */
.notification-banner {
  background: linear-gradient(135deg, var(--accent), #ff6b3b);
  color: #fff;
  position: relative;
  z-index: 95;
  animation: slideDown 0.4s var(--ease);
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.notification-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-sm) var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

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

.notification-text {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 600;
}

.notification-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.notification-close:hover { background: rgba(255,255,255,0.35); }

/* === MAIN TABS === */
.main-tabs {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
  gap: 2px;
  position: sticky;
  top: 65px;
  z-index: 95;
  background: var(--bg-controls);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-card);
}

.main-tab {
  flex: 1;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: var(--sp-sm) var(--sp-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all var(--duration) var(--ease);
  text-align: center;
}

.main-tab:hover { color: var(--accent-light); }

.main-tab.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

.tab-badge {
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-left: 4px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* === SORT + FILTER ROW === */
.sort-filter-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.sort-filter-row .sort-wrap { flex: 1; }

.filter-toggle-btn {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  background: var(--accent-glow);
  color: var(--accent-light);
  cursor: pointer;
  white-space: nowrap;
  display: none; /* shown only on mobile */
  transition: all var(--duration) var(--ease);
  position: relative;
}

.filter-toggle-btn:hover {
  background: var(--accent);
  color: #fff;
}

.filter-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--red);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === EC SALE TAB CONTENT === */
.ec-sale-tab-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-lg);
}

.ec-sale-tab-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--sp-lg);
  color: var(--text-primary);
}

.ec-sale-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-md);
}

/* === FILTER MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.filter-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 201;
  max-height: 85vh;
  background: var(--bg-secondary);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s var(--ease);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border-card);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
}

.modal-close-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.modal-body {
  overflow-y: auto;
  padding: var(--sp-md) var(--sp-lg);
  flex: 1;
}

.modal-section {
  margin-bottom: var(--sp-lg);
}

.modal-section .filter-chips {
  margin-top: var(--sp-sm);
}

.modal-footer {
  padding: var(--sp-md) var(--sp-lg);
  border-top: 1px solid var(--border-card);
}

.modal-apply-btn {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.modal-apply-btn:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

/* === TOGGLE SWITCH === */
.setting-row {
  margin-top: var(--sp-sm);
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: all var(--duration) var(--ease);
}

.toggle-label:hover {
  border-color: var(--accent);
}

.toggle-input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  transition: all 0.3s var(--ease);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s var(--ease);
}

.toggle-input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: #fff;
}

/* === BRAND HIDE LIST === */
.brand-search-wrap {
  margin-top: var(--sp-sm);
}

.brand-search-input {
  width: 100%;
  padding: 8px 14px;
  font-family: var(--font);
  font-size: 0.82rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: all var(--duration) var(--ease);
}

.brand-search-input:focus {
  border-color: var(--accent);
}

.brand-search-input::placeholder { color: var(--text-muted); }

.brand-hide-list {
  max-height: 200px;
  overflow-y: auto;
  margin-top: var(--sp-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.brand-hide-item {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 10px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.brand-hide-item:hover {
  border-color: var(--red);
  color: var(--red);
}

.brand-hide-item.hidden {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
  text-decoration: line-through;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header-inner {
    padding: var(--sp-sm) var(--sp-md);
  }

  .logo-sub { display: none; }
  .logo-text { font-size: 1.3rem; }

  .main-tabs {
    top: 53px;
    padding: 0 var(--sp-md);
  }

  .controls {
    top: 93px; /* header(53) + tabs(40) */
  }

  .controls-inner {
    padding: var(--sp-sm) var(--sp-md);
    gap: var(--sp-sm);
  }

  /* Hide desktop filters on mobile, show filter button instead */
  .desktop-filters { display: none !important; }
  .filter-toggle-btn { display: flex !important; }

  .sort-wrap { flex-direction: column; gap: 6px; }

  .deals-grid { grid-template-columns: 1fr; }
  #main { padding: var(--sp-md); }

  .ec-sale-cards-grid { grid-template-columns: 1fr; }
  .ec-sale-tab-content { padding: var(--sp-md); }

  .deal-title {
    font-size: 0.9rem;
    padding-right: 70px;
  }

  .deal-card { padding: var(--sp-md); }

  .notification-inner { padding: var(--sp-sm) var(--sp-md); }
}

@media (min-width: 769px) {
  /* Desktop: always show inline filters, hide modal button */
  .filter-toggle-btn { display: none !important; }
  .desktop-filters { display: block; }
}

@media (max-width: 380px) {
  .sort-btns { gap: 4px; }
  .sort-btn { padding: 5px 10px; font-size: 0.72rem; }
  .chip { padding: 4px 8px; font-size: 0.68rem; }
}

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