/* ================================================================
   HookahGang Premium — Design System
   ================================================================ */

:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  --text-xs: 11px; --text-sm: 13px; --text-base: 15px;
  --text-lg: 17px; --text-xl: 20px; --text-2xl: 24px; --text-3xl: 32px;
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 24px; --r-full: 999px;
  --bg: #08080c;
  --bg-elevated: #111118;
  --bg-card: #16161e;
  --bg-card-hover: #1c1c26;
  --text: #eeeef2;
  --text-2: #9898b0;
  --text-3: #5c5c78;
  --accent: #ff6b35;
  --accent-dim: #e85d2c;
  --accent-soft: rgba(255, 107, 53, 0.12);
  --accent-glow: rgba(255, 107, 53, 0.25);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.12);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-accent: 0 4px 20px rgba(255,107,53,0.2);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.45, 0, 0.15, 1);
  --nav-h: 68px;
  --max-w: 480px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }

html, body {
  height: 100dvh; background: var(--bg); color: var(--text);
  font-family: -apple-system, 'Inter', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  user-select: none; max-width: var(--max-w); margin: 0 auto; overflow: hidden;
}
#app { height: 100%; display: flex; flex-direction: column; }

/* ===== BACKGROUND ===== */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255,107,53,0.07), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 90%, rgba(255,68,68,0.04), transparent 50%),
    var(--bg);
}
.bg-canvas::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,107,53,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,107,53,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
}
.bg-canvas::after {
  content: ''; position: absolute; inset: 0;
  background: 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)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 256px 256px; opacity: 0.5;
}

/* ===== SPLASH ===== */
.splash {
  position: fixed; inset: 0; z-index: 1000; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.splash.out { animation: fadeOut 0.6s var(--ease-out) forwards; }

.splash-logo-img {
  width: 110px; height: 110px; border-radius: var(--r-xl); overflow: hidden;
  background: var(--bg-card); border: 2px solid var(--border-hover);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(255,107,53,0.15);
  animation: fadeIn 0.8s var(--ease-spring) both;
}
.splash-logo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.splash-brand {
  font-size: var(--text-3xl); font-weight: 800; letter-spacing: 8px; margin-top: var(--sp-6);
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, #fff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: fadeIn 0.8s var(--ease) 0.2s both;
}
.splash-tagline {
  font-size: var(--text-sm); letter-spacing: 4px; color: var(--text-3);
  margin-top: var(--sp-2); text-transform: uppercase;
  animation: fadeIn 0.6s var(--ease) 0.4s both;
}
.splash-loader { margin-top: var(--sp-10); width: 120px; animation: fadeIn 0.5s var(--ease) 0.6s both; }
.loader-track { height: 2px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.loader-fill {
  width: 40%; height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 2px; animation: loaderSlide 1.4s var(--ease-smooth) infinite;
}

/* ===== MAIN ===== */
.main { height: 100%; display: flex; flex-direction: column; position: relative; z-index: 1; overflow: hidden; }
.main.hidden { display: none; }

/* ===== PAGES ===== */
.page { display: none; flex-direction: column; height: 100%; position: relative; }
.page.active { display: flex; animation: fadeIn 0.3s var(--ease); }

.page-content {
  flex: 1 1 0; min-height: 0; overflow-y: scroll; overflow-x: hidden;
  padding: 0 var(--sp-4) 100px; -webkit-overflow-scrolling: touch;
}

.page-header {
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  padding-top: max(var(--sp-5), env(safe-area-inset-top)); flex-shrink: 0;
}
.page-title {
  font-size: var(--text-2xl); font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ===== BRAND ROW ===== */
.brand-row { display: flex; align-items: center; gap: var(--sp-3); }
.brand-logo {
  width: 44px; height: 44px; background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 800; color: #000;
  box-shadow: var(--shadow-accent); overflow: hidden; cursor: pointer; flex-shrink: 0;
  transition: transform 0.2s; animation: pulse 3s var(--ease-smooth) infinite;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-logo:active { transform: scale(0.92); }

.brand-info { flex: 1; min-width: 0; }
.header-brand-name { font-size: var(--text-lg); font-weight: 800; letter-spacing: 2px; }
.brand-sub { font-size: var(--text-xs); color: var(--text-3); margin-top: 2px; }

.wheel-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--accent-dim), #ff4444);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; margin-left: auto;
  box-shadow: var(--shadow-accent); transition: transform 0.3s var(--ease-bounce);
}
.wheel-btn:active { transform: scale(0.88); }

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2);
  font-size: var(--text-xs); overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.breadcrumbs::-webkit-scrollbar { display: none; }
.breadcrumb-item { color: var(--text-3); cursor: pointer; transition: color 0.2s; flex-shrink: 0; padding: var(--sp-1) 0; }
.breadcrumb-item:active { color: var(--accent); }
.breadcrumb-item.active { color: var(--text); cursor: default; font-weight: 600; }
.breadcrumb-sep { color: var(--text-3); font-size: 10px; flex-shrink: 0; opacity: 0.4; }

/* ===== BACK BUTTON ===== */
.back-btn {
  background: none; border: none; color: var(--accent); font-size: var(--text-base);
  font-weight: 600; cursor: pointer; display: flex; align-items: center;
  gap: var(--sp-2); padding: var(--sp-2) 0; margin-bottom: var(--sp-3); transition: opacity 0.2s;
}
.back-btn:active { opacity: 0.5; }
.back-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* ===== STORE BUTTON ===== */
.store-btn {
  width: 100%; padding: var(--sp-4) var(--sp-5); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r); color: var(--text);
  font-size: var(--text-base); font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  transition: transform 0.3s var(--ease-bounce), border-color 0.3s;
  margin-bottom: var(--sp-5); box-shadow: var(--shadow-sm);
}
.store-btn:active { transform: scale(0.97); border-color: var(--accent-dim); }
.store-arrow { color: var(--text-3); font-size: 18px; transition: transform 0.3s var(--ease-bounce); }
.store-btn:active .store-arrow { transform: translateX(-4px); }

