/* ─── NAVBAR ─────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 1000;
  background: rgba(7, 7, 15, 0.80);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--ease-base), box-shadow var(--ease-base);
}

#navbar.scrolled {
  background: rgba(7, 7, 15, 0.95);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.navbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 12px;
  padding: 0 20px;
  max-width: 1280px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .navbar-inner { padding: 0 32px; gap: 16px; }
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
}

.navbar-logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.navbar-cats {
  display: none;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  max-width: 600px;
  overflow: hidden;
  transition: opacity 0.2s ease, max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), gap 0.25s ease;
}

@media (min-width: 768px) {
  .navbar-cats { display: flex; }
}

/* Hide categories when search is expanded */
.navbar-inner.search-active .navbar-cats {
  opacity: 0;
  max-width: 0;
  gap: 0;
  pointer-events: none;
}

.nav-cat-btn {
  padding: 5px 12px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--ease-base);
  white-space: nowrap;
}

.nav-cat-btn:hover {
  background: var(--glass);
  border-color: var(--glass-border);
  color: var(--text-1);
}

.nav-cat-btn.active {
  background: rgba(124, 58, 237, 0.12);
  border-color: var(--glass-border-accent);
  color: var(--violet-light);
}

/* ── Navbar search — collapsed icon → expanded input ──────────────────────── */

.navbar-search {
  position: relative;
  flex-shrink: 0;
  display: none;
  height: 38px;
  width: 38px;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: left center;
}

@media (min-width: 768px) {
  .navbar-search { display: block; }
}

.navbar-search:hover,
.navbar-search.expanded {
  width: 280px;
}

/* ── Icon button (always visible, becomes left icon when expanded) ─────────── */

.search-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  z-index: 2;
  flex-shrink: 0;
  transition: background var(--ease-fast), border-color var(--ease-fast), color var(--ease-fast);
}

.navbar-search:hover .search-btn,
.navbar-search.expanded .search-btn {
  background: var(--glass-hover);
  border-color: var(--glass-border-accent);
  color: var(--violet-light);
}

/* ── Text input ───────────────────────────────────────────────────────────── */

.navbar-search input {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 38px;
  padding: 0 32px 0 44px;
  border-radius: var(--r-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-1);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, border-color var(--ease-fast);
}

.navbar-search:hover input,
.navbar-search.expanded input {
  opacity: 1;
  pointer-events: auto;
}

.navbar-search.expanded input:focus { border-color: var(--glass-border-accent); }

.navbar-search input::placeholder { color: var(--text-3); }

/* ── Clear / close button ─────────────────────────────────────────────────── */

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background var(--ease-fast), color var(--ease-fast);
}

.navbar-search:hover .search-clear-btn,
.navbar-search.expanded .search-clear-btn {
  opacity: 1;
  pointer-events: auto;
}

.search-clear-btn:hover { background: var(--glass-hover); color: var(--text-1); border-color: var(--glass-border-accent); }

/* ── Suggestions dropdown ─────────────────────────────────────────────────── */

.search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  min-width: 280px;
  background: var(--bg2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 600;
  max-height: 420px;
  overflow-y: auto;
}

.search-suggestions[hidden] { display: none; }

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-2);
  transition: background var(--ease-fast);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.suggestion-item:last-of-type { border-bottom: none; }

.suggestion-item:hover,
.suggestion-item.highlighted {
  background: var(--glass);
  color: var(--text-1);
}

.suggestion-thumb {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.suggestion-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.suggestion-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-name mark {
  background: rgba(124,58,237,0.25);
  color: var(--violet-light);
  border-radius: 2px;
  padding: 0 1px;
}

.suggestion-cat {
  font-size: 0.72rem;
  color: var(--text-4);
  margin-top: 2px;
}

.suggestion-price {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--success);
  white-space: nowrap;
  flex-shrink: 0;
}

.suggestion-all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--violet-light);
  font-weight: 600;
  text-decoration: none;
  background: rgba(124,58,237,0.06);
  border-top: 1px solid var(--glass-border);
  transition: background var(--ease-fast);
}

.suggestion-all:hover,
.suggestion-all.highlighted { background: rgba(124,58,237,0.12); }

.suggestion-empty {
  padding: 16px 14px;
  font-size: 0.85rem;
  color: var(--text-3);
  text-align: center;
}

.suggestion-loading {
  padding: 16px 14px;
  font-size: 0.82rem;
  color: var(--text-4);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.navbar-spacer { flex: 1; }

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

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  position: relative;
  transition: background var(--ease-fast), border-color var(--ease-fast), color var(--ease-fast);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-accent);
  color: var(--violet-light);
}

.icon-btn svg { width: 18px; height: 18px; }

.icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: var(--violet);
  color: #fff;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.icon-badge.pop {
  animation: cartBadgePop 300ms var(--ease-spring) forwards;
}

.user-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: border-color var(--ease-fast), background var(--ease-fast);
}

@media (min-width: 1024px) {
  .user-btn { display: flex; }
}

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

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}

.user-name {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

/* ─── BOTTOM NAV (mobile only) ───────────────── */
#bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(13, 13, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  #bottom-nav { display: none; }
}

.bottom-nav-items {
  display: flex;
  width: 100%;
  justify-content: space-around;
  align-items: flex-end;
  padding: 8px 0 4px;
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 12px;
  position: relative;
  transition: color var(--ease-fast);
  color: var(--text-3);
  background: none;
  border: none;
  font-family: var(--font-body);
}

.bn-item svg { width: 22px; height: 22px; transition: transform var(--ease-spring); }

.bn-item span {
  font-size: 10px;
  font-weight: 500;
  transition: color var(--ease-fast);
}

