/* assets/css/app.css - DigiShop Mobile App UI */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── CSS Variables ───────────────────────────── */
:root {
  --primary:       #4F46E5;
  --primary-light: #818CF8;
  --primary-dark:  #3730A3;
  --secondary:     #22C55E;
  --accent:        #F59E0B;
  --danger:        #EF4444;
  --bg:            #F9FAFB;
  --surface:       #FFFFFF;
  --surface2:      #F3F4F6;
  --border:        #E5E7EB;
  --text:          #111827;
  --text-2:        #6B7280;
  --text-3:        #9CA3AF;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 16px rgba(79,70,229,.10), 0 1px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 40px rgba(79,70,229,.15), 0 4px 12px rgba(0,0,0,.08);
  --radius:        16px;
  --radius-sm:     10px;
  --radius-xs:     6px;
  --font-head:     'Syne', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --nav-h:         68px;
  --max-w:         430px;
  --transition:    .22s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg:       #0F0F14;
  --surface:  #1A1A24;
  --surface2: #222230;
  --border:   #2D2D3D;
  --text:     #F1F5F9;
  --text-2:   #94A3B8;
  --text-3:   #64748B;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow:    0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); border: none; outline: none; }
input, textarea, select { font-family: var(--font-body); }

/* ── App Shell ───────────────────────────────── */
#app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
  overflow-x: hidden;
}

/* ── Top Header ──────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.app-header .logo {
  font-family: var(--font-head);
  font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -.5px;
}
.header-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: var(--transition);
  color: var(--text-2);
}
.icon-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Bottom Navigation ───────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--max-w);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  height: var(--nav-h);
  z-index: 200;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  color: var(--text-3);
  position: relative;
}
.nav-item .nav-icon { font-size: 1.35rem; transition: var(--transition); }
.nav-item .nav-label { font-size: .67rem; font-weight: 600; letter-spacing: .3px; transition: var(--transition); }
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon { transform: scale(1.15); }
.nav-item::before {
  content: '';
  position: absolute; top: -1px; left: 20%; right: 20%; height: 2px;
  background: var(--primary); border-radius: 0 0 4px 4px;
  transform: scaleX(0); transition: var(--transition);
}
.nav-item.active::before { transform: scaleX(1); }

/* ── Page Wrapper ────────────────────────────── */
.page {
  padding: 0 0 calc(var(--nav-h) + 20px) 0;
  min-height: 100dvh;
}

/* ── Hero Banner ─────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  padding: 28px 20px 32px;
  position: relative; overflow: hidden;
  color: #fff;
}
.hero-banner::before {
  content: '';
  position: absolute; top: -40px; right: -30px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.hero-banner::after {
  content: '';
  position: absolute; bottom: -50px; left: -20px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 4px 12px;
  font-size: .75rem; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; margin-bottom: 10px;
}
.hero-title {
  font-family: var(--font-head);
  font-size: 1.75rem; font-weight: 800; line-height: 1.2;
  margin-bottom: 8px; letter-spacing: -.5px;
}
.hero-sub { font-size: .9rem; opacity: .85; margin-bottom: 18px; }
.hero-stats { display: flex; gap: 20px; }
.hero-stat .num {
  font-family: var(--font-head); font-size: 1.4rem; font-weight: 800;
}
.hero-stat .lbl { font-size: .72rem; opacity: .75; }

/* ── Section Headers ─────────────────────────── */
.section { padding: 20px 16px 8px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-head);
  font-size: 1.05rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.section-title .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.section-link {
  font-size: .78rem; font-weight: 600; color: var(--primary);
  padding: 4px 10px; border-radius: 999px;
  background: rgba(79,70,229,.1);
}
.section-link:hover { background: var(--primary); color: #fff; }

/* ── Category Scroll ─────────────────────────── */
.cat-scroll {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px 12px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  font-size: .82rem; font-weight: 600;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text-2); transition: var(--transition); white-space: nowrap;
}
.cat-chip.active, .cat-chip:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ── Product Card ────────────────────────────── */
.products-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; padding: 0 16px;
}
.product-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  overflow: hidden; transition: var(--transition);
  position: relative;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-card .thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: var(--surface2);
}
.product-card .thumb-placeholder {
  width: 100%; aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--surface2), var(--border));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--text-3);
}
.product-card .card-body { padding: 12px; }
.product-card .card-cat {
  font-size: .68rem; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--primary); margin-bottom: 5px;
}
.product-card .card-title {
  font-family: var(--font-head);
  font-size: .88rem; font-weight: 700; line-height: 1.3;
  color: var(--text); margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .card-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.product-card .price {
  font-family: var(--font-head); font-size: .95rem; font-weight: 800;
  color: var(--primary);
}
.product-card .buy-mini {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--secondary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; transition: var(--transition);
}
.product-card .buy-mini:hover { transform: scale(1.1); background: var(--primary); }
.product-card .featured-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent); color: #fff;
  font-size: .65rem; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
}

