/* ==========================================================================
   Shopee Deal Finder — Modern E-commerce & Deal Tracker Design System
   ========================================================================== */

:root {
  --font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Light Theme Palette */
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --card: #ffffff;
  --card-glass: rgba(255, 255, 255, 0.94);
  --card-hover: #ffffff;
  --fg: #0f172a;
  --fg-heading: #020617;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-focus: #cbd5e1;
  --line-light: rgba(226, 232, 240, 0.7);
  
  /* Shopee Radiant Accents */
  --accent: #f94d2b;
  --accent-hover: #e03b19;
  --accent-dark: #c82e0e;
  --accent-gradient: linear-gradient(135deg, #ff5722 0%, #ee3a12 100%);
  --accent-gradient-hover: linear-gradient(135deg, #ff6b3d 0%, #f94d2b 100%);
  --accent-light: rgba(249, 77, 43, 0.08);
  --accent-glow: rgba(249, 77, 43, 0.22);
  --hero-glow: radial-gradient(circle at 50% -20px, rgba(249, 77, 43, 0.1) 0%, rgba(249, 77, 43, 0) 70%);
  
  /* Price Movement Semantics */
  --down: #10b981;
  --down-dark: #059669;
  --down-bg: rgba(16, 185, 129, 0.1);
  --down-glow: rgba(16, 185, 129, 0.2);
  --up: #f43f5e;
  --up-dark: #e11d48;
  --up-bg: rgba(244, 63, 94, 0.1);
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info: #0ea5e9;
  --info-bg: rgba(14, 165, 233, 0.1);

  /* Shadows & Depth */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.12), 0 4px 16px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 8px 20px -2px rgba(249, 77, 43, 0.25);
  --shadow-card-hover: 0 14px 32px -6px rgba(15, 23, 42, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.04);

  /* Geometry */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #0a0e17;
  --bg-subtle: #101622;
  --card: #131b28;
  --card-glass: rgba(19, 27, 40, 0.92);
  --card-hover: #172232;
  --fg: #f1f5f9;
  --fg-heading: #ffffff;
  --muted: #94a3b8;
  --muted-light: #64748b;
  --line: rgba(255, 255, 255, 0.08);
  --line-focus: rgba(255, 255, 255, 0.18);
  --line-light: rgba(255, 255, 255, 0.04);
  
  --accent: #ff5722;
  --accent-hover: #ff6b3d;
  --accent-dark: #e03b19;
  --accent-gradient: linear-gradient(135deg, #ff5722 0%, #ee3a12 100%);
  --accent-gradient-hover: linear-gradient(135deg, #ff6b3d 0%, #ff5722 100%);
  --accent-light: rgba(255, 87, 34, 0.12);
  --accent-glow: rgba(255, 87, 34, 0.22);
  --hero-glow: radial-gradient(circle at 50% -20px, rgba(255, 87, 34, 0.15) 0%, rgba(10, 14, 23, 0) 75%);
  
  --down-bg: rgba(16, 185, 129, 0.14);
  --up-bg: rgba(244, 63, 94, 0.14);
  --warning-bg: rgba(245, 158, 11, 0.14);
  --info-bg: rgba(14, 165, 233, 0.14);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 8px 24px -2px rgba(255, 87, 34, 0.25);
  --shadow-card-hover: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg: #0a0e17;
    --bg-subtle: #101622;
    --card: #131b28;
    --card-glass: rgba(19, 27, 40, 0.92);
    --card-hover: #172232;
    --fg: #f1f5f9;
    --fg-heading: #ffffff;
    --muted: #94a3b8;
    --muted-light: #64748b;
    --line: rgba(255, 255, 255, 0.08);
    --line-focus: rgba(255, 255, 255, 0.18);
    --line-light: rgba(255, 255, 255, 0.04);
    
    --accent: #ff5722;
    --accent-hover: #ff6b3d;
    --accent-dark: #e03b19;
    --accent-gradient: linear-gradient(135deg, #ff5722 0%, #ee3a12 100%);
    --accent-gradient-hover: linear-gradient(135deg, #ff6b3d 0%, #ff5722 100%);
    --accent-light: rgba(255, 87, 34, 0.12);
    --accent-glow: rgba(255, 87, 34, 0.22);
    --hero-glow: radial-gradient(circle at 50% -20px, rgba(255, 87, 34, 0.15) 0%, rgba(10, 14, 23, 0) 75%);
    
    --down-bg: rgba(16, 185, 129, 0.14);
    --up-bg: rgba(244, 63, 94, 0.14);
    --warning-bg: rgba(245, 158, 11, 0.14);
    --info-bg: rgba(14, 165, 233, 0.14);

    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.65);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 8px 24px -2px rgba(255, 87, 34, 0.25);
    --shadow-card-hover: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 520px;
  background: var(--hero-glow);
  pointer-events: none;
  z-index: 0;
}

::selection {
  background-color: var(--accent);
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--line-focus);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

a, a:link, a:visited {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Main Layout Wrapper */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px 96px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.navbar {
  position: sticky;
  top: 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-smooth);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  color: #fff;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-smooth);
}

.brand-logo:hover .logo-icon {
  transform: scale(1.06) rotate(-2deg);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
}

.brand-text h1,
.brand-text .brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--fg-heading);
  line-height: 1.2;
  margin: 0;
}

.header-desc {
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 2px;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Status Pulse Pill */
.status-pulse-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--down-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--down-dark);
}
[data-theme="dark"] .status-pulse-pill {
  color: var(--down);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--down);
  position: relative;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 50%;
  background: var(--down);
  opacity: 0.6;
  animation: pulse-ring 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.btn-icon:hover {
  border-color: var(--line-focus);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.btn-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

/* ==========================================================================
   Hero Command Search Hub
   ========================================================================== */
.search-section {
  margin-bottom: 28px;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.hero-header-content {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 24px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent-light);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.hero-headline {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--fg-heading);
  letter-spacing: -0.03em;
  line-height: 1.28;
  margin-bottom: 8px;
}

.hero-subheadline {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.5;
}

/* Search Box Container */
.search-box-container {
  max-width: 820px;
  margin: 0 auto 20px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 6px 8px 6px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-smooth);
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--accent-light), var(--shadow-md);
}

