/* =========================================================
   CodeVault — Design System
   ========================================================= */

:root {
  --brand-600: #4f46e5;
  --brand-500: #6366f1;
  --brand-400: #818cf8;
  --violet-500: #7c3aed;
  --ink-900: #14142b;
  --ink-700: #262338;
  --ink-500: #4e4b66;
  --ink-300: #6e7191;
  --muted-400: #a0a3bd;
  --line-200: #e9e8f5;
  --surface-0: #ffffff;
  --surface-50: #f7f7fc;
  --surface-100: #f4f5f9;
  --success-500: #17c964;
  --danger-500: #ef4444;
  --warn-500: #f59e0b;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(20, 20, 43, 0.06);
  --shadow-md: 0 8px 30px rgba(20, 20, 43, 0.08);
  --shadow-lg: 0 20px 60px rgba(20, 20, 43, 0.14);
  --gradient-brand: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --gradient-dark: linear-gradient(135deg, #14142b 0%, #262054 100%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink-700);
  background: var(--surface-100);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 20, 43, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14.5px;
  font-weight: 500;
  transition: color .15s ease;
}
.nav-links a:hover { color: #fff; }
.nav-cta {
  background: var(--gradient-brand);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

/* ---------- Hero ---------- */
.hero {
  background: var(--gradient-dark);
  position: relative;
  overflow: hidden;
  padding: 88px 0 100px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(124, 58, 237, 0.35), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(79, 70, 229, 0.35), transparent 45%);
}
.hero-inner { position: relative; text-align: center; max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #c7d2fe;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 {
  color: #fff;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 18px;
}
.hero h1 span {
  background: linear-gradient(135deg, #a5b4fc, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: rgba(255,255,255,0.68);
  font-size: 17px;
  line-height: 1.7;
  margin: 0 0 36px;
}
.hero-stats {
  display: flex; justify-content: center; gap: 48px; margin-top: 52px;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; color: #fff; font-size: 26px; font-weight: 800; }
.hero-stat span { color: var(--muted-400); font-size: 13px; }

/* ---------- Search bar ---------- */
.search-bar {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: flex;
  gap: 8px;
  max-width: 620px;
  margin: 0 auto;
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 10px;
  font-family: inherit;
}
.search-bar button {
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
}

/* ---------- Section ---------- */
.section { padding: 64px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.section-head h2 { font-size: 28px; font-weight: 800; color: var(--ink-900); letter-spacing: -0.02em; margin: 0 0 6px; }
.section-head p { color: var(--ink-300); margin: 0; font-size: 15px; }

/* ---------- Filters ---------- */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; }
.filter-chip {
  padding: 9px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-200);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  transition: all .15s ease;
}
.filter-chip:hover { border-color: var(--brand-400); color: var(--brand-600); }
.filter-chip.active { background: var(--gradient-brand); color: #fff; border-color: transparent; }

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.product-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line-200);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.product-card-link { display: block; color: inherit; }
.product-thumb {
  aspect-ratio: 16/10;
  background: var(--gradient-brand);
  position: relative;
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85); font-size: 34px; font-weight: 800;
}
.product-cat {
  position: absolute; top: 12px; left: 12px;
  background: rgba(20,20,43,0.65);
  color: #fff; font-size: 11.5px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.product-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-body h3 { margin: 0; font-size: 16.5px; font-weight: 700; color: var(--ink-900); line-height: 1.4; }
.product-body p { margin: 0; font-size: 13.5px; color: var(--ink-300); line-height: 1.6; flex: 1; }
.product-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; margin-top: auto; border-top: 1px solid var(--line-200);
}
.price-tag { font-size: 19px; font-weight: 800; color: var(--ink-900); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; font-family: inherit;
  border-radius: 10px; font-weight: 600; font-size: 14px;
  padding: 10px 20px; transition: all .15s ease;
}
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 6px 16px rgba(99,102,241,0.3); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-outline { background: #fff; color: var(--ink-700); border: 1px solid var(--line-200); }
.btn-outline:hover { border-color: var(--brand-400); color: var(--brand-600); }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger-500); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-500); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 80px 20px; color: var(--ink-300); }
.empty-state h3 { color: var(--ink-700); margin-bottom: 8px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink-900); color: var(--muted-400); padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 36px; }
.footer h4 { color: #fff; font-size: 14px; margin: 0 0 16px; }
.footer p { font-size: 13.5px; line-height: 1.8; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 10px; font-size: 13.5px; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 22px; text-align: center; font-size: 12.5px; }

/* ---------- Product detail ---------- */
.breadcrumb { font-size: 13.5px; color: var(--ink-300); margin-bottom: 24px; }
.breadcrumb a:hover { color: var(--brand-600); }
.product-detail { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }
.detail-thumb { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 16/10; position: relative; }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-thumb .no-img { background: var(--gradient-brand); width: 100%; height: 100%; display:flex; align-items:center; justify-content:center; color:#fff; font-size:52px; font-weight:800; }
.tech-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tech-badge { background: var(--surface-50); border: 1px solid var(--line-200); padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-500); }
.buy-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line-200); padding: 28px; box-shadow: var(--shadow-md); position: sticky; top: 96px; }
.buy-card .price-tag { font-size: 32px; }
.buy-card ul { list-style: none; padding: 0; margin: 20px 0; }
.buy-card li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-500); margin-bottom: 12px; }
.buy-card .check { width: 18px; height: 18px; border-radius: 50%; background: rgba(23,201,100,0.12); color: var(--success-500); display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-700); margin-bottom: 7px; }
.form-control {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line-200); font-size: 14.5px; font-family: inherit;
  outline: none; transition: border-color .15s ease;
  background: #fff;
}
.form-control:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
textarea.form-control { resize: vertical; min-height: 110px; }

