/* ============================================
   TOKO APLIKASI PREMIUM — "Obsidian Noir" Design System
   Redesign 2026 — Dark Luxury Editorial × Cyberpunk Glass
   UI/UX Pro Max Rules Applied
   ============================================ */

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

/* [UX §1] Accessibility: visible focus rings 2-4px */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* [UX §7] Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Theme Variables ---------- */
:root {
  /* Obsidian Noir (default) */
  --bg-primary: #06080c;
  --bg-secondary: #0b0e14;
  --bg-card: rgba(14, 18, 27, 0.72);
  --bg-card-solid: #0e121b;
  --bg-card-hover: rgba(18, 24, 36, 0.85);
  --bg-surface: rgba(16, 21, 32, 0.6);
  --bg-input: rgba(12, 16, 24, 0.8);
  --bg-modal: rgba(8, 11, 18, 0.95);
  --bg-modal-overlay: rgba(0, 0, 0, 0.7);
  --bg-glass: rgba(14, 18, 27, 0.55);

  --text-primary: #eaeff5;
  --text-secondary: #94a0b4; /* [UX §6] contrast ≥4.5:1 on dark surfaces */
  --text-muted: #5e6a80; /* [UX §6] contrast ≥3:1 for secondary */

  --accent: #00f0b5;
  --accent-light: #33ffc8;
  --accent-dim: rgba(0, 240, 181, 0.08);
  --accent-border: rgba(0, 240, 181, 0.18);
  --accent-glow: rgba(0, 240, 181, 0.25);
  --accent-gradient: linear-gradient(135deg, #00f0b5, #00c9ff);

  --border-color: rgba(255, 255, 255, 0.025);
  --border-light: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.025);

  --success: #00e676;
  --success-dim: rgba(0, 230, 118, 0.1);
  --error: #ff4757;
  --error-dim: rgba(255, 71, 87, 0.1);
  --warning: #ffa502;
  --warning-dim: rgba(255, 165, 2, 0.1);
  --info: #3742fa;
  --info-dim: rgba(55, 66, 250, 0.1);

  --whatsapp: #25D366;
  --whatsapp-hover: #1ebe5d;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.7);
  --shadow-accent: 0 4px 24px rgba(0, 240, 181, 0.12);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(0, 240, 181, 0.08);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --font-display: 'Satoshi', 'DM Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --header-height: 72px;
  --bottom-nav-height: 68px;
  --blur-amount: 20px;
}

[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-solid: #ffffff;
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-surface: rgba(240, 242, 245, 0.7);
  --bg-input: rgba(255, 255, 255, 0.9);
  --bg-modal: rgba(255, 255, 255, 0.97);
  --bg-modal-overlay: rgba(6, 8, 12, 0.4);
  --bg-glass: rgba(255, 255, 255, 0.6);

  --text-primary: #0e121b;
  --text-secondary: #5a6478;
  --text-muted: #9aa3b4;

  --accent: #00b386;
  --accent-light: #00d4a0;
  --accent-dim: rgba(0, 179, 134, 0.06);
  --accent-border: rgba(0, 179, 134, 0.15);
  --accent-glow: rgba(0, 179, 134, 0.12);
  --accent-gradient: linear-gradient(135deg, #00b386, #00a3cc);

  --border-color: rgba(0, 0, 0, 0.06);
  --border-light: rgba(0, 0, 0, 0.1);
  --border-glass: rgba(0, 0, 0, 0.05);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);
  --shadow-accent: 0 4px 24px rgba(0, 179, 134, 0.08);
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 40px rgba(0, 179, 134, 0.05);
}

/* ---------- Base Styles ---------- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.4s var(--ease-out-expo), color 0.3s var(--ease-out-expo);
  padding-bottom: 0;
  position: relative;
}

/* noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

[data-theme="light"] body::before {
  opacity: 0.015;
}

/* gradient mesh background */
body::after {
  content: '';
  position: fixed;
  top: -40%;
  right: -20%;
  width: 80vw;
  height: 80vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 181, 0.04) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