/* ===== MODAL ===== */
.modal {
  position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.7); transition: opacity 0.3s;
}
.modal.hidden { opacity: 0; pointer-events: none; }

.modal-content {
  width: 100%; max-width: var(--max-w); max-height: 65vh;
  background: var(--bg-elevated); border-radius: var(--r-lg) var(--r-lg) 0 0;
  overflow: hidden; border-top: 1px solid var(--border-hover);
  transform: translateY(0); transition: transform 0.5s var(--ease-spring);
}
.modal.hidden .modal-content { transform: translateY(100%); }

.modal-header { padding: var(--sp-6) var(--sp-5) var(--sp-4); }
.modal-title { font-size: var(--text-lg); font-weight: 700; letter-spacing: 1px; }
.modal-sub { font-size: var(--text-xs); color: var(--text-3); margin-top: var(--sp-1); }
.modal-body { overflow-y: auto; padding: var(--sp-2) var(--sp-3) var(--sp-6); max-height: calc(65vh - 80px); }

.store-item {
  padding: var(--sp-4) var(--sp-5); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r); margin-bottom: var(--sp-2);
  cursor: pointer; font-size: var(--text-base); font-weight: 600;
  display: flex; align-items: center; gap: var(--sp-3);
  transition: transform 0.3s var(--ease-bounce), border-color 0.3s; box-shadow: var(--shadow-sm);
}
.store-item::before { content: ''; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px var(--accent-glow); }
.store-item:active { transform: scale(0.97); border-color: var(--accent-dim); }

/* ===== CATEGORIES ===== */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.cat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-4); text-align: center; cursor: pointer;
  transition: transform 0.35s var(--ease-bounce), border-color 0.3s;
  position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
  animation: slideUp 0.4s var(--ease) both; animation-delay: calc(var(--i, 0) * 0.05s);
}
.cat-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, var(--accent-soft), transparent 60%); opacity: 0; transition: opacity 0.3s; }
.cat-card:active::before { opacity: 1; }
.cat-card:active { transform: scale(0.96); border-color: var(--accent-dim); }

.cat-icon {
  width: 44px; height: 44px; margin: 0 auto var(--sp-3); background: var(--accent-soft);
  border: 1px solid rgba(255,107,53,0.1); border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s var(--ease-bounce);
}
.cat-card:active .cat-icon { transform: scale(1.15) rotate(-5deg); }
.cat-icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.5; }
.cat-name { font-size: var(--text-base); font-weight: 700; margin-top: var(--sp-1); }
.cat-count { font-size: var(--text-xs); color: var(--text-3); margin-top: var(--sp-1); }