.search-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-right: 12px;
  flex-shrink: 0;
}

.search-ic {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

.input-wrapper input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--fg-heading);
  min-width: 0;
  padding: 8px 0;
}

.input-wrapper input::placeholder {
  color: var(--muted-light);
  font-size: 0.95rem;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-clear-input {
  background: var(--line);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}
.btn-clear-input:hover {
  background: var(--muted);
  color: #fff;
}

.btn-search-hero {
  padding: 10px 22px;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all 0.25s var(--ease-smooth);
  letter-spacing: -0.01em;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(249, 77, 43, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--fg);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--line-focus);
  transform: translateY(-1px);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Sample Prompts */
.sample-prompts {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.prompt-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.prompt-tag {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-tag:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Cheaper Results & Message container */
#msg {
  margin-top: 18px;
}

.msg {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  animation: fadeIn 0.3s ease;
}

.msg.info {
  background: var(--info-bg);
  color: var(--fg-heading);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.msg.warn {
  background: var(--warning-bg);
  color: var(--fg-heading);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.cheaper-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.cheaper-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.25s ease;
}

.cheaper-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.cheaper-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--fg-heading);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cheaper-card-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Market Pulse Stats Grid
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-focus);
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrapper svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.stat-icon-wrapper.primary {
  background: var(--accent-light);
  color: var(--accent);
}
.stat-icon-wrapper.success {
  background: var(--down-bg);
  color: var(--down);
}
.stat-icon-wrapper.info {
  background: var(--info-bg);
  color: var(--info);
}
.stat-icon-wrapper.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--fg-heading);
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-val.success-color {
  color: var(--down);
}

.stat-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

/* ==========================================================================
   Shop Showcase Carousel
   ========================================================================== */
.shop-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.shop-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-badge-icon {
  font-size: 1.25rem;
}

.shop-title-row h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--fg-heading);
  letter-spacing: -0.02em;
}

.shop-count-badge {
  display: inline-flex;
  padding: 2px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.shop-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 3px;
}

.shop-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  width: 220px;
  transition: all 0.2s ease;
}

.shop-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  width: 260px;
}