/* ── Order Card ──────────────────────────────── */
.orders-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 12px; padding: 0 16px;
}
.order-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  overflow: hidden; display: flex; align-items: stretch;
  transition: var(--transition);
}
.order-card:hover { box-shadow: var(--shadow); }
.order-card .order-thumb {
  width: 90px; flex-shrink: 0; object-fit: cover;
  background: var(--surface2);
}
.order-card .order-thumb-ph {
  width: 90px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--surface2), var(--border));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--text-3);
}
.order-card .order-body { padding: 12px; flex: 1; }
.order-card .order-title {
  font-family: var(--font-head);
  font-size: .9rem; font-weight: 700; margin-bottom: 4px;
}
.order-card .order-buyer {
  font-size: .78rem; color: var(--text-2);
  display: flex; align-items: center; gap: 4px;
}
.order-card .order-date {
  font-size: .72rem; color: var(--text-3); margin-top: 6px;
}
.order-card .verified-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(34,197,94,.12); color: var(--secondary);
  font-size: .68rem; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; margin-top: 6px;
}

/* ── Horizontal Slider ───────────────────────── */
.h-scroll {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 12px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }

.order-card-h {
  flex-shrink: 0; width: 200px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  overflow: hidden; transition: var(--transition);
}
.order-card-h:hover { box-shadow: var(--shadow); }
.order-card-h img {
  width: 100%; height: 110px; object-fit: cover; background: var(--surface2);
}
.order-card-h .oh-body { padding: 10px; }
.order-card-h .oh-title {
  font-family: var(--font-head); font-size: .82rem; font-weight: 700;
  margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-card-h .oh-buyer { font-size: .72rem; color: var(--text-2); }

/* ── Product Detail ──────────────────────────── */
.img-slider { position: relative; background: var(--surface2); }
.img-slider .main-img {
  width: 100%; height: 260px; object-fit: cover;
}
.slider-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px;
}
.slider-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.5); transition: var(--transition);
}
.slider-dots span.active { background: #fff; width: 18px; border-radius: 3px; }
.slider-thumbs {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.slider-thumbs::-webkit-scrollbar { display: none; }
.slider-thumbs img {
  width: 60px; height: 50px; object-fit: cover; border-radius: var(--radius-xs);
  border: 2px solid transparent; cursor: pointer; flex-shrink: 0;
  transition: var(--transition);
}
.slider-thumbs img.active { border-color: var(--primary); }

.detail-section { padding: 16px; }
.detail-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.detail-logo {
  width: 54px; height: 54px; border-radius: 14px; object-fit: cover;
  border: 2px solid var(--border); flex-shrink: 0;
  background: var(--surface2);
}
.detail-logo-ph {
  width: 54px; height: 54px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.detail-cat {
  font-size: .72rem; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--primary); margin-bottom: 4px;
}
.detail-title {
  font-family: var(--font-head); font-size: 1.2rem; font-weight: 800;
  line-height: 1.25; letter-spacing: -.3px;
}
.detail-price {
  font-family: var(--font-head); font-size: 1.6rem; font-weight: 800;
  color: var(--primary); margin: 12px 0;
}
.detail-desc {
  font-size: .88rem; color: var(--text-2); line-height: 1.7;
  margin-bottom: 16px;
}
.demo-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1.5px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 8px 18px;
  font-size: .82rem; font-weight: 600; transition: var(--transition);
  margin-bottom: 16px;
}
.demo-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.buy-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, var(--secondary), #16A34A);
  color: #fff; border-radius: var(--radius); padding: 16px 24px;
  font-family: var(--font-head); font-size: 1rem; font-weight: 700;
  width: 100%; box-shadow: 0 4px 20px rgba(34,197,94,.3);
  transition: var(--transition); letter-spacing: .2px;
}
.buy-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(34,197,94,.4); }
.buy-btn:active { transform: translateY(0); }