/* ===== BRANDS ===== */
.brand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.brand-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r);
  padding: var(--sp-4) var(--sp-3); text-align: center; cursor: pointer;
  transition: transform 0.3s var(--ease-bounce), border-color 0.3s;
  box-shadow: var(--shadow-sm); animation: slideUp 0.3s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 0.03s);
}
.brand-card:active { transform: scale(0.95); border-color: var(--accent-dim); }
.brand-name { font-size: var(--text-base); font-weight: 700; }
.brand-count { font-size: var(--text-xs); color: var(--text-3); margin-top: var(--sp-1); }

/* ===== SEARCH ===== */
.search-wrap { position: relative; margin-bottom: var(--sp-4); }
.search-input {
  width: 100%; padding: var(--sp-3) var(--sp-4) var(--sp-3) 42px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text); font-size: var(--text-base); font-weight: 500; outline: none;
  transition: border-color 0.25s, box-shadow 0.25s; box-shadow: var(--shadow-sm);
}
.search-input:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-input::placeholder { color: var(--text-3); }
.search-icon { position: absolute; left: var(--sp-4); top: 50%; transform: translateY(-50%); color: var(--text-3); transition: color 0.2s; }
.search-input:focus ~ .search-icon { color: var(--accent); }

/* ===== PRODUCTS ===== */
.prod-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.prod-card {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r);
  cursor: pointer; transition: transform 0.3s var(--ease-bounce), border-color 0.3s;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  animation: slideUp 0.35s var(--ease) both; animation-delay: calc(var(--i, 0) * 0.04s);
}
.prod-card:active { transform: scale(0.98); border-color: var(--accent-dim); }

.prod-thumb {
  width: 52px; height: 52px; background: var(--accent-soft);
  border: 1px solid rgba(255,107,53,0.08); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
}
.prod-thumb svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.5; }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }

.prod-admin-btns { position: absolute; bottom: 4px; right: 4px; display: flex; gap: 4px; z-index: 2; }
.prod-admin-btn {
  width: 26px; height: 26px; background: rgba(0,0,0,0.8);
  border: 1px solid rgba(255,107,53,0.4); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; transition: transform 0.2s;
}
.prod-admin-btn:active { transform: scale(0.9); }

.prod-info { flex: 1; min-width: 0; }
.prod-name { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-meta { font-size: var(--text-xs); color: var(--text-3); margin-top: 2px; }
.prod-price { font-size: var(--text-base); font-weight: 800; color: var(--accent); white-space: nowrap; }
.prod-badge {
  display: inline-block; font-size: 9px; padding: 2px 7px; margin-left: 6px;
  background: var(--accent-soft); color: var(--accent); border-radius: var(--r-full);
  font-weight: 700; letter-spacing: 0.3px; vertical-align: middle;
}

/* ===== DETAIL OVERLAY ===== */
.overlay {
  position: fixed; inset: 0; z-index: 150; background: var(--bg);
  transform: translateX(100%); transition: transform 0.4s var(--ease);
  overflow-y: auto; overscroll-behavior-y: contain;
}
.overlay.hidden { transform: translateX(100%); pointer-events: none; }
.overlay:not(.hidden) { transform: translateX(0); }

.overlay-header {
  padding: var(--sp-4) var(--sp-5); padding-top: max(var(--sp-4), env(safe-area-inset-top));
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: rgba(8,8,12,0.9); backdrop-filter: blur(16px); z-index: 10;
}
.overlay-content { padding: var(--sp-6) var(--sp-5) 140px; }

.detail-visual {
  width: 100%; height: 200px; background: var(--accent-soft);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-6); overflow: hidden; box-shadow: var(--shadow-md);
  animation: scaleIn 0.5s var(--ease-spring);
}
.detail-visual svg { width: 48px; height: 48px; stroke: var(--accent-dim); fill: none; stroke-width: 1; opacity: 0.4; }
.detail-visual img { width: 100%; height: 100%; object-fit: cover; }