[data-theme="light"] body::after {
  background: radial-gradient(circle, rgba(0, 179, 134, 0.03) 0%, transparent 70%);
}

@media (max-width: 768px) {
  body {
    padding-bottom: var(--bottom-nav-height);
  }
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-light); }

img { max-width: 100%; height: auto; }

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

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--accent-border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- Utility Classes ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  min-height: 44px; /* [UX §2] touch-target-size: min 44px */
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* [UX §2] tap-delay: remove 300ms */
  user-select: none;
}

/* [UX §7] scale-feedback: subtle scale on press */
.btn:active { transform: scale(0.95); }

.btn-primary {
  background: var(--accent-gradient);
  color: #000;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(0, 240, 181, 0.25);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: none;
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover {
  background: #ff6b7a;
  box-shadow: 0 4px 20px rgba(255, 71, 87, 0.3);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.2);
}
.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent-border);
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  border-bottom: none;
  backdrop-filter: blur(var(--blur-amount)) saturate(1.8);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(1.8);
  transition: background 0.3s;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
  position: relative;
}

.brand-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-sm) + 2px);
  background: var(--accent-gradient);
  opacity: 0.2;
  filter: blur(8px);
  z-index: -1;
}

.brand-icon i {
  font-size: 1.1rem;
  color: #000;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

/* [UX §2] touch-target-size: min 44px */
.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  font-size: 1rem;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-icon:active {
  transform: scale(0.9);
}

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

.btn-icon.active,
.btn-icon.logged-in {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent-border);
}

/* ---------- Hero Section ---------- */
.hero-section {
  position: relative;
  padding: 48px 24px 24px;
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--accent-dim);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-bottom: 20px;
  animation: fadeSlideDown 0.6s var(--ease-out-expo) both;
}

.hero-badge i {
  font-size: 0.7rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 14px;
  animation: fadeSlideDown 0.6s var(--ease-out-expo) 0.1s both;
}

.hero-title .accent-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 28px;
  line-height: 1.6;
  animation: fadeSlideDown 0.6s var(--ease-out-expo) 0.2s both;
}

/* ---------- Search Section ---------- */
.search-section {
  padding: 0 24px 20px;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  animation: fadeSlideDown 0.6s var(--ease-out-expo) 0.3s both;
}

.search-container {
  max-width: 580px;
  margin: 0 auto;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  transition: color var(--transition);
}

#searchInput {
  width: 100%;
  padding: 15px 48px 15px 48px;
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

#searchInput::placeholder {
  color: var(--text-muted);
}

#searchInput:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px var(--accent-dim), var(--shadow-glow);
  background: var(--bg-card);
}

#searchInput:focus ~ .search-icon {
  color: var(--accent);
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px; /* visual 36px, but padded area extends to 44px */
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--transition);
}

.clear-search-btn:hover {
  background: var(--error-dim);
  color: var(--error);
}

.search-stats {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 10px;
  min-height: 20px;
  letter-spacing: 0.02em;
}

/* ---------- Category Filter ---------- */
.category-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px 16px;
  max-width: 1280px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  z-index: 1;
}

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

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.category-chip:hover,
.category-chip.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent-border);
}

.category-chip.active {
  box-shadow: var(--shadow-glow);
}

.category-chip i {
  font-size: 0.75rem;
}

/* ---------- Catalog / Product Grid ---------- */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  padding: 8px 24px 40px;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ---------- Product Card ---------- */
.card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.35s var(--ease-out-expo);
  position: relative;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(24px);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  padding: 28px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, var(--accent-dim) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
}

.card:hover .card-header::before {
  opacity: 1;
}

.card-header img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s var(--ease-out-expo);
  position: relative;
  z-index: 1;
}

.card:hover .card-header img {
  transform: scale(1.08) translateY(-2px);
}

