:root {
  --bg-primary: #f5f5f7;
  --bg-secondary: #f5f5f7;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-landing: #f5f5f7;
  --bg-icon: #f0f0f2;
  --bg-icon-hover: #1d1d1f;
  --text-primary: #111111;
  --text-secondary: #6b6b6b;
  --text-tertiary: #a1a1aa;
  --accent: #111111;
  --btn-text: #ffffff;
  --accent-soft: rgba(0, 0, 0, 0.04);
  --border: #e5e5e5;
  --border-hover: rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.07), 0 2px 6px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 30px rgba(0, 0, 0, 0.06);
  --dot-color: #999999;
  --divider: rgba(0, 0, 0, 0.06);
  --icon-color: #3f3f46;
  --icon-color-hover: #ffffff;
  --toggle-bg: rgba(0, 0, 0, 0.05);
  --toggle-border: rgba(0, 0, 0, 0.08);
  --toggle-slider-bg: #ffffff;
  --toggle-slider-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  --toggle-icon-active: #111111;
  --toggle-icon-inactive: #a1a1aa;
  --liquid-1: rgba(0, 0, 0, 0.018);
  --liquid-2: rgba(0, 0, 0, 0.012);
  --liquid-3: rgba(0, 0, 0, 0.008);
  --card-glow: 0 0 0 transparent;
  --card-glow-hover: 0 0 40px rgba(0, 0, 0, 0.05);
  --btn-glow: 0 4px 24px rgba(0, 0, 0, 0.15);
  --title-glow: 0 0 60px rgba(0, 0, 0, 0.12);
  --font-heading: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-pill: 100px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.2s var(--ease-out-expo);
  --transition-base: 0.3s var(--ease-out-expo);
  --transition-slow: 0.45s var(--ease-out-expo);
  --transition-page: 0.55s var(--ease-out-quint);
}
[data-theme="dark"] {
  --bg-primary: #09090b;
  --bg-secondary: #0f0f11;
  --bg-card: #18181b;
  --bg-card-hover: #1e1e22;
  --bg-landing: #09090b;
  --bg-icon: #27272a;
  --bg-icon-hover: #f4f4f5;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #52525b;
  --accent: #fafafa;
  --btn-text: #111111;
  --accent-soft: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(255, 255, 255, 0.03);
  --dot-color: #fafafa;
  --divider: rgba(255, 255, 255, 0.06);
  --icon-color: #d4d4d8;
  --icon-color-hover: #18181b;
  --toggle-bg: rgba(255, 255, 255, 0.06);
  --toggle-border: rgba(255, 255, 255, 0.1);
  --toggle-slider-bg: #27272a;
  --toggle-slider-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  --toggle-icon-active: #fafafa;
  --toggle-icon-inactive: #52525b;
  --liquid-1: rgba(255, 255, 255, 0.015);
  --liquid-2: rgba(255, 255, 255, 0.02);
  --liquid-3: rgba(255, 255, 255, 0.01);
  --liquid-shadow: rgba(255, 255, 255, 0.04);
  --card-glow-hover: 0 0 40px rgba(255, 255, 255, 0.04);
  --card-glow-hover: 0 0 40px rgba(255, 255, 255, 0.04);
  --btn-glow: 0 4px 24px rgba(255, 255, 255, 0.08);
  --title-glow: 0 0 80px rgba(255, 255, 255, 0.08);
}
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.15s ease,
              color 0.15s ease;
  overflow-x: hidden;
  min-height: 100vh;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}