.detail-name { font-size: var(--text-2xl); font-weight: 800; margin-bottom: var(--sp-2); }
.detail-price { font-size: var(--text-3xl); font-weight: 800; color: var(--accent); margin-bottom: var(--sp-5); }
.detail-stock {
  font-size: var(--text-sm); color: var(--text-2); padding: var(--sp-3) var(--sp-4);
  background: var(--success-soft); border: 1px solid rgba(52,211,153,0.15);
  border-radius: var(--r-sm); margin-bottom: var(--sp-5);
}
.detail-desc {
  font-size: var(--text-sm); line-height: 1.7; color: var(--text-2);
  margin-bottom: var(--sp-6); padding: var(--sp-4); background: var(--bg-card);
  border-radius: var(--r); border-left: 3px solid var(--accent-dim);
}
.detail-btn {
  width: 100%; padding: var(--sp-4);
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  border: none; border-radius: var(--r); color: #000;
  font-size: var(--text-base); font-weight: 700; letter-spacing: 0.5px;
  cursor: pointer; transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s;
  box-shadow: var(--shadow-accent); position: relative; overflow: hidden;
}
.detail-btn:active { transform: scale(0.97); box-shadow: 0 2px 8px rgba(255,107,53,0.4); }
.detail-btn.added { background: linear-gradient(135deg, var(--success), #10b981); box-shadow: 0 4px 16px rgba(52,211,153,0.3); }

.btn-ripple {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,0.3);
  transform: scale(0); animation: ripple 0.6s var(--ease-out); pointer-events: none;
}

/* ===== CART ===== */
.cart-empty { text-align: center; padding: 80px var(--sp-4); animation: fadeIn 0.5s both; }
.cart-empty-visual {
  width: 72px; height: 72px; margin: 0 auto var(--sp-5); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md);
}
.cart-empty-visual svg { width: 28px; height: 28px; stroke: var(--text-3); fill: none; stroke-width: 1.5; opacity: 0.4; }
.cart-empty-text { font-size: var(--text-base); color: var(--text-3); }

.cart-items { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.cart-item {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-sm); animation: slideUp 0.3s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 0.05s); transition: opacity 0.3s, transform 0.3s;
}
.cart-item.removing { animation: slideOut 0.3s var(--ease-out) forwards; }

.cart-item-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: var(--text-sm); color: var(--accent); font-weight: 700; margin-top: 2px; }
.cart-item-remove {
  width: 32px; height: 32px; background: var(--danger-soft);
  border: 1px solid rgba(244,63,94,0.15); border-radius: var(--r-sm);
  color: var(--danger); font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform 0.2s; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cart-item-remove:active { transform: scale(0.9); }

.cart-summary {
  padding: var(--sp-5); background: var(--bg-card); border-radius: var(--r);
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); }
.cart-total-label { font-size: var(--text-base); color: var(--text-2); }
.cart-total-value { font-size: var(--text-2xl); font-weight: 800; color: var(--accent); }
.cart-checkout {
  width: 100%; padding: var(--sp-4);
  background: linear-gradient(135deg, var(--success), #10b981);
  border: none; border-radius: var(--r); color: #000;
  font-size: var(--text-base); font-weight: 700; cursor: pointer;
  transition: transform 0.3s var(--ease-bounce);
  box-shadow: 0 4px 16px rgba(52,211,153,0.25);
  animation: pulseGreen 2.5s var(--ease-smooth) infinite;
}
.cart-checkout:active { transform: scale(0.97); }

/* ===== ORDERS ===== */
.orders-empty { text-align: center; padding: 80px var(--sp-4); animation: fadeIn 0.5s both; }
.order-card {
  padding: var(--sp-4); background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); margin-bottom: var(--sp-3); box-shadow: var(--shadow-sm);
  animation: slideUp 0.3s var(--ease) both; animation-delay: calc(var(--i, 0) * 0.05s);
}
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); }
.order-id { font-size: var(--text-sm); font-weight: 700; color: var(--accent); }
.order-date { font-size: var(--text-xs); color: var(--text-3); }
.order-store { font-size: var(--text-xs); color: var(--text-2); margin-bottom: var(--sp-3); }
.order-items-list { font-size: var(--text-sm); color: var(--text-2); line-height: 1.7; }
.order-total { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); text-align: right; font-size: var(--text-lg); font-weight: 800; color: var(--accent); }