.card-content {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.card-content h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-content p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

/* Description formatting */
.card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.card-desc.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.card-desc .desc-details {
  display: none;
  margin-top: 6px;
  padding-top: 6px;
  border-top: none;
}

.card-desc.expanded .desc-details {
  display: block;
  animation: fadeSlideDown 0.25s ease;
}

.desc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin-top: 6px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.desc-toggle:hover {
  color: var(--accent-light);
}

.desc-toggle i {
  font-size: 0.6rem;
  transition: transform var(--transition);
}

.desc-toggle.expanded i {
  transform: rotate(180deg);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-top: none;
  margin-top: 6px;
}

.card-stock {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-stock::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.card-stock.in-stock { color: var(--success); }
.card-stock.in-stock::before { background: var(--success); box-shadow: 0 0 6px var(--success); }
.card-stock.low-stock { color: var(--warning); }
.card-stock.low-stock::before { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.card-stock.out-of-stock { color: var(--error); }
.card-stock.out-of-stock::before { background: var(--error); box-shadow: 0 0 6px var(--error); }

.card-price {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.card-action {
  padding: 0 22px 22px;
  margin-top: auto;
}

.card-action .btn-buy {
  width: 100%;
  padding: 14px;
  min-height: 48px; /* [UX §2] touch-target-size */
  border: none;
  border-radius: var(--radius-sm);
  background: var(--whatsapp);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.card-action .btn-buy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
}

.card-action .btn-buy:hover::before {
  opacity: 1;
}

.card-action .btn-buy:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.3);
}

/* [UX §7] scale-feedback on press */
.card-action .btn-buy:active:not(:disabled) {
  transform: scale(0.96);
  box-shadow: none;
}

/* [UX §8] disabled-states: reduced opacity + cursor change */
.card-action .btn-buy:disabled {
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  opacity: 0.45;
}

.card-action .btn-buy:disabled::before { display: none; }

.card-action .btn-buy i {
  font-size: 1.1rem;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.empty-state i {
  font-size: 3.5rem;
  margin-bottom: 20px;
  opacity: 0.3;
  display: block;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ---------- Skeleton Loading ---------- */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  padding: 8px 24px 40px;
  max-width: 1280px;
  margin: 0 auto;
}

.skeleton-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: skeletonPulse 1.8s ease-in-out infinite;
  backdrop-filter: blur(16px);
}

.skeleton-card .skeleton-img {
  height: 130px;
  background: var(--bg-surface);
}

.skeleton-card .skeleton-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-line {
  height: 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}

.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.h-lg { height: 22px; }
.skeleton-line.h-btn { height: 46px; border-radius: var(--radius-sm); margin-top: 8px; }

@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---------- Modal Base ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-modal-overlay);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out-expo);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(6px);
}

.modal.show { opacity: 1; }

/* [UX §7] modal-motion: enter 400ms, exit 250ms (exit-faster-than-enter) */
.modal-content {
  background: var(--bg-card-solid);
  border: none;
  border-radius: var(--radius-xl);
  width: 92%;
  max-width: 520px;
  margin: 60px auto 40px;
  position: relative;
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 1, 1); /* exit: faster */
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  backdrop-filter: blur(40px);
}

.modal.show .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
  transition: all 0.4s var(--ease-out-expo); /* [UX §7] enter: slower, spring-like */
}

.modal-sm {
  max-width: 400px;
  text-align: center;
  padding: 36px 28px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: none;
  background: transparent;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.modal-header h2 i {
  color: var(--accent);
  font-size: 1rem;
}

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

/* [UX §2] touch-target-size: min 44px */
.modal-close {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.modal-close:active {
  transform: scale(0.9);
}

.modal-close:hover {
  background: var(--error-dim);
  color: var(--error);
  border-color: transparent;
}

.modal-body {
  padding: 26px;
}

/* ---------- Forms ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.form-group label,
.form-group legend {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.label-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-group fieldset {
  border: none;
  padding: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.form-actions .btn {
  flex: 1;
}

/* ---------- Checkout Modal ---------- */
.checkout-product {
  display: flex;
  gap: 18px;
  padding: 18px;
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-md);
  margin-bottom: 22px;
}

.checkout-product-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #fff;
  padding: 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

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

.checkout-product-info h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.checkout-product-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.checkout-product-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkout-price {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
}

.checkout-stock {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 3px 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  border: none;
}

/* Quantity Control */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 140px;
  border: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-surface);
}