.shop-search-wrap svg {
  width: 15px;
  height: 15px;
  stroke: var(--muted);
  stroke-width: 2.2;
  fill: none;
  margin-right: 8px;
  flex-shrink: 0;
}

.shop-search-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  color: var(--fg);
  width: 100%;
}

#shop-search-clear {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
}
#shop-search-clear.visible {
  display: block;
}

.shop-nav-arrows {
  display: flex;
  gap: 6px;
}

.shop-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shop-nav-btn:hover:not(:disabled) {
  background: var(--card);
  border-color: var(--line-focus);
  color: var(--accent);
}

.shop-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Shop View Tabs */
.shop-view-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.shop-view-tabs::-webkit-scrollbar { display: none; }

.shop-view-tab {
  padding: 7px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.shop-view-tab:hover {
  color: var(--fg-heading);
  border-color: var(--line-focus);
}

.shop-view-tab.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.shop-carousel-wrapper {
  position: relative;
}

.shop-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
}

.shop-card {
  min-width: 240px;
  max-width: 260px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: all 0.25s var(--ease-smooth);
}

.shop-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.shop-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.shop-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.shop-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
}

.shop-mall-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #d0011b;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  border: 1px solid #fff;
}

.shop-info {
  flex: 1;
  min-width: 0;
}

.shop-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shop-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--fg-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-verified-ic {
  flex-shrink: 0;
}

.shop-period-badge {
  margin-top: 3px;
}

.shop-badge-active {
  font-size: 0.72rem;
  color: var(--down);
  font-weight: 600;
}
.shop-badge-expiry {
  font-size: 0.72rem;
  color: var(--muted);
}

.shop-card-meta {
  margin-bottom: 12px;
}

.shop-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--muted);
}

.shop-tag-prods {
  color: var(--accent);
  background: var(--accent-light);
}

.shop-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-shop-filter {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}

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

/* ==========================================================================
   Catalog Toolbar & Category Chips
   ========================================================================== */
.toolbar {
  margin-bottom: 24px;
}

.toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.catalog-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-heading-row h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--fg-heading);
  letter-spacing: -0.02em;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* View Mode Switcher */
.view-switch {
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 3px;
  box-shadow: var(--shadow-xs);
}

.view-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

.view-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

/* Custom Glassmorphic Sort Dropdown */
.custom-dropdown {
  position: relative;
}

.custom-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--fg-heading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  min-width: 190px;
  transition: all 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: var(--line-focus);
}

.selected-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.custom-dropdown.open .chevron {
  transform: rotate(180deg);
}

.chevron {
  transition: transform 0.2s ease;
  color: var(--muted);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--card-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 90;
  display: none;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dropdown.open .custom-select-menu {
  display: block;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.custom-option:hover {
  background: var(--bg-subtle);
  color: var(--fg-heading);
}

.custom-option.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.custom-option .check-ic {
  display: none;
  stroke: var(--accent);
}
.custom-option.active .check-ic {
  display: block;
}

.option-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Category Chips Bar */
.chips-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chips-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.chips-nav-btn:hover:not(:disabled) {
  border-color: var(--line-focus);
  color: var(--accent);
}

.chips-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 2px;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }

.chips-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
  transition: all 0.15s ease;
}

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

/* Category Picker Modal / Bottom Sheet */
.category-modal {
  max-width: 580px;
  width: 92%;
}

.category-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.category-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-modal-title h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--fg-heading);
}

.category-grid-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 2px;
}

.cat-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--fg);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.cat-picker-item:hover {
  border-color: var(--line-focus);
  background: var(--card);
  transform: translateY(-1px);
}