/* ===== SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%; animation: shimmer 1.8s ease-in-out infinite; border-radius: var(--r-sm);
  animation-delay: calc(var(--i, 0) * 0.08s);
}
.skeleton-card { height: 68px; margin-bottom: var(--sp-2); border-radius: var(--r); }
.skeleton-cat { height: 100px; border-radius: var(--r); }
.skeleton-detail-visual { height: 160px; margin-bottom: var(--sp-5); border-radius: var(--r); }
.skeleton-detail-name { height: 20px; width: 50%; margin-bottom: var(--sp-3); }
.skeleton-detail-price { height: 28px; width: 30%; margin-bottom: var(--sp-5); }

/* ===== EMPTY HINT ===== */
.empty-hint { text-align: center; color: var(--text-3); padding: var(--sp-5); font-size: var(--text-sm); }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%;
  transform: translateX(-50%) translateY(100%);
  padding: var(--sp-3) var(--sp-5); background: var(--bg-elevated);
  border: 1px solid var(--border-hover); border-radius: var(--r);
  color: var(--text); font-size: var(--text-sm); font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 300; opacity: 0;
  transition: transform 0.4s var(--ease-bounce), opacity 0.3s;
  pointer-events: none; display: flex; align-items: center; gap: var(--sp-2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-icon { font-size: 16px; }

/* ===== ERROR STATE ===== */
.error-state { text-align: center; padding: 60px var(--sp-4); animation: fadeIn 0.5s both; }
.error-icon {
  width: 56px; height: 56px; margin: 0 auto var(--sp-4); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md);
}
.error-icon svg { width: 24px; height: 24px; stroke: var(--text-3); fill: none; stroke-width: 1.5; }
.error-title { font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--sp-2); }
.error-text { font-size: var(--text-sm); color: var(--text-3); line-height: 1.6; margin-bottom: var(--sp-5); }
.retry-btn {
  padding: var(--sp-3) var(--sp-6); background: var(--accent-dim); border: none;
  border-radius: var(--r-full); color: #fff; font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; transition: transform 0.3s var(--ease-bounce); box-shadow: var(--shadow-accent);
}
.retry-btn:active { transform: scale(0.95); }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,107,53,0.15); border-radius: 3px; }

/* ===== NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--max-w); height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(8,8,12,0.88); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: center;
  z-index: 100; backdrop-filter: blur(20px);
}
.nav-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; color: var(--text-3); font-size: 10px;
  font-weight: 600; letter-spacing: 0.3px; padding: var(--sp-2) var(--sp-6);
  cursor: pointer; transition: color 0.3s;
}
.nav-icon-wrap { position: relative; }
.nav-svg { width: 22px; height: 22px; transition: transform 0.4s var(--ease-bounce); }
.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-svg { transform: translateY(-2px) scale(1.1); }
.nav-btn:active { transform: scale(0.85); }

.cart-badge {
  position: absolute; top: -4px; right: -8px; min-width: 16px; height: 16px;
  padding: 0 4px; background: var(--danger); color: #fff; font-size: 9px; font-weight: 800;
  border-radius: var(--r-full); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(244,63,94,0.5); animation: pop 0.3s var(--ease-spring);
}
.cart-badge.hidden { display: none; }

/* ===== ADMIN ===== */
.admin-header { display: flex; flex-direction: column; align-items: center; padding: var(--sp-8) 0 var(--sp-6); }
.admin-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-accent); margin-bottom: var(--sp-4); overflow: hidden; transition: transform 0.2s;
}
.admin-avatar:active { transform: scale(0.95); }
.admin-avatar svg { width: 36px; height: 36px; stroke: #000; fill: none; }
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-name { font-size: var(--text-xl); font-weight: 800; margin-bottom: var(--sp-3); }
.admin-avatar-btn {
  font-size: var(--text-sm); color: var(--accent); font-weight: 600; cursor: pointer;
  padding: var(--sp-2) var(--sp-5); border-radius: var(--r-full);
  border: 1px solid rgba(255,107,53,0.3); transition: background 0.2s;
}
.admin-avatar-btn:active { background: var(--accent-soft); }

.admin-section { margin-bottom: var(--sp-6); }
.admin-section-title {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-3); text-transform: uppercase; margin-bottom: var(--sp-3); padding: 0 var(--sp-1);
}
.admin-stat {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-4) var(--sp-5); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  margin-bottom: var(--sp-2); font-size: var(--text-sm); box-shadow: var(--shadow-sm);
}
.admin-stat span:first-child { color: var(--text-2); }
.admin-stat span:last-child { font-weight: 700; color: var(--accent); }
.admin-btn {
  padding: var(--sp-4) var(--sp-5); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  margin-bottom: var(--sp-2); font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; transition: border-color 0.25s; box-shadow: var(--shadow-sm);
}
.admin-btn:active { border-color: var(--accent-dim); }