.bn-item.active { color: var(--violet-light); }
.bn-item.active svg { transform: scale(1.1); }
.bn-item.active::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--violet);
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
}

.bn-item.nav-animate svg { animation: navIconPop 300ms var(--ease-spring) forwards; }

.bn-item .icon-badge {
  top: 0;
  right: 4px;
}

/* ─── PRODUCT CARD ───────────────────────────── */
.product-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--ease-base), border-color var(--ease-base), box-shadow var(--ease-base);
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-border-accent);
  box-shadow: 0 24px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,58,237,0.1);
}

.card-image {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-emoji {
  font-size: 48px;
  line-height: 1;
  transition: transform var(--ease-base);
  user-select: none;
  pointer-events: none;
}

.product-card:hover .card-emoji { transform: scale(1.1); }

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}

.card-badge.hot   { background: var(--hot); }
.card-badge.sale  { background: var(--danger); }
.card-badge.new   { background: var(--success); }

.card-wish {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--ease-fast), background var(--ease-fast), transform var(--ease-spring);
}

.card-wish:hover { color: var(--danger); background: rgba(239,68,68,0.15); }
.card-wish.active { color: var(--danger); }
.card-wish.active svg { fill: var(--danger); }
.card-wish.pop { animation: heartPop 300ms var(--ease-spring) forwards; }

.card-wish svg { width: 14px; height: 14px; }

.card-body { padding: 12px; }

.card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.card-meta {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 11px;
}

.stars-row { color: var(--text-3); letter-spacing: 1px; }
.star-filled { color: var(--warning); }
.rating-count { color: var(--text-3); font-size: 10px; }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-price-block { display: flex; flex-direction: column; gap: 1px; }

.card-price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--violet-light);
  line-height: 1.2;
}

.card-orig-price {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  color: var(--text-4);
  text-decoration: line-through;
}

.card-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: transform var(--ease-spring), opacity var(--ease-fast);
}

.card-add-btn:hover { opacity: 0.85; }
.card-add-btn:active { transform: scale(0.9); }
.card-add-btn.click { animation: cartBounce 300ms var(--ease-spring) forwards; }
.card-add-btn svg { width: 14px; height: 14px; }

/* Particle burst */
.particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  pointer-events: none;
  animation: particleOut 400ms ease-out forwards;
}

/* ─── SKELETON LOADER ────────────────────────── */
.skeleton-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.skeleton-img {
  height: 130px;
  background: linear-gradient(90deg, var(--bg2) 0%, var(--bg3) 50%, var(--bg2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

.skeleton-body { padding: 12px; }

.skeleton-line {
  height: 12px;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--bg2) 0%, var(--bg3) 50%, var(--bg2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  margin-bottom: 8px;
}

.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }

.skeleton-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.skeleton-price {
  width: 60px;
  height: 16px;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--bg2) 0%, var(--bg3) 50%, var(--bg2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

.skeleton-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--bg2) 0%, var(--bg3) 50%, var(--bg2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

/* ─── TOAST ──────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg2);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  min-width: 240px;
  max-width: 340px;
  pointer-events: auto;
  animation: toastIn 300ms ease-out forwards;
}

.toast.out { animation: toastOut 250ms ease-in forwards; }

.toast.success {
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.toast.error {
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.toast.info {
  border: 1px solid var(--glass-border-accent);
}

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }

/* ─── FOOTER ─────────────────────────────────── */
#footer {
  background: var(--bg1);
  border-top: 1px solid var(--glass-border);
  margin-top: 48px;
  position: relative;
  z-index: 1;
}

.footer-main {
  padding: 48px 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 640px) {
  .footer-main { grid-template-columns: repeat(2, 1fr); padding: 48px 32px; }
}

@media (min-width: 1024px) {
  .footer-main {
    grid-template-columns: 1.8fr repeat(4, 1fr);
    padding: 64px 48px;
    gap: 40px;
  }
}

.footer-brand-desc {
  font-size: 13px;
  color: var(--text-3);
  margin: 12px 0 16px;
  line-height: 1.6;
  max-width: 280px;
}

.footer-socials {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.footer-social-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  transition: color var(--ease-fast), border-color var(--ease-fast), background var(--ease-fast);
}

.footer-social-btn:hover {
  color: var(--violet-light);
  border-color: var(--glass-border-accent);
  background: var(--glass-hover);
}

.footer-social-btn svg { width: 16px; height: 16px; }

.footer-newsletter {
  display: flex;
  gap: 8px;
}

.footer-newsletter input {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--r-full);
  background: var(--bg3);
  border: 1px solid var(--glass-border);
  color: var(--text-1);
  font-size: 12px;
}

.footer-newsletter input::placeholder { color: var(--text-3); }

.footer-newsletter button {
  padding: 9px 16px;
  border-radius: var(--r-full);
  background: var(--gradient);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--ease-fast);
  white-space: nowrap;
}

.footer-newsletter button:hover { opacity: 0.85; }

.footer-col-heading {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 14px;
}

.footer-links { display: flex; flex-direction: column; gap: 10px; }

.footer-links a {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-3);
  transition: color var(--ease-fast);
}

.footer-links a:hover { color: var(--violet-light); }

.footer-bottom {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    padding: 16px 48px;
  }
}

.footer-copy {
  font-size: 12px;
  color: var(--text-3);
}

.payment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.payment-badge {
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-body);
}

/* ─── EMPTY STATE ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-3);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; }

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-2);
  margin-bottom: 8px;
}

.empty-state p { font-size: 14px; }

/* ─── PRODUCT GRID ───────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 480px) {
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
}

.stagger-in {
  opacity: 0;
  animation: staggerIn 400ms ease forwards;
}