.quantity-control button {
  width: 44px;
  height: 44px; /* [UX §2] touch-target-size */
  border: none;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--transition);
}

.quantity-control button:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.quantity-control input {
  width: 50px;
  height: 44px;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
  -moz-appearance: textfield;
}

.quantity-control input::-webkit-outer-spin-button,
.quantity-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.total-price-display {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.total-price-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent);
}

/* Payment Methods */
.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.payment-option input[type="radio"] {
  display: none;
}

.payment-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 14px;
  border: none;
  outline: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-surface);
}

.payment-card img {
  height: 32px;
  object-fit: contain;
}

.payment-card span {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.payment-option input[type="radio"]:checked + .payment-card {
  outline-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: var(--shadow-accent);
}

.payment-option input[type="radio"]:checked + .payment-card span {
  color: var(--accent);
}

/* Payment Detail Sections */
.payment-detail {
  margin-top: 18px;
  padding: 18px;
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-md);
  animation: fadeSlideDown 0.3s ease;
}

.payment-detail h4 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-detail h4 i {
  color: var(--accent);
}

.qris-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qris-image {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px;
  box-shadow: var(--shadow-md);
}

.qris-nmid {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.qris-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
}

.bank-info {
  background: rgba(255, 255, 255, 0.02);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: none;
}

.bank-account {
  margin-bottom: 12px;
}