/* Admin Stats Grid */
.admin-stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-3);
}
.admin-stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r);
  padding: var(--sp-4); text-align: center; box-shadow: var(--shadow-sm);
}
.admin-stat-val { font-size: var(--text-xl); font-weight: 800; color: var(--accent); }
.admin-stat-lbl { font-size: var(--text-xs); color: var(--text-3); margin-top: var(--sp-1); }

/* Admin Order Card */
.admin-order-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r);
  padding: var(--sp-4); margin-bottom: var(--sp-2); box-shadow: var(--shadow-sm);
}
.admin-order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-2); }
.admin-order-id { font-size: var(--text-sm); font-weight: 700; color: var(--accent); }
.admin-order-date { font-size: var(--text-xs); color: var(--text-3); }
.admin-order-user { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--sp-1); }
.admin-order-store { font-size: var(--text-xs); color: var(--text-2); margin-bottom: var(--sp-2); }
.admin-order-items { font-size: var(--text-xs); color: var(--text-2); line-height: 1.6; margin-bottom: var(--sp-2); }
.admin-order-total { font-size: var(--text-base); font-weight: 800; color: var(--accent); text-align: right; }

/* Admin User Card */
.admin-user-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2); box-shadow: var(--shadow-sm);
}
.admin-user-name { font-size: var(--text-sm); font-weight: 600; }
.admin-user-meta { font-size: var(--text-xs); color: var(--text-3); margin-top: 2px; }
.admin-user-stats { font-size: var(--text-xs); color: var(--text-2); margin-top: var(--sp-1); }

.empty-hint { text-align: center; color: var(--text-3); font-size: var(--text-sm); padding: var(--sp-4); }

.admin-product-item {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-sm);
  margin-bottom: var(--sp-2); box-shadow: var(--shadow-sm);
}
.admin-product-thumb {
  width: 44px; height: 44px; flex-shrink: 0; background: var(--accent-soft);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.admin-product-info { flex: 1; min-width: 0; }
.admin-product-name { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-product-meta { font-size: var(--text-xs); color: var(--text-3); margin-top: 2px; }
.admin-product-img-btn {
  width: 34px; height: 34px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; flex-shrink: 0; transition: transform 0.2s;
}
.admin-product-img-btn:active { transform: scale(0.9); }

/* ===== WHEEL / GAMES ===== */
.wheel-title {
  font-size: var(--text-2xl); font-weight: 800; letter-spacing: 3px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: var(--sp-2);
}
.wheel-subtitle { font-size: var(--text-sm); color: var(--text-3); margin-bottom: var(--sp-4); }
.wheel-limit {
  font-size: var(--text-xs); color: var(--text-3); padding: var(--sp-2) var(--sp-3);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-full);
}
.wheel-container { position: relative; width: 260px; height: 260px; margin-bottom: var(--sp-6); }
.wheel-pointer {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent;
  border-top: 20px solid #f0c040; z-index: 10;
  filter: drop-shadow(0 2px 6px rgba(240,192,64,0.6));
}
.wheel {
  width: 100%; height: 100%; border-radius: 50%;
  box-shadow: 0 0 30px rgba(255,107,53,0.3), 0 0 60px rgba(255,107,53,0.1);
  overflow: hidden; background: var(--bg-elevated);
}
.wheel-spin-btn {
  width: 200px; padding: var(--sp-4);
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  border: none; border-radius: var(--r); color: #fff; font-size: var(--text-lg);
  font-weight: 800; letter-spacing: 3px; cursor: pointer;
  box-shadow: var(--shadow-accent); transition: transform 0.3s var(--ease-bounce); text-transform: uppercase;
}
.wheel-spin-btn:active { transform: scale(0.95); }
.wheel-spin-btn:disabled { opacity: 0.4; cursor: default; background: #444; box-shadow: none; }

.wheel-result {
  margin-top: var(--sp-6); padding: var(--sp-5) var(--sp-6);
  background: var(--accent-soft); border: 1px solid var(--accent-dim);
  border-radius: var(--r); text-align: center; animation: scaleIn 0.4s var(--ease-spring);
  box-shadow: var(--shadow-accent);
}
.wheel-result-title { font-size: var(--text-xl); font-weight: 800; color: var(--accent); margin-bottom: var(--sp-2); }
.wheel-result-text { font-size: var(--text-sm); color: var(--text-2); }
.wheel-result.hidden { display: none; }

.game-card {
  width: 120px; padding: var(--sp-5) var(--sp-3); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-lg); text-align: center;
  cursor: pointer; transition: transform 0.3s var(--ease-bounce), border-color 0.3s;
  box-shadow: var(--shadow-sm);
}
.game-card:active { transform: scale(0.93); border-color: var(--accent); }
.game-card-icon { font-size: 36px; margin-bottom: var(--sp-3); }
.game-card-title { font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--sp-1); }
.game-card-desc { font-size: var(--text-xs); color: var(--text-3); }