.cat-picker-item.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.cat-picker-item.active .n {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.cat-picker-item .n {
  margin-left: auto;
  font-size: 0.72rem;
  background: var(--bg-subtle);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chip:hover {
  border-color: var(--line-focus);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.chip.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.chip .n {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.chip.active .n {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* ==========================================================================
   Summary Banner Cards
   ========================================================================== */
.summary {
  margin-bottom: 20px;
}

.summary-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: var(--shadow-xs);
}

.summary-card.stats {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.summary-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.summary-stat.down .stat-num { color: var(--down); }
.summary-stat.up .stat-num { color: var(--up); }
.summary-stat.flat .stat-num { color: var(--muted); }

.summary-stat .stat-num {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.summary-total-badge {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--bg-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Product Grid & List Cards
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.28s var(--ease-smooth);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-focus);
  box-shadow: var(--shadow-card-hover);
}

.card.in-compare {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light), var(--shadow-md);
}

/* Ribbons */
.ribbon-best {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glow);
  z-index: 2;
}

.ribbon-drop {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--down);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  z-index: 2;
}

.title-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.title-badge {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.card h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--fg-heading);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Price Box */
.price-box {
  margin-bottom: 12px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.old-price {
  font-size: 0.85rem;
  color: var(--muted-light);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.chg-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
}

.chg-badge.down {
  background: var(--down-bg);
  color: var(--down);
}
.chg-badge.up {
  background: var(--up-bg);
  color: var(--up);
}

.savings-row {
  margin-top: 4px;
}

.savings-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--down);
}

/* Meta info */
.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.shop-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.tag {
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  font-size: 0.72rem;
  font-weight: 600;
}
.tag.warn {
  background: var(--warning-bg);
  color: var(--warning);
}

/* Range bar */
.range {
  margin-bottom: 16px;
}

.range-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.range-status {
  font-size: 0.72rem;
  font-weight: 700;
}
.range-status.good { color: var(--down); }
.range-status.fair { color: var(--warning); }
.range-status.high { color: var(--up); }

.range-bar {
  height: 6px;
  background: var(--line);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}

.range-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: var(--radius-full);
}

.range-lbl {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--muted-light);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* Sparkline wrap */
.spark-wrap {
  margin-top: 6px;
  margin-bottom: 16px;
}

.spark-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.spark {
  width: 100%;
  height: 48px;
  display: block;
}

/* Card Action Buttons */
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-light);
}

.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
}

.card-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--line-focus);
}

.card-btn.btn-chart {
  flex: 1;
}

.card-btn.btn-compare {
  padding: 8px 10px;
}

.card-btn.btn-compare .icon-check {
  display: none;
}

.card-btn.btn-compare.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.card-btn.btn-compare.active .icon-compare {
  display: none;
}
.card-btn.btn-compare.active .icon-check {
  display: block;
  stroke: var(--accent);
}

.card-btn.btn-shopee {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.card-btn.btn-shopee:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
}

/* List View Variant */
.grid.list-view {
  grid-template-columns: 1fr;
  gap: 12px;
}

.grid.list-view .card {
  flex-direction: row;
  align-items: center;
  padding: 16px 20px;
}

.grid.list-view .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 24px;
}

.grid.list-view .spark-wrap {
  width: 140px;
  margin: 0;
  flex-shrink: 0;
}

.grid.list-view .card-actions {
  border-top: none;
  padding-top: 0;
  margin-left: 20px;
  flex-shrink: 0;
}

/* Skeletons */
.sk-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sk-line {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--line) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}

.sk-title { height: 20px; width: 85%; margin-bottom: 12px; }
.sk-price { height: 26px; width: 45%; margin-bottom: 12px; }
.sk-meta { height: 16px; width: 60%; }
.sk-btn { height: 36px; flex: 1; }

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 36px;
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.page-size-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-size-select {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.82rem;
  color: var(--fg);
  outline: none;
  cursor: pointer;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--line-focus);
  background: var(--bg-subtle);
  color: var(--accent);
}

.page-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ==========================================================================
   Modals & Dialogs
   ========================================================================== */
dialog {
  border: none;
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--fg);
  padding: 30px;
  max-width: 640px;
  width: 92%;
  margin: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  position: fixed;
  inset: 0;
  z-index: 200;
  max-height: 88vh;
  overflow-y: auto;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dlg-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dlg-close:hover {
  background: var(--card);
  color: var(--fg-heading);
  border-color: var(--line-focus);
}

.dlg-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--fg-heading);
  line-height: 1.35;
  margin-bottom: 8px;
  padding-right: 36px;
}

.dlg-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.dlg-shop-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--fg);
}

.price-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.price-hero-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.hero-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.hero-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hero-value.current { color: var(--accent); }
.hero-value.low { color: var(--down); }
.hero-value.high { color: var(--up); }

