/* ============================================
   ReTech - Japanese E-commerce Style
   Complete Stylesheet
   ============================================ */

/* ===== CSS Variables ===== */
:root {
  --color-primary: #E53935;
  --color-primary-hover: #C62828;
  --color-primary-light: #FFEBEE;
  --color-accent: #FF6F00;
  --color-accent-hover: #E65100;
  --color-success: #2E7D32;
  --color-success-light: #E8F5E9;
  --color-warning: #F9A825;
  --color-warning-light: #FFFDE7;
  --color-danger: #E53935;
  --color-danger-light: #FFEBEE;
  --color-info: #1565C0;
  --color-info-light: #E3F2FD;

  --bg-primary: #FFFFFF;
  --bg-secondary: #F7F7F7;
  --bg-tertiary: #F0F0F0;
  --bg-dark: #333333;
  --bg-dark-hover: #444444;

  --text-primary: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --text-inverse: #FFFFFF;
  --text-link: #1565C0;

  --border-color: #E0E0E0;
  --border-light: #F0F0F0;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-card-hover: 0 6px 20px rgba(0,0,0,0.12);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  --font-sans: 'Noto Sans JP', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-latin: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --header-height: 100px;
  --header-top-height: 32px;
  --header-main-height: 56px;
  --header-nav-height: 40px;
  --max-width: 1200px;
  --sidebar-width: 240px;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input, select {
  font-family: inherit;
  outline: none;
}

ul, ol {
  list-style: none;
}

/* ===== Utility Classes ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

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

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

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

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

/* Top utility bar */
.header-top {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.8);
  height: var(--header-top-height);
  display: flex;
  align-items: center;
  font-size: 11px;
}

.header-top-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-top-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.header-top a {
  color: rgba(255,255,255,0.8);
  transition: color var(--transition-fast);
}

.header-top a:hover {
  color: #fff;
}

.header-top-sep {
  color: rgba(255,255,255,0.3);
  font-size: 10px;
}

/* Main header bar */
.header-main {
  height: var(--header-main-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.header-main-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text-primary);
}

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

.logo-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.logo-slogan {
  font-size: 9px;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Search Bar */
.search-bar {
  flex: 1;
  max-width: 600px;
  position: relative;
}

.search-bar form {
  display: flex;
  width: 100%;
  height: 38px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.search-bar input {
  flex: 1;
  height: 100%;
  padding: 0 14px;
  border: none;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-primary);
}

.search-bar input:focus {
  outline: none;
}

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

.search-bar button {
  height: 100%;
  padding: 0 20px;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-bar button:hover {
  background: var(--color-primary-hover);
}

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

.header-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 10px;
  border: none;
  background: none;
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

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

.header-action-btn .icon {
  font-size: 1.2rem;
  line-height: 1;
}

.header-action-btn .label {
  font-size: 10px;
  line-height: 1;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

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

.lang-btn .arrow {
  font-size: 8px;
  transition: transform var(--transition-fast);
}

.lang-switcher.open .lang-btn .arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 130px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all var(--transition-fast);
  z-index: 100;
  overflow: hidden;
}

.lang-switcher.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background: none;
  text-align: left;
  transition: background var(--transition-fast);
}

.lang-dropdown button:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.lang-dropdown button.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
  font-weight: 600;
}

/* History Toggle */
.history-toggle {
  position: relative;
}

.history-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 10px;
  border: none;
  background: none;
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
  border-radius: var(--radius-sm);
}

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

.history-btn .icon {
  font-size: 1.2rem;
  line-height: 1;
}

.history-btn .badge {
  position: absolute;
  top: 0;
  right: 2px;
  background: var(--color-primary);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg-primary);
  display: none;
}

.history-btn .badge.show {
  display: flex;
}

/* Category Nav Bar */
.category-nav {
  height: var(--header-nav-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.category-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  white-space: nowrap;
}

.category-nav-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  height: 100%;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  flex-shrink: 0;
}

.category-nav-item:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  text-decoration: none;
}

.category-nav-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  font-size: 1.1rem;
}

/* ===== Main Layout ===== */
.main-content {
  min-height: calc(100vh - var(--header-height) - 100px);
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  padding: 8px 0;
}

.breadcrumbs-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs .sep {
  font-size: 9px;
  color: var(--text-tertiary);
}