/* ---------- Alerts ---------- */
.alert { padding: 14px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(23,201,100,0.1); color: #0e9a51; }
.alert-error { background: rgba(239,68,68,0.1); color: #c62828; }
.alert-info { background: rgba(99,102,241,0.1); color: var(--brand-600); }

/* ---------- Status badge ---------- */
.badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.badge-paid { background: rgba(23,201,100,0.12); color: #0e9a51; }
.badge-pending { background: rgba(245,158,11,0.14); color: #b45309; }
.badge-failed { background: rgba(239,68,68,0.12); color: #c62828; }

/* ---------- Simple page (checkout / success / errors) ---------- */
.page-narrow { max-width: 560px; margin: 64px auto; }
.card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line-200);
  padding: 36px; box-shadow: var(--shadow-md);
}
.card h1 { font-size: 24px; margin: 0 0 8px; color: var(--ink-900); }
.card .muted { color: var(--ink-300); font-size: 14px; margin-bottom: 24px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 34px; }
  .hero-stats { gap: 28px; }
  .product-detail { grid-template-columns: 1fr; }
  .buy-card { position: static; }
  .footer-grid { grid-template-columns: 1fr; }
  .reviews-layout { grid-template-columns: 1fr; }
  .review-form-card { position: static; }
}

/* =========================================================
   Admin Panel
   ========================================================= */
.admin-body { background: var(--surface-100); min-height: 100vh; }
.admin-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.admin-sidebar {
  background: var(--gradient-dark);
  padding: 26px 18px;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 17px; padding: 0 10px 26px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.65); font-size: 14px; font-weight: 500;
  padding: 11px 14px; border-radius: 10px; transition: all .15s ease;
}
.admin-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-nav a.active { background: rgba(255,255,255,0.1); color: #fff; }
.admin-nav .icon { width: 18px; text-align: center; }

.admin-main { padding: 32px 36px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-topbar h1 { font-size: 24px; font-weight: 800; color: var(--ink-900); margin: 0; }
.admin-user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-500); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card { background: #fff; border-radius: var(--radius-md); border: 1px solid var(--line-200); padding: 22px 24px; }
.stat-card .stat-label { font-size: 13px; color: var(--ink-300); font-weight: 600; margin-bottom: 10px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--ink-900); }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 14px; }

.panel { background: #fff; border-radius: var(--radius-md); border: 1px solid var(--line-200); }
.panel-head { padding: 20px 24px; border-bottom: 1px solid var(--line-200); display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 16px; margin: 0; color: var(--ink-900); }
.panel-body { padding: 4px 24px 20px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-300); font-weight: 700; padding: 14px 12px; border-bottom: 1px solid var(--line-200);
}
.data-table td { padding: 14px 12px; font-size: 14px; color: var(--ink-700); border-bottom: 1px solid var(--surface-100); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .cell-muted { color: var(--ink-300); font-size: 13px; }
.thumb-xs { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--gradient-brand); }

.admin-card { background: #fff; border-radius: var(--radius-md); border: 1px solid var(--line-200); padding: 28px; max-width: 640px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.file-drop {
  border: 1.5px dashed var(--line-200); border-radius: 10px; padding: 22px; text-align: center;
  color: var(--ink-300); font-size: 13.5px; background: var(--surface-50); cursor: pointer;
}
.file-drop:hover { border-color: var(--brand-400); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gradient-dark); padding: 20px; }
.login-card { background: #fff; border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-card .brand-mark { margin: 0 auto 18px; }
.login-card h1 { text-align: center; font-size: 22px; margin: 0 0 6px; }
.login-card p.muted { text-align: center; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
}

/* =========================================================
   Pricing badges, flash sale, gallery, coupons
   ========================================================= */
.mrp-strike { color: var(--muted-400); text-decoration: line-through; font-size: 14.5px; font-weight: 600; }
.discount-badge {
  background: rgba(23,201,100,0.12); color: var(--success-500);
  font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 6px;
}
.flash-ribbon {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: linear-gradient(135deg,#f43f5e,#f59e0b); color: #fff;
  font-size: 11px; font-weight: 800; padding: 5px 11px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(244,63,94,0.35);
}
.flash-sale-box {
  background: linear-gradient(135deg,#fef2f2,#fff7ed); border: 1px solid #fecaca;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: #b91c1c;
}
.flash-sale-box strong { font-variant-numeric: tabular-nums; font-size: 15px; }

.gallery-strip { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumb {
  width: 68px; height: 68px; object-fit: cover; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; opacity: .7; transition: all .15s ease;
}
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: var(--brand-500); opacity: 1; }

#coupon-message:empty { display: none; }

/* =========================================================
   Reviews & star ratings
   ========================================================= */
.stars { color: #f59e0b; font-size: 15px; letter-spacing: 1px; }
.stars.small { font-size: 12.5px; }
.rating-summary { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-500); text-decoration: none; }
.rating-summary:hover { text-decoration: underline; }
.rating-summary.muted-link { color: var(--ink-300); font-size: 13px; }

.reviews-section { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line-200); }
.reviews-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.review-card { background: #fff; border: 1px solid var(--line-200); border-radius: var(--radius-md); padding: 18px 20px; margin-bottom: 14px; }
.review-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.review-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--gradient-brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.review-comment { margin: 0; font-size: 14px; color: var(--ink-500); line-height: 1.7; }
.review-form-card { background: var(--surface-50); border-radius: var(--radius-md); padding: 24px; position: sticky; top: 96px; }
.review-form-card h3 { margin: 0 0 16px; font-size: 16px; }
.star-picker { display: flex; gap: 4px; font-size: 26px; color: #f59e0b; cursor: pointer; user-select: none; }
.star-picker span { transition: transform .1s ease; }
.star-picker span:hover { transform: scale(1.15); }

/* =========================================================
   Flash sale banner + card timers
   ========================================================= */
.flash-banner {
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(90deg,#f43f5e,#f59e0b); color: #fff; text-decoration: none;
  padding: 12px 20px; font-size: 13.5px; font-weight: 600; text-align: center;
}
.flash-banner:hover { filter: brightness(1.05); }
.flash-banner-text .flash-timer { font-variant-numeric: tabular-nums; font-weight: 800; background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 6px; margin-left: 2px; }
.flash-banner-cta { text-decoration: underline; white-space: nowrap; }

.card-flash-timer {
  position: absolute; top: 44px; right: 12px; z-index: 2;
  background: rgba(20,20,43,0.75); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums;
}

/* =========================================================
   Floating social/contact widget
   ========================================================= */
.social-widget { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.social-widget-menu { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.social-fab {
  width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(10px) scale(.8); pointer-events: none;
  transition: all .2s ease;
}
.social-widget.open .social-fab { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.social-widget.open .social-fab:nth-child(1) { transition-delay: .02s; }
.social-widget.open .social-fab:nth-child(2) { transition-delay: .06s; }
.social-widget.open .social-fab:nth-child(3) { transition-delay: .1s; }
.social-fab-whatsapp { background: #25D366; }
.social-fab-instagram { background: radial-gradient(circle at 30% 110%, #fdf497, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.social-fab-facebook { background: #1877F2; }
.social-fab-toggle {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--gradient-brand); color: #fff; font-size: 24px;
  box-shadow: 0 8px 24px rgba(79,70,229,0.4); display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease;
}
.social-fab-toggle:hover { transform: scale(1.06); }
.social-fab-toggle .icon-close { display: none; }
.social-widget.open .social-fab-toggle .icon-open { display: none; }
.social-widget.open .social-fab-toggle .icon-close { display: block; }

.back-to-top {
  position: fixed; left: 20px; bottom: 20px; z-index: 89;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-200);
  background: #fff; color: var(--ink-500); font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow-md); opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: all .2s ease;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { color: var(--brand-600); }

/* =========================================================
   App-like polish: fade-in cards, AJAX loading state, sticky mobile bar
   ========================================================= */
.product-card { opacity: 0; transform: translateY(16px); transition: opacity .45s ease, transform .45s ease; }
.product-card.card-visible { opacity: 1; transform: translateY(0); }

#product-results.is-loading { opacity: .45; filter: blur(1px); pointer-events: none; transition: opacity .15s ease; }
#product-results { transition: opacity .15s ease; }

.mobile-buy-bar { display: none; }

@media (max-width: 640px) {
  body:has(.mobile-buy-bar) { padding-bottom: 74px; }
  .mobile-buy-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: #fff; border-top: 1px solid var(--line-200); padding: 12px 16px;
    box-shadow: 0 -6px 20px rgba(20,20,43,0.08);
  }
  .mobile-buy-bar .btn { flex-shrink: 0; }
  .social-widget { right: 14px; bottom: 78px; }
  .back-to-top { left: 14px; bottom: 78px; }
}