.slots-machine {
  background: var(--bg-elevated); border: 2px solid var(--border-hover);
  border-radius: var(--r-xl); padding: var(--sp-5); box-shadow: var(--shadow-lg); width: 280px;
}
.slots-header { font-size: 28px; text-align: center; margin-bottom: var(--sp-4); }
.slots-body {
  background: var(--bg); border-radius: var(--r); padding: var(--sp-4);
  border: 1px solid rgba(255,255,255,0.04); box-shadow: inset 0 4px 12px rgba(0,0,0,0.5);
}
.slots-reels { display: flex; gap: var(--sp-3); justify-content: center; }
.slot-reel {
  width: 72px; height: 72px; background: var(--bg-elevated); border-radius: var(--r);
  border: 2px solid rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.5); overflow: hidden;
}
.slot-symbol { font-size: 36px; transition: transform 0.1s; }
.slot-symbol.spinning { animation: slotSpin 0.08s linear infinite; }
.slot-symbol.stopped { animation: slotStop 0.3s var(--ease-spring); }
.slots-lines { height: 2px; background: linear-gradient(90deg, transparent, rgba(255,107,53,0.2), transparent); margin-top: var(--sp-3); border-radius: 1px; }

/* ===== AUTH ===== */
.auth-icon { font-size: 48px; margin-bottom: var(--sp-5); }
.auth-title {
  font-size: var(--text-2xl); font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent), #ff4444);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: var(--sp-2);
}
.auth-subtitle { font-size: var(--text-sm); color: var(--text-3); margin-bottom: var(--sp-6); text-align: center; padding: 0 var(--sp-6); }
.auth-step { width: 100%; max-width: 300px; }
.auth-step.hidden { display: none; }
.auth-input {
  width: 100%; padding: var(--sp-4) var(--sp-5); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r); color: var(--text);
  font-size: var(--text-lg); font-weight: 600; text-align: center; outline: none;
  margin-bottom: var(--sp-3); transition: border-color 0.25s, box-shadow 0.25s; box-shadow: var(--shadow-sm);
}
.auth-input:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-input::placeholder { color: var(--text-3); }
.auth-code-input { font-size: 28px; letter-spacing: 12px; font-weight: 800; }
.auth-btn {
  width: 100%; padding: var(--sp-4);
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  border: none; border-radius: var(--r); color: #000; font-size: var(--text-base);
  font-weight: 700; letter-spacing: 0.5px; cursor: pointer;
  box-shadow: var(--shadow-accent); transition: transform 0.3s var(--ease-bounce);
}
.auth-btn:active { transform: scale(0.97); }
.auth-code-hint {
  font-size: var(--text-sm); color: var(--accent); margin-bottom: var(--sp-3);
  padding: var(--sp-3) var(--sp-5); background: var(--accent-soft);
  border-radius: var(--r-sm); text-align: center;
}