.liquid-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.toggle-option svg { width: 16px; height: 16px; }
.enter-btn svg { width: 18px; height: 18px; }
.card-icon svg { width: 32px; height: 32px; stroke-width: 1.5; }
.back-btn svg { width: 20px; height: 20px; }
.empty-icon svg { width: 48px; height: 48px; stroke-width: 1.5; }
.sub-icon svg { width: 20px; height: 20px; }
.category-card,
.bg-card,
.subcategory-item,
.back-btn,
.theme-toggle-pill,
.toggle-slider {
  transition-duration: 0.15s !important;
}
.theme-toggle-pill {
  position: fixed;
  top: 28px;
  right: 28px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.4s var(--ease-out-expo);
}
.theme-toggle-pill:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}
.toggle-option {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.35s var(--ease-out-expo);
}
[data-theme="light"] .toggle-light {
  color: var(--toggle-icon-active);
}
[data-theme="light"] .toggle-dark {
  color: var(--toggle-icon-inactive);
}
[data-theme="dark"] .toggle-light {
  color: var(--toggle-icon-inactive);
}
[data-theme="dark"] .toggle-dark {
  color: var(--toggle-icon-active);
}
.toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--toggle-slider-bg);
  box-shadow: var(--toggle-slider-shadow);
  transition: transform 0.4s var(--ease-spring),
              background 0.4s var(--ease-out-expo),
              box-shadow 0.4s var(--ease-out-expo);
  z-index: 1;
}
[data-theme="dark"] .toggle-slider {
  transform: translateX(34px);
}
.page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-page),
              visibility var(--transition-page),
              transform var(--transition-page);
  transform: translateY(16px) scale(0.985);
  overflow-y: auto;
  z-index: 1;
}
.page.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  z-index: 10;
}
.page.exit {
  opacity: 0;
  transform: translateY(-12px) scale(0.985);
  z-index: 5;
}
.page-inner {
  width: 100%;
  max-width: 1100px;
  padding: 80px 24px;
  margin: 0 auto;
}
.landing {
  background: transparent;
  flex-direction: column;
}
.landing-content {
  text-align: center;
  position: relative;
}
.landing-title {
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 10vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  position: relative;
  will-change: transform;
  animation: titleFadeIn 0.9s var(--ease-out-expo) both,
             breathe 4s ease-in-out 1s infinite;
  text-shadow: var(--title-glow);
}
.landing-title .dot,
.brand .dot {
  color: var(--dot-color);
  transition: color 0.15s ease;
}
.landing-count {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-tertiary);
  font-size: 1.1rem;
  margin-top: 10px;
  margin-bottom: 25px;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.8s var(--ease-out-expo) 0.3s forwards;
}
.enter-btn {
  margin-top: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 38px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--icon-color-hover);
  background: var(--accent);
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
  animation: btnFadeIn 0.9s 0.4s var(--ease-out-expo) both;
  position: relative;
  overflow: hidden;
}
.enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-glow);
}
.enter-btn:hover svg {
  transform: translateX(4px);
}
.enter-btn svg {
  transition: transform var(--transition-base);
}
.enter-btn:active {
  transform: translateY(0) scale(0.97);
}
@keyframes breathe {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(0, -12px, 0) scale(1.02); }
}
@keyframes titleFadeIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes btnFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.home {
  background: transparent;
  align-items: flex-start;
}
.home-header {
  text-align: center;
  padding-top: 72px;
  margin-bottom: 56px;
}
.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-shadow: var(--title-glow);
}
.tagline {
  color: var(--text-tertiary);
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding-bottom: 0;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  text-align: center;
  box-shadow: var(--card-glow);
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.category-card:active {
  transform: translateY(-1px) scale(0.98);
}
.card-icon {
  margin-bottom: 16px;
  opacity: 0.8;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-icon);
  border-radius: var(--radius-md);
  color: var(--icon-color);
  transition: all var(--transition-base);
  position: relative;
  z-index: 1;
}
.category-card:hover .card-icon {
  background: var(--bg-icon-hover);
  color: var(--icon-color-hover);
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .category-card:hover .card-icon {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.06);
}
.card-label {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}
.card-arrow {
  position: absolute;
  bottom: 14px;
  right: 18px;
  font-size: 1.1rem;
  color: var(--text-tertiary);
  opacity: 0;
  transform: translateX(-6px);
  transition: all var(--transition-base);
}
.category-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}
.category-card {
  opacity: 0;
  animation: cardSlideIn 0.55s var(--ease-out-expo) both;
}
.category-card:nth-child(1) { animation-delay: 0.08s; }
.category-card:nth-child(2) { animation-delay: 0.16s; }
.category-card:nth-child(3) { animation-delay: 0.24s; }
.category-card:nth-child(4) { animation-delay: 0.32s; }
@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.receipts-btn {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 28px 32px;
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--card-glow);
  opacity: 0;
  animation: cardSlideIn 0.55s var(--ease-out-expo) 0.4s both;
  cursor: pointer;
}
.receipts-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.receipts-btn:active {
  transform: translateY(-1px) scale(0.98);
}
.receipts-btn svg:first-child {
  width: 24px;
  height: 24px;
  color: var(--icon-color);
  opacity: 0.8;
  transition: all var(--transition-base);
}
.receipts-btn span {
  flex: 1;
  text-align: left;
  margin-left: 18px;
}
.receipts-arrow {
  color: var(--text-tertiary);
  transition: transform var(--transition-base);
}
.receipts-btn:hover .receipts-arrow {
  transform: translateX(4px);
  color: var(--text-primary);
}
.receipts-btn:hover svg:first-child {
  color: var(--text-primary);
}
.category-page,
.sub-page {
  background: transparent;
  align-items: flex-start;
}
.category-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 72px;
  margin-bottom: 36px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.back-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateX(-3px);
  box-shadow: var(--shadow-sm);
}
.category-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.subcategory-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding-bottom: 60px;
}
.subcategory-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.subcategory-item::after {
  content: '→';
  position: absolute;
  right: 18px;
  color: var(--text-tertiary);
  font-size: 1rem;
  opacity: 0;
  transform: translateX(-6px);
  transition: all var(--transition-base);
}
.subcategory-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), var(--card-glow-hover);
}
.subcategory-item:hover::after {
  opacity: 1;
  transform: translateX(0);
}
.subcategory-item:active {
  transform: translateY(0) scale(0.98);
}
.sub-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-icon);
  border-radius: var(--radius-xs);
  color: var(--icon-color);
  flex-shrink: 0;
  transition: all var(--transition-base);
}
.sub-icon svg {
  width: 20px;
  height: 20px;
}
.subcategory-item:hover .sub-icon {
  background: var(--bg-icon-hover);
  color: var(--icon-color-hover);
  transform: scale(1.04);
}
.sub-label {
  font-weight: 500;
  font-size: 0.925rem;
  letter-spacing: -0.005em;
}
.subcategory-item {
  opacity: 0;
  animation: itemFadeIn 0.45s var(--ease-out-expo) both;
}
@keyframes itemFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  gap: 24px;
  animation: emptyFadeIn 0.7s var(--ease-out-expo) both;
}
@keyframes emptyFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.empty-icon {
  color: var(--text-tertiary);
  opacity: 0.4;
  animation: iconFloat 3.5s ease-in-out infinite;
}
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.typing-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.typing-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  display: inline;
}
.typing-cursor {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-tertiary);
  animation: cursorBlink 1s step-end infinite;
  margin-left: 1px;
  vertical-align: baseline;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 20px 0 100px;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.products-grid.visible {
  opacity: 1;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.5s forwards ease;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
.product-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}
.product-img-box {
  width: 100%;
  aspect-ratio: 1;
  background: var(--accent-soft);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .product-img-box {
  background: rgba(255, 255, 255, 0.04);
}
.product-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.placeholder-icon {
  color: var(--text-tertiary);
  opacity: 0.4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.placeholder-icon svg {
  width: 40px;
  height: 40px;
}
.product-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}
.product-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.product-price {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.product-source-tag {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.product-source-tag svg {
  width: 12px;
  height: 12px;
}
.sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 72px;
  margin-bottom: 24px;
}
.sub-header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.custom-dropdown {
  position: relative;
  user-select: none;
}
.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.dropdown-trigger:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}
.dropdown-trigger svg {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}
.custom-dropdown.open .dropdown-trigger svg {
  transform: rotate(180deg);
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  pointer-events: none;
  transition: all 0.2s var(--ease-out-expo);
  overflow: hidden;
  max-height: 250px;
  overflow-y: auto;
}
.custom-dropdown.open .dropdown-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.dropdown-item {
  padding: 8px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dropdown-item:hover {
  background: var(--accent-soft);
  color: var(--text-primary);
}
.dropdown-item.active {
  color: var(--text-primary);
  font-weight: 600;
}
.dropdown-item.active::before {
  content: '✓';
  font-size: 0.7rem;
}
.active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.filter-pill svg {
  width: 12px;
  height: 12px;
}
.search-bar-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  width: 90%;
  max-width: 480px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out-expo);
}
.search-bar-container.visible {
  opacity: 1;
  pointer-events: auto;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-fast);
}
.search-bar:focus-within {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-xl), 0 0 0 3px var(--accent-soft);
}
.search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.search-bar input::placeholder {
  color: var(--text-tertiary);
}
.search-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.sort-container {
  display: none; 
}
.product-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0;
}
.product-overlay:not(.hidden) {
  pointer-events: auto;
  opacity: 1;
}
.overlay-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}
.overlay-window {
  position: relative;
  width: 90%;
  max-width: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
}
.product-overlay:not(.hidden) .overlay-window {
  transform: scale(1);
}
.overlay-window.minimizing {
  transform-origin: bottom right;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}
