/* ============ RESET ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
*::selection { background: var(--accent); color: #fff; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

:root {
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --nav-h: 76px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.12);
  --shadow: 0 8px 24px rgba(0,0,0,.18);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.25);
  --accent: #ff6b35;
  --accent-2: #ffb84d;
  --accent-grad: linear-gradient(135deg, #ff6b35 0%, #ffb84d 100%);
  --success: #4ade80;
  --danger: #f87171;
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --card: #16161f;
  --elevated: #1f1f2b;
  --border: rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.12);
  --text: #f0f0f5;
  --text-2: #b8b8c4;
  --text-muted: #6b6b7a;
  --glass: rgba(22,22,31,.72);
  --input-bg: rgba(255,255,255,.04);
  --hover: rgba(255,255,255,.05);
  --skeleton: rgba(255,255,255,.06);
  --skeleton-shine: rgba(255,255,255,.12);
  --overlay: rgba(0,0,0,.65);
}

[data-theme="light"] {
  --bg: #f5f5f8;
  --bg-2: #ededf2;
  --card: #ffffff;
  --elevated: #ffffff;
  --border: rgba(0,0,0,.08);
  --border-strong: rgba(0,0,0,.14);
  --text: #121218;
  --text-2: #4a4a55;
  --text-muted: #8a8a95;
  --glass: rgba(255,255,255,.78);
  --input-bg: #f5f5f8;
  --hover: rgba(0,0,0,.04);
  --skeleton: rgba(0,0,0,.06);
  --skeleton-shine: rgba(0,0,0,.11);
  --overlay: rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow: 0 8px 24px rgba(0,0,0,.09);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.13);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

#app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 32px + env(safe-area-inset-bottom, 0));
  position: relative;
}

/* OFFLINE */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.header-glow {
  position: absolute;
  top: -80px;
  left: -60px;
  width: 260px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,107,53,.28), transparent 70%);
  pointer-events: none;
  animation: glowFloat 12s ease-in-out infinite;
}
.header-glow::after {
  content: '';
  position: absolute;
  right: -300px;
  top: 40px;
  width: 220px;
  height: 180px;
  background: radial-gradient(circle, rgba(255,184,77,.22), transparent 70%);
  animation: glowFloat 15s ease-in-out infinite reverse;
}
@keyframes glowFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, 10px) scale(1.15); }
}
.header-inner { padding: 14px 16px 16px; position: relative; z-index: 1; }
.header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,107,53,.4);
}
.brand-name {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 1px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.brand-sub { font-size: 9px; letter-spacing: 3px; color: var(--text-muted); font-weight: 700; margin-top: 2px; }
.header-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  position: relative;
  transition: all var(--transition);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn:hover { border-color: var(--border-strong); }
.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--glass);
}
.address-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}
.address-row .dot { opacity: .5; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.search {
  width: 100%;
  padding: 13px 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
}
.search::placeholder { color: var(--text-muted); }
.search:focus { border-color: var(--accent); background: var(--card); }
.search-clear {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* CONTENT */
.content { padding: 16px; animation: fadeInUp .3s ease; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* RECENT */
.recent-section { margin-bottom: 20px; }
.section-head { margin-bottom: 10px; }
.section-title { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.recent-scroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.recent-scroll::-webkit-scrollbar { display: none; }
.recent-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 190px;
}
.recent-card:active { transform: scale(.97); }
.recent-card:hover { border-color: var(--border-strong); }
.recent-emoji {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.recent-title { font-size: 13px; font-weight: 700; }
.recent-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.recent-arrow { margin-left: auto; color: var(--text-muted); }

/* CATEGORIES */
.categories-bar {
  display: flex;
  gap: 8px;
  margin: 0 -16px 16px;
  padding: 0 16px;
  align-items: center;
}
.cat-all {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--accent-grad);
  color: #fff;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(255,107,53,.35);
}
.cat-all:active { transform: scale(.95); }
.cats-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.cats-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-2);
  transition: all var(--transition);
  flex-shrink: 0;
}
.cat-chip:active { transform: scale(.95); }
.cat-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat-emoji { font-size: 15px; }

/* PRODUCTS */
.products-list { display: grid; gap: 12px; }
.product {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  gap: 12px;
  transition: all var(--transition);
}
.product:active { transform: scale(.985); }
.product:hover { border-color: var(--border-strong); }
.product-img {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.product-emoji { font-size: 42px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.product-photo { width: 100%; height: 100%; object-fit: cover; }

/* gradients */
.grad-1 { background: linear-gradient(135deg, #ff6b35, #ffb84d); }
.grad-2 { background: linear-gradient(135deg, #f87171, #fbbf24); }
.grad-3 { background: linear-gradient(135deg, #4ade80, #22d3ee); }
.grad-4 { background: linear-gradient(135deg, #a78bfa, #f472b6); }
.grad-5 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.grad-6 { background: linear-gradient(135deg, #60a5fa, #a78bfa); }
.grad-7 { background: linear-gradient(135deg, #34d399, #10b981); }
.grad-8 { background: linear-gradient(135deg, #fb923c, #f472b6); }

.fav-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all var(--transition);
}
.fav-btn.active { color: #ef4444; background: rgba(255,255,255,.95); }
.fav-btn:active { transform: scale(.88); }
.product-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.product-text { cursor: pointer; }
.product-name { font-weight: 700; font-size: 14px; margin-bottom: 3px; letter-spacing: -.2px; }
.product-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.product-price { font-weight: 800; font-size: 15px; letter-spacing: -.3px; }
.add-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255,107,53,.4);
  transition: all .18s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}
.add-btn:active { transform: scale(.85); }
.add-btn.has-item {
  width: 42px;
  background: var(--card);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}
.add-count { font-weight: 900; font-size: 14px; position: absolute; top: 50%; left: 8px; transform: translateY(-50%); }

/* EMPTY */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state.big { padding: 80px 24px; }
.empty-state.small { padding: 40px 24px; }
.empty-icon { color: var(--text-muted); opacity: .4; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; margin-bottom: 20px; }

/* SKELETON */
.skeleton {
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-shine) 50%, var(--skeleton) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card { pointer-events: none; }
.skeleton-img { width: 92px; height: 92px; border-radius: 12px; }
.skeleton-line { height: 12px; margin-bottom: 6px; }
.skeleton-circle { width: 38px; height: 38px; border-radius: 12px; }

/* CART */
.cart-list { display: grid; gap: 10px; margin-bottom: 20px; }
.cart-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-item-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  overflow: hidden;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 700; font-size: 13.5px; }
.cart-item-price { color: var(--accent); font-weight: 700; font-size: 12.5px; margin-top: 2px; }
.cart-item-sum { font-weight: 800; font-size: 14px; min-width: 60px; text-align: right; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--hover);
  border-radius: 10px;
  padding: 4px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.qty-btn:active { transform: scale(.85); background: var(--accent); color: #fff; }
.qty-btn.big { width: 46px; height: 46px; border-radius: 14px; }
.qty-val { font-weight: 800; font-size: 13px; min-width: 18px; text-align: center; }

/* SUMMARY */
.summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.summary-row.total {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-bottom: 0;
}
.summary-row.total span:last-child { color: var(--accent); }
.free-delivery { color: var(--success); font-weight: 700; }
.delivery-hint {
  background: var(--hover);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.delivery-hint strong { color: var(--accent); }

/* BUTTONS */
.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--accent-grad);
  color: #fff;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.2px;
  box-shadow: 0 6px 20px rgba(255,107,53,.4);
  transition: all var(--transition);
  max-width: 320px;
  margin: 0 auto;
  display: block;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary.big { padding: 17px; font-size: 15.5px; max-width: none; }
.btn-primary:disabled { background: var(--hover); color: var(--text-muted); box-shadow: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--hover);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  transition: all var(--transition);
}
.btn-ghost:active { transform: scale(.94); }

/* ORDERS */
.orders-list { display: grid; gap: 12px; }
.order-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.order-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.order-id { font-weight: 800; font-size: 14.5px; }
.order-date { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.order-items-preview { display: flex; gap: 4px; margin-bottom: 12px; align-items: center; }
.order-preview-emoji {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.order-more { font-size: 11px; color: var(--text-muted); font-weight: 700; padding-left: 4px; }
.order-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

/* PROFILE */
.profile-view { padding-top: 8px; }
.profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.profile-card:active { transform: scale(.98); }
.profile-card:hover { border-color: var(--border-strong); }
.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(255,107,53,.35);
  flex-shrink: 0;
}
.profile-body { flex: 1; min-width: 0; }
.profile-name { font-weight: 800; font-size: 16px; }
.profile-phone { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.profile-address {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-edit-icon { color: var(--text-muted); flex-shrink: 0; }

.settings-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.settings-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.theme-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-opt {
  padding: 14px 8px;
  background: var(--hover);
  border: 1.5px solid transparent;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
  transition: all var(--transition);
}
.theme-opt.active { border-color: var(--accent); background: rgba(255,107,53,.08); color: var(--accent); }
.theme-opt:active { transform: scale(.96); }

.menu-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.menu-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.menu-list-item:last-child { border-bottom: none; }
.menu-list-item:active { background: var(--hover); }
.menu-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.menu-ico.danger { background: rgba(248,113,113,.15); color: var(--danger); }
.menu-content { flex: 1; }
.menu-label { font-size: 14px; font-weight: 600; }
.menu-label.danger { color: var(--danger); }

.app-info { text-align: center; font-size: 11.5px; color: var(--text-muted); padding: 20px; letter-spacing: .3px; }

/* MINI-CART */
.mini-cart {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom, 0));
  left: 16px;
  right: 16px;
  max-width: 608px;
  margin: 0 auto;
  background: var(--accent-grad);
  color: #fff;
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 32px rgba(255,107,53,.5);
  z-index: 60;
  cursor: pointer;
  transition: transform var(--transition);
}
.mini-cart:active { transform: scale(.97); }
.mini-cart-left { display: flex; align-items: center; gap: 12px; }
.mini-cart-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #fff;
}
.mini-cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #fff;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  animation: popBadge .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popBadge {
  0% { transform: scale(0); }
  70% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.mini-cart-total { font-weight: 900; font-size: 15px; }
.mini-cart-sub { font-size: 11px; opacity: .85; margin-top: 1px; }
.mini-cart-right { display: flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 800; }

/* BOTTOM NAV */
.bottom-nav {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom, 0));
  left: 16px;
  right: 16px;
  max-width: 608px;
  margin: 0 auto;
  z-index: 70;
}
.nav-pill {
  display: flex;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--text-muted);
  transition: all var(--transition);
  border-radius: 16px;
  position: relative;
}
.nav-item:active { transform: scale(.9); }
.nav-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}
.nav-item.active .nav-icon-wrap {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,107,53,.45);
  transform: translateY(-3px) scale(1.05);
}
.nav-item.active { color: var(--accent); }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: .2px; transition: all var(--transition); }
.nav-item.active .nav-label { font-size: 10.5px; }
.nav-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239,68,68,.5);
  border: 1.5px solid var(--bg);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  background: var(--elevated);
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  padding: 8px 20px 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--border-strong);
  overscroll-behavior: contain;
}
.modal-handle {
  width: 38px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 8px auto 4px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 16px;
  position: sticky;
  top: 0;
  background: var(--elevated);
  z-index: 2;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}
.modal-head h3 { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
}

/* Categories grid */
.cats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat-grid-item {
  padding: 16px 12px;
  background: var(--hover);
  border: 1.5px solid transparent;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
}
.cat-grid-item.active { border-color: var(--accent); background: rgba(255,107,53,.1); }
.cat-grid-item:active { transform: scale(.96); }
.cat-grid-emoji { font-size: 28px; }
.cat-grid-name { font-size: 12.5px; font-weight: 700; text-align: center; color: var(--text-2); line-height: 1.25; }
.cat-grid-item.active .cat-grid-name { color: var(--accent); }

/* Favorites list */
.fav-list { display: grid; gap: 10px; }

/* Form */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14.5px;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
  resize: 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); background: var(--card); }

/* Info blocks */
.info-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}
.info-block:last-child { margin-bottom: 0; }
.info-block-link:active { transform: scale(.98); }
.info-block-icon { font-size: 24px; flex-shrink: 0; line-height: 1; }
.info-block-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 4px;
}
.info-block-value { font-size: 14.5px; font-weight: 600; color: var(--text); line-height: 1.35; }

/* WA button */
.btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  box-shadow: 0 6px 20px rgba(37,211,102,.35);
}
.btn-wa:active { transform: scale(.97); }
.order-wa-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(37,211,102,.15);
  color: #25D366;
  flex-shrink: 0;
}