/* ── Floating Buy Button ─────────────────────── */
.float-buy {
  position: fixed; bottom: calc(var(--nav-h) + 14px); right: 20px;
  z-index: 190;
  background: linear-gradient(135deg, var(--secondary), #16A34A);
  color: #fff; border-radius: 999px;
  padding: 12px 20px; font-family: var(--font-head); font-size: .85rem; font-weight: 700;
  box-shadow: 0 6px 24px rgba(34,197,94,.45);
  display: flex; align-items: center; gap: 8px;
  transition: var(--transition); animation: floatPulse 2.5s infinite;
}
.float-buy:hover { transform: scale(1.05); }
@keyframes floatPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(34,197,94,.45); }
  50% { box-shadow: 0 6px 36px rgba(34,197,94,.7); }
}

/* ── Live Sales Popup ────────────────────────── */
.live-popup {
  position: fixed; bottom: calc(var(--nav-h) + 14px); left: 16px;
  z-index: 190; max-width: 260px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  padding: 10px 14px; display: flex; align-items: center; gap: 10px;
  transform: translateY(100px); opacity: 0;
  transition: all .4s cubic-bezier(.34,1.56,.64,1);
}
.live-popup.show { transform: translateY(0); opacity: 1; }
.live-popup .lp-img {
  width: 40px; height: 40px; border-radius: 10px; object-fit: cover;
  background: var(--surface2); flex-shrink: 0;
}
.live-popup .lp-text .lp-name {
  font-size: .78rem; font-weight: 700;
}
.live-popup .lp-text .lp-product {
  font-size: .72rem; color: var(--text-2);
}
.live-popup .lp-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--secondary); color: #fff;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: .55rem; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ── Page Title Bar ──────────────────────────── */
.page-title-bar {
  padding: 16px 20px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text-2); flex-shrink: 0;
  transition: var(--transition);
}
.back-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-title-bar h1 {
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 700;
}

/* ── Filter Bar ──────────────────────────────── */
.filter-bar {
  position: sticky; top: 57px; z-index: 90;
  background: var(--bg); padding: 10px 0 0;
}

/* ── Empty State ─────────────────────────────── */
.empty-state {
  padding: 60px 20px; text-align: center;
}
.empty-state .emoji { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 {
  font-family: var(--font-head); font-size: 1.05rem; font-weight: 700;
  margin-bottom: 6px;
}
.empty-state p { font-size: .85rem; color: var(--text-2); }

/* ── Proof Screenshot ────────────────────────── */
.proof-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-top: 10px;
}
.proof-img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--transition);
}
.proof-img:hover { transform: scale(1.02); }

/* ── Lightbox ────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox img { max-width: 95vw; max-height: 90vh; border-radius: var(--radius-sm); }
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,.15); color: #fff;
  border-radius: 50%; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ── Badges & Tags ───────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; letter-spacing: .3px;
}
.badge-primary { background: rgba(79,70,229,.12); color: var(--primary); }
.badge-green { background: rgba(34,197,94,.12); color: var(--secondary); }
.badge-amber { background: rgba(245,158,11,.12); color: var(--accent); }
.badge-red { background: rgba(239,68,68,.12); color: var(--danger); }

/* ── Divider ─────────────────────────────────── */
.divider { height: 8px; background: var(--surface2); margin: 8px 0; }

/* ── Skeleton Loader ─────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
  border-radius: var(--radius-xs);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-card {
  height: 200px; border-radius: var(--radius);
}

/* ── Toast ───────────────────────────────────── */
.toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; width: calc(var(--max-w) - 32px);
}
.toast {
  background: var(--text); color: #fff;
  border-radius: var(--radius-sm); padding: 12px 18px;
  font-size: .85rem; font-weight: 500;
  box-shadow: var(--shadow-lg); pointer-events: all;
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1);
  display: flex; align-items: center; gap: 10px;
}
.toast.success { background: var(--secondary); }
.toast.error { background: var(--danger); }
@keyframes toastIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Smooth page transitions ─────────────────── */
.page-enter { animation: pageIn .3s ease; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Utility ─────────────────────────────────── */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-2); font-size: .85rem; }

/* ── Lazy load ───────────────────────────────── */
img[data-src] { opacity: 0; transition: opacity .4s; }
img.loaded { opacity: 1; }