/* ===== PROFILE ===== */
.profile-header { display: flex; flex-direction: column; align-items: center; padding: var(--sp-6) 0; }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: var(--sp-4); box-shadow: var(--shadow-accent); overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: var(--text-xl); font-weight: 800; margin-bottom: var(--sp-1); }
.profile-phone { font-size: var(--text-sm); color: var(--text-3); margin-bottom: var(--sp-5); }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); width: 100%; }
.profile-stat {
  text-align: center; padding: var(--sp-4) var(--sp-2); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-sm);
}
.profile-stat-value { font-size: var(--text-xl); font-weight: 800; color: var(--accent); }
.profile-stat-label { font-size: 10px; color: var(--text-3); margin-top: var(--sp-1); text-transform: uppercase; letter-spacing: 0.5px; }
.profile-section { margin-top: var(--sp-6); }
.profile-section-title {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-3); text-transform: uppercase; margin-bottom: var(--sp-3); padding: 0 var(--sp-1);
}
.profile-menu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  margin-bottom: var(--sp-2); cursor: pointer; transition: border-color 0.2s;
  font-size: var(--text-sm); box-shadow: var(--shadow-sm);
}
.profile-menu-item:active { border-color: var(--accent-dim); }
.profile-menu-item span:last-child { color: var(--text-3); font-size: 16px; }

/* ===== PAGINATION ===== */
.pg-btn {
  padding: var(--sp-3) var(--sp-5);
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  border: none; border-radius: var(--r); color: #fff; font-size: var(--text-sm);
  font-weight: 700; cursor: pointer; transition: transform 0.25s var(--ease-bounce);
  box-shadow: var(--shadow-accent);
}
.pg-btn:active { transform: scale(0.95); }
.pg-info {
  padding: var(--sp-3) var(--sp-4); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text-2); font-size: var(--text-sm); font-weight: 600;
}

/* ===== FLY TO CART ===== */
.fly-dot {
  position: fixed; width: 10px; height: 10px; background: var(--accent);
  border-radius: 50%; z-index: 9999; pointer-events: none;
  box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent-glow);
  animation: flyDot 0.45s var(--ease) forwards;
}
@keyframes flyDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: translate(var(--fly-x), var(--fly-y)) scale(0); opacity: 0; }
}
.cart-bounce { animation: cartBounce 0.4s var(--ease-bounce); }
@keyframes cartBounce { 0% { transform: scale(1); } 30% { transform: scale(1.3); } 50% { transform: scale(0.85); } 100% { transform: scale(1); } }

/* ===== PULL TO REFRESH ===== */
.ptr-indicator { text-align: center; padding: var(--sp-3) 0; opacity: 0; transition: opacity 0.2s; }
.ptr-spinner {
  width: 22px; height: 22px; margin: 0 auto;
  border: 3px solid rgba(255,107,53,0.15); border-top-color: var(--accent); border-radius: 50%;
}
.ptr-spinning { animation: spin 0.6s linear infinite; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } 60% { opacity: 1; } to { transform: scale(1); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { box-shadow: var(--shadow-accent); } 50% { box-shadow: 0 4px 28px rgba(255,107,53,0.4); } }
@keyframes pulseGreen { 0%, 100% { box-shadow: 0 4px 16px rgba(52,211,153,0.25); } 50% { box-shadow: 0 6px 24px rgba(52,211,153,0.4); } }
@keyframes pop { 0% { transform: scale(0); } 50% { transform: scale(1.4); } 100% { transform: scale(1); } }
@keyframes ripple { 0% { transform: scale(0); opacity: 1; } 100% { transform: scale(4); opacity: 0; } }
@keyframes loaderSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
@keyframes slideOut { 0% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(-120%); opacity: 0; height: 0; padding: 0; margin: 0; border: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slotSpin { 0% { transform: translateY(-100%); opacity: 0.5; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes slotStop { 0% { transform: scale(1.3) translateY(-10px); } 60% { transform: scale(0.95); } 100% { transform: scale(1); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
  .cat-grid, .brand-grid { gap: var(--sp-2); }
  .prod-card { padding: var(--sp-2); }
  .detail-visual { height: 160px; }
  .detail-price { font-size: var(--text-2xl); }
}
@media (min-width: 480px) {
  .cat-grid, .brand-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.auth-content { display: flex; flex-direction: column; align-items: center; padding-top: 48px; }
.wheel-content { display: flex; flex-direction: column; align-items: center; padding-top: 24px; }