/* ============ PRODUCT DETAIL ============ */
.detail-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 250;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.detail-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.detail-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0));
  pointer-events: none;
}
.detail-back, .detail-fav {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  pointer-events: auto;
  transition: all var(--transition);
}
.detail-back:active, .detail-fav:active { transform: scale(.9); }
.detail-fav.active { color: #ef4444; background: #fff; border-color: #fff; }

.detail-hero {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-top: -72px;
  padding-top: 72px;
}
.detail-emoji {
  font-size: 150px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.3));
  animation: popIn .5s cubic-bezier(.34,1.56,.64,1);
}
.detail-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.detail-body {
  padding: 24px 20px 40px;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  margin-top: -28px;
  position: relative;
  z-index: 2;
  min-height: 300px;
}
.detail-name {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.6px;
  margin-bottom: 8px;
  line-height: 1.15;
}
.detail-price {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: -.4px;
}
.detail-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-2);
  margin-bottom: 24px;
}
.detail-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.detail-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px;
  margin-bottom: 24px;
}
.detail-qty-center {
  text-align: center;
}
.detail-qty-num {
  font-size: 22px;
  font-weight: 900;
}
.detail-qty-sum {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}
.detail-similar {
  padding-top: 8px;
}
.detail-similar-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -.3px;
}
.detail-similar-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -20px;
  padding: 0 20px 8px;
  scrollbar-width: none;
}
.detail-similar-scroll::-webkit-scrollbar { display: none; }
.similar-card {
  flex-shrink: 0;
  width: 140px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.similar-card:active { transform: scale(.96); }
.similar-card:hover { border-color: var(--border-strong); }
.similar-img {
  width: 100%;
  height: 90px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 8px;
  overflow: hidden;
}
.similar-name {
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.similar-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
}

/* Success */
.success-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}
.success-icon {
  color: var(--success);
  margin-bottom: 24px;
  animation: popIn .6s cubic-bezier(.34,1.56,.64,1);
}
.success-screen h2 { font-size: 24px; margin-bottom: 10px; font-weight: 800; letter-spacing: -.5px; }
.success-screen p { color: var(--text-muted); margin-bottom: 32px; font-size: 14px; max-width: 280px; }