.hero-subbadge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
}
.hero-subbadge.down { background: var(--down-bg); color: var(--down); }
.hero-subbadge.up { background: var(--up-bg); color: var(--up); }
.hero-subbadge.low-best { background: var(--down-bg); color: var(--down); }

.deal-banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.deal-banner.best {
  background: var(--down-bg);
  color: var(--down-dark);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
[data-theme="dark"] .deal-banner.best { color: var(--down); }

.deal-banner.good {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.deal-banner.neutral {
  background: var(--bg-subtle);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* Hover Chart */
.hover-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 10px;
}

.chart {
  width: 100%;
  height: 220px;
  display: block;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.actions a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-glow);
}

.actions .ghost {
  padding: 12px 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

/* Comparison Dialog Table */
#compareDlg {
  max-width: 860px;
}

.compare-table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.compare-table th, .compare-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.compare-table th.row-label {
  font-weight: 600;
  color: var(--muted);
  width: 140px;
  white-space: nowrap;
}

.compare-table td.cheapest-col {
  background: var(--down-bg);
  border-radius: var(--radius-sm);
}

.compare-price-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--fg-heading);
}

.compare-price-val.best {
  color: var(--down);
}

.compare-best-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--down);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: 4px;
}

.compare-remove-cell button {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  color: var(--muted);
  cursor: pointer;
}
.compare-remove-cell button:hover {
  background: var(--up);
  color: #fff;
}

/* Floating Compare Dock Bar */
.compare-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 150;
  max-width: 90vw;
  animation: slideUp 0.3s var(--ease-smooth);
}

@keyframes slideUp {
  from { transform: translate(-50%, 100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.compare-bar-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg-heading);
  white-space: nowrap;
}

.compare-bar-items {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  max-width: 420px;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.compare-chip .name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-chip button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
}
.compare-chip button:hover {
  color: var(--up);
}

.compare-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-compare-clear {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
}
.btn-compare-clear:hover {
  color: var(--fg-heading);
}

.btn-compare-open {
  padding: 8px 18px;
  font-size: 0.82rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Mobile Bottom Navigation Bar
   ========================================================================== */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 8px 16px max(8px, env(safe-area-inset-bottom));
  z-index: 100;
  justify-content: space-around;
}

@media (max-width: 640px) {
  .mobile-bottom-bar { display: flex; }
  .compare-bar { bottom: 70px; }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

.nav-item.active {
  color: var(--accent);
}

/* ==========================================================================
   About section
   ========================================================================== */
.about-section {
  margin-top: 40px;
}

.about-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-xs);
}

.about-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg-heading);
  margin: 0 0 12px;
}

.about-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 12px;
}

.about-card p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  margin-top: 48px;
}

.footer-note-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.footer-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.footer-text {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--fg-heading);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastSlideIn 0.25s var(--ease-smooth);
}

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

/* Empty State Classes */
.empty-state-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.empty-state-icon {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg-heading);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--muted);
}

.chart-empty-box {
  padding: 28px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
}

/* ==========================================================================
   Comprehensive Responsive & Mobile Phone Optimizations
   ========================================================================== */

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