.window-header {
  height: 40px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: relative;
}
.mac-controls {
  display: flex;
  gap: 8px;
  z-index: 2;
}
.mac-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.mac-btn:hover {
  filter: brightness(1.2);
}
.mac-btn.close { background: #ff5f56; }
.mac-btn.minimize { background: #ffbd2e; }
.mac-btn.maximize { background: #27c93f; }
.window-title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  pointer-events: none;
}
.variant-tabs-container {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 0;
}
.variant-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none; 
}
.variant-tabs::-webkit-scrollbar {
  display: none; 
}
.variant-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.variant-tab:hover {
  background: var(--accent-soft);
}
.variant-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 -2px 0 var(--accent) inset;
}
.window-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.product-image-container {
  width: 100%;
  height: 250px;
  background: var(--accent-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
}
.img-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}
.product-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.product-details h3 {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
}
.product-details .product-price {
  font-size: 1.5rem;
}
.product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.meta-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.meta-tag svg {
  width: 14px;
  height: 14px;
}
.external-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 8px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.external-link-btn svg {
  width: 16px;
  height: 16px;
}
.external-link-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}
.tab-bar-container {
  position: fixed;
  bottom: 0;
  right: 20px;
  z-index: 999;
  max-width: calc(100vw - 40px);
}
.tab-bar {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-direction: row-reverse; 
}
.minimized-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 180px;
  cursor: pointer;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s ease;
  animation: slideUpTab 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transform-origin: bottom;
}
.minimized-tab:hover {
  background: var(--bg-secondary);
  transform: translateY(-4px);
}
.tab-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-primary);
}
.tab-title {
  flex-grow: 1;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-color);
}
.tab-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.tab-close:hover {
  background: rgba(255, 0, 0, 0.1);
  color: #ff5f56;
}
.tab-close svg {
  width: 12px;
  height: 12px;
}
@keyframes slideUpTab {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (max-width: 768px) {
  .page-inner {
    padding: 24px 16px;
  }
  .home-header {
    padding-top: 56px;
    margin-bottom: 32px;
  }
  .category-header,
  .sub-header {
    padding-top: 56px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .sub-header-left {
    width: 100%;
    flex-wrap: wrap;
    gap: 12px;
  }
  .filters-bar {
    width: 100%;
  }
  .categories-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .category-card {
    padding: 24px 16px;
    gap: 12px;
  }
  .card-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
  }
  .card-icon svg {
    width: 26px;
    height: 26px;
  }
  .subcategory-list {
    grid-template-columns: 1fr 1fr;
  }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .theme-toggle-pill {
    top: 16px;
    right: 16px;
  }
  .overlay-window {
    width: 92vw !important;
    max-width: 92vw !important;
    max-height: 90vh !important;
  }
  .tab-bar-container {
    right: 12px;
    max-width: calc(100vw - 24px);
  }
  .minimized-tab {
    width: 150px;
  }
  .receipts-btn {
    padding: 20px 18px;
  }
}
@media (max-width: 640px) {
  .page-inner {
    padding: 20px 14px;
  }
  .home-header {
    padding-top: 48px;
    margin-bottom: 28px;
  }
  .brand {
    font-size: 1.6rem;
  }
  .tagline {
    font-size: 0.82rem;
  }
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .category-card {
    flex-direction: row;
    padding: 18px 16px;
    gap: 14px;
    text-align: left;
  }
  .card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0;
  }
  .card-icon svg {
    width: 24px;
    height: 24px;
  }
  .card-label {
    font-size: 15px;
  }
  .subcategory-list {
    grid-template-columns: 1fr;
  }
  .subcategory-item {
    padding: 16px 18px;
  }
  .category-header,
  .sub-header {
    padding-top: 48px;
    margin-bottom: 16px;
  }
  .category-title {
    font-size: 1.3rem;
  }
  .filters-bar {
    width: 100%;
    gap: 6px;
  }
  .dropdown-trigger {
    font-size: 0.75rem;
    padding: 6px 10px;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px 0 120px;
  }
  .product-card {
    padding: 8px;
    gap: 8px;
    border-radius: 12px;
  }
  .product-name {
    font-size: 0.78rem;
    -webkit-line-clamp: 2;
  }
  .product-price {
    font-size: 0.85rem;
  }
  .product-source-tag {
    font-size: 0.65rem;
  }
  .product-overlay .overlay-backdrop {
    background: rgba(0, 0, 0, 0.6);
  }
  .overlay-window {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .window-content {
    padding: 16px;
    gap: 14px;
    overflow-y: auto;
    flex: 1;
  }
  .product-image-container {
    height: 220px;
    border-radius: 10px;
  }
  .product-details h3 {
    font-size: 1.1rem;
  }
  .product-details .product-price {
    font-size: 1.3rem;
  }
  .external-link-btn {
    padding: 14px 20px;
    font-size: 0.9rem;
    border-radius: 10px;
  }
  .variant-tabs-container {
    padding: 6px 12px 0;
  }
  .variant-tab {
    padding: 6px 12px;
    font-size: 0.78rem;
  }
  .tab-bar-container {
    right: 0;
    left: 0;
    max-width: 100vw;
    padding: 0 8px;
  }
  .tab-bar {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar {
    display: none;
  }
  .minimized-tab {
    width: 140px;
    min-width: 140px;
    padding: 6px 10px;
    border-radius: 8px 8px 0 0;
  }
  .tab-title {
    font-size: 0.72rem;
  }
  .theme-toggle-pill {
    top: 12px;
    right: 12px;
    padding: 3px;
  }
  .toggle-option {
    width: 30px;
    height: 30px;
  }
  .toggle-slider {
    width: 30px;
    height: 30px;
    top: 3px;
    left: 3px;
  }
  [data-theme="dark"] .toggle-slider {
    transform: translateX(30px);
  }
  .toggle-option svg {
    width: 14px;
    height: 14px;
  }
  .search-bar-container {
    bottom: 60px;
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
  }
  .search-bar {
    padding: 10px 14px;
  }
  .search-bar input {
    font-size: 0.85rem;
  }
  .receipts-btn {
    padding: 18px 16px;
    font-size: 14px;
  }
  .receipts-btn svg:first-child {
    width: 20px;
    height: 20px;
  }
}
@media (max-width: 380px) {
  .landing-title {
    font-size: 2.8rem;
  }
  .enter-btn {
    padding: 12px 28px;
    font-size: 0.82rem;
  }
  .landing-count {
    font-size: 0.9rem;
  }
  .brand {
    font-size: 1.4rem;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .product-card {
    padding: 6px;
  }
  .product-name {
    font-size: 0.72rem;
  }
  .product-price {
    font-size: 0.8rem;
  }
  .category-title {
    font-size: 1.1rem;
  }
  .overlay-window {
    width: 100vw !important;
    max-width: 100vw !important;
  }
}
@media (hover: none) and (pointer: coarse) {
  .category-card:hover {
    transform: none;
    box-shadow: var(--card-glow);
  }
  .subcategory-item:hover {
    transform: none;
  }
  .product-card:hover {
    transform: none;
    box-shadow: none;
  }
  .category-card:active {
    transform: scale(0.97);
  }
  .subcategory-item:active {
    transform: scale(0.98);
  }
  .product-card:active {
    transform: scale(0.97);
  }
  .enter-btn:hover {
    transform: none;
  }
  .enter-btn:active {
    transform: scale(0.96);
  }
}
.page::-webkit-scrollbar {
  width: 5px;
}
.page::-webkit-scrollbar-track {
  background: transparent;
}
.page::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.page::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}
*:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus:not(:focus-visible) {
  outline: none;
}
::selection {
  background: var(--accent);
  color: var(--bg-primary);
}