/* Install */
.install-banner {
  position: fixed;
  bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0));
  left: 16px;
  right: 16px;
  max-width: 608px;
  margin: 0 auto;
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 90;
}
.install-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.install-text { flex: 1; min-width: 0; }
.install-title { font-weight: 800; font-size: 14px; }
.install-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.install-btn {
  padding: 9px 14px;
  background: var(--accent-grad);
  color: #fff;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 800;
}
.install-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 90px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%);
  background: var(--elevated);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 400;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
}
.toast-icon { color: var(--accent); display: flex; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }

/* Flying dot */
.flying-dot {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  z-index: 500;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(255,107,53,.9);
}

/* TRANSITIONS */
.fade-enter-active, .fade-leave-active { transition: opacity .25s; }
.fade-enter, .fade-leave-to { opacity: 0; }

.slide-down-enter-active, .slide-down-leave-active { transition: all .25s; }
.slide-down-enter, .slide-down-leave-to { transform: translateY(-100%); opacity: 0; }

.slide-up-enter-active, .slide-up-leave-active { transition: all .3s cubic-bezier(.34,1.56,.64,1); }
.slide-up-enter, .slide-up-leave-to { transform: translateY(120%); opacity: 0; }

.detail-enter-active, .detail-leave-active {
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .25s;
}
.detail-enter, .detail-leave-to {
  transform: translateY(100%);
  opacity: 0;
}