/* Tablet Breakpoint (<= 1024px) */
@media (max-width: 1024px) {
  .wrap {
    padding: 16px 20px 96px;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .shop-section {
    padding: 20px 22px;
  }
}

/* Small Tablet & Large Phone Breakpoint (<= 768px) */
@media (max-width: 768px) {
  .navbar {
    padding: 10px 16px;
    margin-bottom: 20px;
  }
  .brand-text h1,
  .brand-text .brand-title {
    font-size: 1.15rem;
  }
  .hero-card {
    padding: 24px 20px;
  }
  .hero-headline {
    font-size: 1.35rem;
  }
}

/* Standard Smartphone Breakpoint (<= 640px) */
@media (max-width: 640px) {
  .wrap {
    padding: 8px 12px calc(80px + env(safe-area-inset-bottom));
  }

  /* Navigation Bar */
  .navbar {
    top: 6px;
    padding: 8px 12px;
    margin-bottom: 14px;
    border-radius: var(--radius-md);
    gap: 8px;
  }
  .brand-logo {
    gap: 10px;
  }
  .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
  }
  .logo-icon svg {
    width: 18px;
    height: 18px;
  }
  .brand-text h1,
  .brand-text .brand-title {
    font-size: 1.05rem;
    letter-spacing: -0.02em;
  }
  .header-desc {
    display: none;
  }
  .header-actions {
    gap: 6px;
  }
  .status-pulse-pill {
    padding: 4px 8px;
    font-size: 0.72rem;
    gap: 5px;
  }
  .pulse-dot {
    width: 6px;
    height: 6px;
  }
  .btn-icon {
    padding: 6px 10px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
  }
  #theme-text {
    display: none;
  }

  /* Hero Command Search Hub */
  .hero-card {
    padding: 14px 12px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
  }
  .hero-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    margin-bottom: 4px;
  }
  .hero-headline {
    font-size: 1.12rem;
    line-height: 1.25;
    margin-bottom: 4px;
  }
  .hero-subheadline {
    display: none;
  }
  .search-box-container {
    margin-bottom: 10px;
  }
  .input-wrapper {
    padding: 4px 4px 4px 10px;
    border-radius: var(--radius-md);
  }
  .search-icon-box {
    margin-right: 8px;
  }
  .search-ic {
    width: 17px;
    height: 17px;
  }
  .input-wrapper input {
    font-size: 16px; /* Prevents auto iOS Safari zoom on focus */
    padding: 6px 0;
  }
  .btn-search-hero {
    padding: 8px 14px;
    font-size: 0.82rem;
    min-height: 38px;
    border-radius: var(--radius-sm);
  }
  .btn-clear-input {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
  }
  .sample-prompts {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 2px 0 6px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 8px;
  }
  .sample-prompts::-webkit-scrollbar {
    display: none;
  }
  .prompt-label {
    font-size: 0.72rem;
    flex-shrink: 0;
  }
  .prompt-tag {
    font-size: 0.72rem;
    padding: 4px 10px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Market Pulse Stats (2x2 Grid) */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }
  .stat-card {
    padding: 8px 10px;
    gap: 8px;
    border-radius: var(--radius-md);
  }
  .stat-icon-wrapper {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
  }
  .stat-icon-wrapper svg {
    width: 14px;
    height: 14px;
  }
  .stat-val {
    font-size: 1.05rem;
  }
  .stat-lbl {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  /* Shop Showcase Carousel */
  .shop-section {
    padding: 12px 10px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
  }
  .shop-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
  }
  .shop-title-row h2 {
    font-size: 1rem;
  }
  .shop-subtitle {
    display: none;
  }
  .shop-header-actions {
    width: 100%;
  }
  .shop-search-wrap {
    width: 100% !important;
    padding: 6px 10px;
  }
  .shop-nav-arrows {
    display: none;
  }
  .shop-view-tabs {
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 4px;
  }
  .shop-view-tab {
    padding: 4px 10px;
    font-size: 0.72rem;
  }
  .shop-scroll {
    gap: 8px;
    padding-bottom: 6px;
  }
  .shop-card {
    min-width: 135px;
    max-width: 145px;
    padding: 10px;
    border-radius: var(--radius-md);
  }
  .shop-avatar-wrap {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  .shop-card-name {
    font-size: 0.78rem;
  }
  .shop-card-cat {
    font-size: 0.65rem;
  }
  .shop-card-stats {
    font-size: 0.68rem;
  }
  .shop-action-btn {
    padding: 5px 8px;
    font-size: 0.7rem;
    border-radius: var(--radius-sm);
  }

  /* Catalog Controls & Category Chips */
  .catalog-toolbar {
    margin-bottom: 8px;
    padding: 0 2px;
    gap: 6px;
  }
  .catalog-heading-row h2 {
    font-size: 0.95rem;
  }
  .results-counter {
    font-size: 0.72rem;
  }
  .results-count {
    font-size: 0.78rem;
  }
  .toolbar-actions {
    gap: 6px;
  }
  .custom-sort-dropdown {
    min-width: 130px;
  }
  .sort-trigger {
    padding: 5px 8px;
    font-size: 0.72rem;
    gap: 4px;
  }
  .view-mode-switch {
    padding: 2px;
  }
  .view-btn {
    padding: 5px 7px;
    font-size: 0.72rem;
  }
  .view-btn svg {
    width: 13px;
    height: 13px;
  }
  /* Category Chips Bar on Mobile */
  .chips-bar-wrapper {
    gap: 6px;
    margin-bottom: 8px;
    width: 100%;
  }
  .chips-nav-btn {
    display: none !important;
  }
  .chips {
    gap: 6px;
    padding: 2px 2px 4px;
    scroll-snap-type: x proximity;
  }
  .chip {
    padding: 5px 10px;
    font-size: 0.72rem;
    min-height: 30px;
    scroll-snap-align: start;
  }
  .chips-expand-btn {
    padding: 5px 8px;
    font-size: 0.7rem;
    gap: 4px;
  }
  .category-grid-picker {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .cat-picker-item {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  /* Summary Section on Mobile */
  .summary {
    margin-bottom: 4px;
  }

  /* Product Grid & Cards */
  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }
  .card {
    padding: 12px;
    gap: 8px;
    border-radius: var(--radius-md);
  }
  .ribbon-best, .ribbon-drop {
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    padding: 2px 6px;
  }
  .card h3 {
    font-size: 0.88rem;
    line-height: 1.35;
    margin-bottom: 6px;
    -webkit-line-clamp: 2;
  }
  .meta {
    margin-bottom: 6px;
    font-size: 0.72rem;
    gap: 4px;
  }
  .price-row {
    gap: 6px;
    margin-bottom: 6px;
  }
  .price-current {
    font-size: 1.18rem;
  }
  .price-old {
    font-size: 0.75rem;
  }
  .discount-tag {
    font-size: 0.68rem;
    padding: 1px 5px;
  }
  .range {
    margin: 6px 0;
  }
  .range-status {
    font-size: 0.68rem;
  }
  .range-lbl {
    font-size: 0.65rem;
  }
  .sparkline-wrap {
    height: 28px;
    margin: 4px 0;
  }
  .card-actions {
    margin-top: 8px;
    padding-top: 8px;
    gap: 6px;
  }
  .card-btn {
    font-size: 0.75rem;
    padding: 7px 10px;
    min-height: 36px;
    border-radius: var(--radius-sm);
  }

  /* List View Adaptation on Mobile */
  .grid.list-view .card {
    padding: 12px;
    gap: 10px;
    flex-direction: column;
  }
  .grid.list-view .card-chart-col {
    display: none;
  }
  .grid.list-view .card-side-col {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--line);
    padding-top: 8px;
    margin-top: 4px;
  }

  /* Pagination */
  .pagination-container {
    padding: 12px;
    gap: 10px;
    flex-direction: column;
    align-items: center;
  }
  .pagination-info {
    font-size: 0.78rem;
  }
  .page-btn {
    min-width: 32px;
    height: 32px;
    font-size: 0.78rem;
  }

  /* Modals: Bottom Sheet Presentation */
  dialog {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    padding: 18px 14px max(20px, env(safe-area-inset-bottom));
    margin: 0;
    border: 1px solid var(--line);
    border-bottom: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .dlg-close {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
  }
  .dlg-title {
    font-size: 1.05rem;
    padding-right: 32px;
  }
  .dlg-meta {
    font-size: 0.75rem;
    margin-bottom: 14px;
  }
  .price-hero-grid {
    gap: 6px;
    margin-bottom: 14px;
  }
  .price-hero-item {
    padding: 8px 6px;
    border-radius: var(--radius-sm);
  }
  .hero-label {
    font-size: 0.68rem;
  }
  .hero-value {
    font-size: 1.05rem;
  }
  .deal-banner {
    padding: 10px 12px;
    font-size: 0.78rem;
    margin-bottom: 14px;
  }
  .chart-section-title {
    font-size: 0.82rem;
    margin-bottom: 8px;
  }
  .chart-wrap {
    padding: 8px 4px;
    border-radius: var(--radius-md);
  }
  .modal-action-row {
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
  }
  .modal-action-row .btn-primary,
  .modal-action-row .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    min-height: 44px;
  }

  /* Compare Modal */
  #dlg-compare {
    padding: 16px 12px max(20px, env(safe-area-inset-bottom));
  }
  .compare-table-wrap {
    margin: 12px 0;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }
  .compare-table th, .compare-table td {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
  .compare-prod-name {
    font-size: 0.78rem;
    max-width: 110px;
  }

  /* Floating Compare Dock */
  .compare-bar {
    bottom: calc(58px + env(safe-area-inset-bottom));
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    transform: none;
    padding: 8px 12px;
    border-radius: var(--radius-full);
    gap: 8px;
  }
  .compare-bar-header {
    font-size: 0.78rem;
  }
  .compare-bar-items {
    max-width: 160px;
    gap: 4px;
  }
  .compare-chip {
    padding: 3px 8px;
    font-size: 0.7rem;
  }
  .compare-chip .name {
    max-width: 60px;
  }
  .btn-compare-open {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  .btn-compare-clear {
    font-size: 0.72rem;
    padding: 4px 6px;
  }

  /* Mobile Bottom Navigation */
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 4px 12px max(4px, env(safe-area-inset-bottom));
    z-index: 100;
    justify-content: space-around;
  }
  .nav-item {
    font-size: 0.68rem;
    padding: 4px 8px;
    min-width: 48px;
  }
  .nav-item svg {
    width: 18px;
    height: 18px;
  }

  /* Footer */
  .app-footer {
    margin-top: 28px;
  }
  .footer-note-card {
    padding: 14px 16px;
    gap: 12px;
    border-radius: var(--radius-md);
  }
  .footer-icon {
    font-size: 1.15rem;
  }
  .footer-text {
    font-size: 0.75rem;
  }

  /* Toast Notifications */
  .toast-container {
    top: calc(10px + env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    align-items: center;
  }
  .toast {
    font-size: 0.78rem;
    padding: 8px 14px;
    width: auto;
    text-align: center;
  }
}

/* Extra Compact Phones (<= 380px, e.g. iPhone SE, Galaxy A0) */
@media (max-width: 380px) {
  .wrap {
    padding: 6px 8px calc(76px + env(safe-area-inset-bottom));
  }
  .brand-text h1,
  .brand-text .brand-title {
    font-size: 0.95rem;
  }
  .hero-headline {
    font-size: 1.05rem;
  }
  .stat-val {
    font-size: 1rem;
  }
  .price-current {
    font-size: 1.15rem;
  }
  .price-hero-grid {
    grid-template-columns: 1fr;
  }
  .compare-bar-items {
    max-width: 110px;
  }
}

/* Touch Input & Ergonomics */
@media (hover: none) and (pointer: coarse) {
  .btn-primary:active,
  .btn-secondary:active,
  .btn-icon:active,
  .prompt-tag:active,
  .category-chip:active,
  .shop-card:active,
  .card:active {
    transform: scale(0.98);
    opacity: 0.92;
  }
  .card:hover {
    transform: none;
  }
  .shop-card:hover {
    transform: none;
  }
  .stat-card:hover {
    transform: none;
  }
}

/* Server-rendered pages (/san-pham/*, /danh-muc/*) — no JS, kept minimal */
.ssr-page {
  padding: 8px 0 32px;
}
.ssr-breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.ssr-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.ssr-breadcrumb a:hover {
  color: var(--accent);
}
.ssr-product h1.dlg-title,
.ssr-page h1.dlg-title {
  font-size: 22px;
  margin: 0 0 8px;
}
.ssr-subheading {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-heading);
  margin: 24px 0 12px;
}
.ssr-intro {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 8px;
  max-width: 720px;
}
.ssr-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ssr-history-table th,
.ssr-history-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.ssr-history-table th {
  color: var(--muted);
  font-weight: 600;
}
.ssr-disclosure {
  font-size: 12px;
  color: var(--muted-light);
  margin-top: 10px;
}
.ssr-grid {
  margin-top: 16px;
}
.ssr-grid .card h2 {
  font-size: 15px;
  margin: 0 0 6px;
}
.ssr-grid .card h2 a {
  color: var(--fg-heading);
  text-decoration: none;
}
.ssr-grid .card h2 a:hover {
  color: var(--accent);
}
.ssr-pagination {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  font-size: 14px;
}
.ssr-pagination a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