.breadcrumbs .current {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Hero Carousel ===== */
.hero-section {
  padding: 16px 0 0;
}

.hero-carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 260px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  text-align: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hero-slide p {
  font-size: 1rem;
  opacity: 0.92;
  text-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.hero-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.hero-dot.active {
  background: white;
  width: 20px;
  border-radius: 4px;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  opacity: 0;
}

.hero-carousel:hover .hero-arrow {
  opacity: 1;
}

.hero-arrow:hover {
  background: rgba(255,255,255,0.35);
}

.hero-arrow.prev { left: 12px; }
.hero-arrow.next { right: 12px; }

/* ===== Category Grid (Home) ===== */
.categories-section {
  padding: 24px 0 0;
}

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

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title .icon {
  font-size: 1.1rem;
}

.section-link {
  font-size: 12px;
  color: var(--text-link);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
}

.section-link:hover {
  text-decoration: underline;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  color: var(--text-primary);
}

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

.category-card .cat-icon {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  transition: transform var(--transition-base);
}

.category-card:hover .cat-icon {
  transform: scale(1.08);
}

.category-card .cat-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.category-card .cat-count {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ===== Trust Badges Section ===== */
.trust-section {
  padding: 24px 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.trust-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.trust-text h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.trust-text p {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* ===== Product Grid ===== */
.products-section {
  padding: 24px 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: stretch;
}
.products-grid > .product-card { height: 100%; }

/* Scrollable horizontal product row */
.products-scroll-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.products-scroll-row::-webkit-scrollbar {
  display: none;
}

.products-scroll-row .product-card {
  min-width: 200px;
  max-width: 220px;
  flex-shrink: 0;
}

/* Product Card - Japanese E-commerce Style */
.product-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 380px;
}
.product-card .card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 6px;
}
.product-card .card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.45;
  height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.product-card .card-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
}
.product-card .card-shipping-badges {
  min-height: 22px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.product-card .card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 48px;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-primary);
  color: var(--text-primary);
}

.product-card .card-image {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 aspect ratio */
  overflow: hidden;
  background: #FAFAFA;
  border-bottom: 1px solid var(--border-light);
}

.product-card .card-image .emoji-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  transition: transform var(--transition-slow);
}

.product-card:hover .card-image .emoji-bg {
  transform: scale(1.05);
}

.product-card .card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.badge-condition {
  backdrop-filter: blur(4px);
}

.badge-like-new {
  background: rgba(46, 125, 50, 0.9);
  color: white;
}

.badge-good {
  background: rgba(21, 101, 192, 0.85);
  color: white;
}

.badge-fair {
  background: rgba(249, 168, 37, 0.9);
  color: #5D4037;
}

.badge-hot {
  background: var(--color-primary);
  color: white;
}

.badge-verified {
  background: var(--color-success);
  color: white;
}

.badge-verified::before {
  content: '\2713';
  font-weight: 700;
}

.badge-free-shipping {
  background: var(--color-info);
  color: white;
}

.badge-points-back {
  background: var(--color-accent);
  color: white;
}

.badge-same-day {
  background: var(--color-success);
  color: white;
}

/* Discount badge - top right */
.product-card .card-discount-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  z-index: 1;
}

/* Card body */
.product-card .card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.product-card .card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.1em;
}

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

.product-card .card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
}

.product-card .card-original-price {
  font-size: 11px;
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.product-card .card-discount {
  font-size: 10px;
  color: var(--color-primary);
  font-weight: 600;
}

.product-card .card-shipping-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.product-card .card-shipping-badges .badge {
  font-size: 9px;
  padding: 1px 4px;
}

.product-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
  font-size: 10px;
  color: var(--text-tertiary);
}