.bank-label {
  font-family: var(--font-display);
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.bank-number-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bank-number-row code {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
  flex: 1;
}

.btn-copy {
  width: 44px;
  height: 44px; /* [UX §2] touch-target-size */
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

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

.btn-copy.copied {
  background: var(--success-dim);
  color: var(--success);
  border-color: var(--success);
}

.bank-holder {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.bank-holder strong {
  color: var(--text-primary);
}

/* ---------- Confirm Dialog ---------- */
.modal-confirm .modal-content {
  margin-top: 30vh;
}

.confirm-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--error-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.confirm-icon i {
  font-size: 1.5rem;
  color: var(--error);
}

.modal-confirm h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-confirm p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 400px;
  width: calc(100% - 40px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: var(--bg-card-solid);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s var(--ease-out-expo);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.toast-success .toast-icon { background: var(--success-dim); color: var(--success); }
.toast-error .toast-icon { background: var(--error-dim); color: var(--error); }
.toast-info .toast-icon { background: var(--info-dim); color: var(--info); }
.toast-warning .toast-icon { background: var(--warning-dim); color: var(--warning); }

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* [UX §2] touch-target-size: visual 28px but hit area 44px via padding */
.toast-close {
  width: 28px;
  height: 28px;
  padding: 8px;
  box-sizing: content-box;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: all var(--transition);
  flex-shrink: 0;
  margin: -8px;
  -webkit-tap-highlight-color: transparent;
}

.toast-close:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: width linear;
}

.toast-success .toast-progress { background: var(--success); }
.toast-error .toast-progress { background: var(--error); }
.toast-info .toast-progress { background: var(--info); }
.toast-warning .toast-progress { background: var(--warning); }

/* ---------- History Modal ---------- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  padding: 16px;
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.history-item:hover {
  border-color: var(--accent-border);
}

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

.history-header h3 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.history-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-full);
  border: none;
}

.history-details p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin: 4px 0;
}

.history-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}

.history-empty i {
  font-size: 2.5rem;
  margin-bottom: 14px;
  display: block;
  opacity: 0.3;
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-glass);
  border-top: none;
  z-index: 100;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  backdrop-filter: blur(var(--blur-amount)) saturate(1.8);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(1.8);
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
}

/* [UX §2] touch-target-size: min 44×44px, [UX §2] touch-spacing: 8px+ gap */
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 14px;
  min-height: 48px;
  min-width: 64px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  font-family: var(--font-display);
  border-radius: var(--radius-sm);
  text-decoration: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.bottom-nav-item i {
  font-size: 1.15rem;
  transition: all var(--transition);
}

.bottom-nav-item span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.bottom-nav-item.active i {
  transform: scale(1.1);
}

.bottom-nav-item:hover {
  color: var(--accent-light);
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 36px 24px;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: none;
  margin-top: 20px;
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
}

footer a {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Animations ---------- */
@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 20px 4px var(--accent-glow); }
}

/* [UX §7] stagger-sequence: 40ms per item for natural feel */
.card:nth-child(1) { transition-delay: 0.04s; }
.card:nth-child(2) { transition-delay: 0.08s; }
.card:nth-child(3) { transition-delay: 0.12s; }
.card:nth-child(4) { transition-delay: 0.16s; }
.card:nth-child(5) { transition-delay: 0.2s; }
.card:nth-child(6) { transition-delay: 0.24s; }
.card:nth-child(7) { transition-delay: 0.28s; }
.card:nth-child(8) { transition-delay: 0.32s; }
.card:nth-child(9) { transition-delay: 0.36s; }
.card:nth-child(10) { transition-delay: 0.4s; }
.card:nth-child(11) { transition-delay: 0.44s; }
.card:nth-child(12) { transition-delay: 0.48s; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .header-content {
    padding: 0 14px;
  }

  .brand-tagline {
    display: none;
  }

  .brand-text h1 {
    font-size: 1rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
  }

  .brand-icon i {
    font-size: 0.95rem;
  }

  /* [UX §2] keep 44px touch target even on mobile */
  .btn-icon {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .hero-section {
    padding: 28px 16px 16px;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 0.88rem;
    margin-bottom: 20px;
  }

  .search-section {
    padding: 0 14px 12px;
  }

  #searchInput {
    padding: 13px 42px;
    min-height: 48px; /* [UX §8] touch-friendly-input */
    font-size: 16px; /* [UX §5] readable-font-size: prevents iOS zoom */
  }

  .category-filter {
    padding: 0 14px 12px;
  }

  .catalog {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 4px 14px 24px;
  }

  .card-header {
    padding: 18px 16px 14px;
  }

  .card-header img {
    width: 56px;
    height: 56px;
  }

  .card-content {
    padding: 0 14px;
  }

  .card-content h3 {
    font-size: 0.9rem;
  }

  .card-content p {
    font-size: 0.78rem;
  }

  .card-desc {
    font-size: 0.78rem;
    -webkit-line-clamp: 2;
  }

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

  .card-action {
    padding: 0 14px 14px;
  }

  .card-action .btn-buy {
    padding: 12px;
    min-height: 44px; /* [UX §2] maintain touch target on mobile */
    font-size: 0.82rem;
  }

  .modal-content {
    width: 96%;
    margin: 16px auto;
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 16px 18px;
  }

  .modal-body {
    padding: 18px;
  }

  .checkout-product {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .checkout-product-meta {
    justify-content: center;
  }

  .payment-methods {
    grid-template-columns: 1fr 1fr;
    gap: 10px; /* [UX §2] touch-spacing: 8px+ */
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .toast-container {
    top: auto;
    bottom: calc(var(--bottom-nav-height) + 12px);
    right: 12px;
    left: 12px;
    max-width: none;
    width: auto;
  }

  .toast {
    transform: translateY(120%);
  }

  .toast.show {
    transform: translateY(0);
  }

  .toast.hide {
    transform: translateY(120%);
  }

  /* Prevent iOS zoom on input focus */
  input, textarea, select {
    font-size: 16px !important;
  }

  footer {
    margin-bottom: 0;
    padding-bottom: 16px;
  }
}

@media (max-width: 380px) {
  .catalog {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }

  .qris-image {
    width: 140px;
    height: 140px;
  }
}

/* Landscape */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-content {
    margin: 10px auto;
    max-height: 90vh;
  }

  .bottom-nav {
    display: none;
  }
}

/* ---------- Print ---------- */
@media print {
  header, footer, .bottom-nav, .search-section, .toast-container, .hero-section, .category-filter { display: none; }
  body { background: #fff; color: #000; padding: 0; }
  body::before, body::after { display: none; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; backdrop-filter: none; }
}