.modal-enter-active .modal { animation: modalIn .3s cubic-bezier(.34,1.56,.64,1); }
.modal-enter-active { transition: opacity .25s; }
.modal-leave-active .modal { animation: modalOut .25s ease-in; }
.modal-leave-active { transition: opacity .25s; }
.modal-enter, .modal-leave-to { opacity: 0; }
@keyframes modalIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes modalOut {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

.mini-cart-enter-active, .mini-cart-leave-active {
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
}
.mini-cart-enter, .mini-cart-leave-to {
  transform: translateY(120%);
  opacity: 0;
}

.toast-enter-active, .toast-leave-active {
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
.toast-enter, .toast-leave-to {
  transform: translate(-50%, 20px);
  opacity: 0;
}

.product-list-enter-active, .product-list-leave-active { transition: all .3s ease; }
.product-list-enter, .product-list-leave-to { opacity: 0; transform: translateY(10px); }
.product-list-move { transition: transform .3s; }

.cart-item-list-enter-active, .cart-item-list-leave-active { transition: all .25s ease; }
.cart-item-list-enter, .cart-item-list-leave-to { opacity: 0; transform: translateX(-20px); }
.cart-item-list-leave-active { position: absolute; }
.cart-item-list-move { transition: transform .3s; }

@keyframes addPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.add-btn.pulse { animation: addPulse .3s; }