.product-card .card-seller {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card .card-seller .star {
  color: var(--color-warning);
  font-size: 10px;
}

.product-card .card-location {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card .card-views {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.product-card .card-time {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ===== Category Page ===== */
.category-layout {
  display: flex;
  gap: 20px;
  padding: 20px 0;
}

/* Filter Sidebar */
.filter-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

.filter-panel {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 16px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.filter-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

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

.filter-option.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 500;
}

.filter-option .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.filter-option .dot.green { background: var(--color-success); }
.filter-option .dot.blue { background: var(--color-info); }
.filter-option .dot.yellow { background: var(--color-warning); }

.price-range-inputs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.price-range-inputs input {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color var(--transition-fast);
}

.price-range-inputs input:focus {
  border-color: var(--color-primary);
}

.price-range-inputs span {
  color: var(--text-tertiary);
  font-size: 12px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

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

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

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

.btn-accent {
  background: var(--color-accent);
  color: white;
}

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

.btn-lg {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-block {
  width: 100%;
}

/* Product listing area */
.product-listing {
  flex: 1;
  min-width: 0;
}

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

.listing-count {
  font-size: 13px;
  color: var(--text-secondary);
}

.listing-count strong {
  color: var(--text-primary);
  font-weight: 700;
}

.sort-select {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-select label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sort-select select {
  height: 32px;
  padding: 0 28px 0 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

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

/* ===== Product Detail ===== */
.product-detail {
  padding: 20px 0 48px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 24px;
}

.detail-image {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.detail-image .emoji-display {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7rem;
  border-radius: var(--radius-md);
  background: #FAFAFA;
}

.detail-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.detail-price-section {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
}

.detail-original-price {
  font-size: 14px;
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.detail-discount {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Detail sections */
.detail-section {
  margin-top: 20px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px 24px;
}

.detail-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Specs table */
.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid var(--border-light);
}

.specs-table tr:last-child {
  border-bottom: none;
}

.specs-table td {
  padding: 8px 0;
  font-size: 12px;
}

.specs-table td:first-child {
  color: var(--text-secondary);
  width: 120px;
  font-weight: 500;
}

.specs-table td:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

/* Seller Card */
.seller-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.seller-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.seller-details {
  flex: 1;
  min-width: 0;
}

.seller-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.seller-name .verified-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
}

.seller-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.seller-stats .stat {
  display: flex;
  align-items: center;
  gap: 3px;
}

.seller-stats .star {
  color: var(--color-warning);
}

.seller-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Shipping / Return info rows */
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .info-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.info-row .info-content {
  flex: 1;
}

.info-row .info-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.info-row .info-text {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ===== Search Results ===== */
.search-results {
  padding: 20px 0 0;
}

.search-header {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.search-query {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.search-query span {
  color: var(--color-primary);
}

/* ===== Browsing History Panel ===== */
.history-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 20px rgba(0,0,0,0.10);
  z-index: 1100;
  transform: translateX(100%);
  transition: transform var(--transition-base);
  display: flex;
  flex-direction: column;
}

.history-panel.open {
  transform: translateX(0);
}

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.history-panel-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-panel-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 1rem;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.history-panel-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.history-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
}

.history-panel-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.history-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  opacity: 0.8;
}

.history-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

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

.history-item-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-price {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 700;
  margin-top: 2px;
}

.history-item-time {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 180px;
  color: var(--text-tertiary);
  text-align: center;
  gap: 8px;
}

.history-empty .icon {
  font-size: 2rem;
  opacity: 0.4;
}

/* ===== No Results ===== */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 16px;
  text-align: center;
}

.no-results .icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.3;
}

.no-results h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.no-results p {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.7);
  padding: 40px 0 0;
  margin-top: 40px;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 10px;
  cursor: default;
}

.footer-brand .logo .logo-name {
  color: white;
}

.footer-brand .logo .logo-slogan {
  color: rgba(255,255,255,0.5);
}

.footer-brand p {
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255,255,255,0.5);
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}

.footer-col ul li {
  margin-bottom: 6px;
}

.footer-col ul li a {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  transition: color var(--transition-fast);
}

.footer-col ul li a:hover {
  color: white;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 6px;
  color: rgba(255,255,255,0.5);
}

.footer-payment {
  margin-top: 20px;
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

.footer-payment h4 {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}

.footer-payment-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}

.footer-bottom {
  margin-top: 20px;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* ===== Mobile Sidebar Overlay ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1050;
}

.sidebar-overlay.show {
  display: block;
}

/* ===== Loading Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ===== Scroll to top ===== */
.scroll-top {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 800;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-base);
  cursor: pointer;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
}

/* ===== Page Transition ===== */
#app > .page-content {
  animation: fadeIn 0.25s ease;
}

/* ===== Mobile Bottom Navigation ===== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  z-index: 999;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}

.mobile-nav-item {
  display: flex;
  flex-d  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  gap: 2px;
  text-decoration: none;
}

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

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

.mobile-nav-item span {
  font-size: 10px;
  line-height: 1;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-header .header-nav {
    display: none;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .hero-carousel {
    height: 180px;
  }
  .container {
    padding: 0 12px;
  }
}

@media (max-width: 480px) {
  .hero-carousel {
    height: 150px;
  }
}


