/* shopai.css — ShopAI design system */
/* Hale Technology Limited */

:root {
  --sa-primary:   #0D1B2A;
  --sa-accent:    #FF4D3B;
  --sa-accent-dim:#FF6B5B;
  --sa-success:   #00C896;
  --sa-warning:   #F59E0B;
  --sa-surface:   #F7F8FA;
  --sa-border:    #E8ECF0;
  --sa-muted:     #8A9BB0;
  --sa-card:      #FFFFFF;
  --sa-pro:       #E8C84A;
  --sa-text:      #0D1B2A;
}

/* ── Typography ─────────────────────────────────────────────────────────── */
body { font-family: 'DM Sans', system-ui, sans-serif;
       background: var(--sa-surface); color: var(--sa-text);
       -webkit-font-smoothing: antialiased; }

.font-display { font-family: 'Instrument Serif', Georgia, serif; }

/* ── Brand ──────────────────────────────────────────────────────────────── */
.sa-logo {
  background: var(--sa-accent); color: #fff;
  font-weight: 900; font-size: 1.25rem;
  padding: 3px 12px; border-radius: 8px;
  text-decoration: none; letter-spacing: -.02em;
  font-family: 'Instrument Serif', serif;
}
.sa-logo:hover { color: #fff; opacity: .9; }

.badge-pro {
  background: var(--sa-pro); color: #5a4500;
  font-size: .65rem; font-weight: 800;
  padding: 2px 8px; border-radius: 20px;
  letter-spacing: .04em; vertical-align: middle;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-sa-accent {
  background: var(--sa-accent); color: #fff; border: none;
  border-radius: 100px; font-weight: 700;
  padding: .6rem 1.5rem;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.btn-sa-accent:hover {
  background: var(--sa-accent-dim); color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,77,59,.3);
}
.btn-sa-primary {
  background: var(--sa-primary); color: #fff; border: none;
  border-radius: 100px; font-weight: 700; padding: .6rem 1.5rem;
  transition: opacity .2s;
}
.btn-sa-primary:hover { opacity: .85; color: #fff; }
.btn-sa-outline {
  background: transparent; color: var(--sa-accent);
  border: 2px solid var(--sa-accent); border-radius: 100px;
  font-weight: 700; padding: .55rem 1.5rem;
  transition: all .2s;
}
.btn-sa-outline:hover {
  background: var(--sa-accent); color: #fff;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.sa-card {
  background: var(--sa-card); border: 1px solid var(--sa-border);
  border-radius: 16px; padding: 1.5rem;
  transition: transform .25s, box-shadow .25s;
}
.sa-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(13,27,42,.08);
}
.sa-card-flat { background: var(--sa-card);
  border: 1px solid var(--sa-border); border-radius: 16px;
  padding: 1.5rem; }

/* ── Product card ────────────────────────────────────────────────────────── */
.product-card {
  background: #fff; border: 1px solid var(--sa-border);
  border-radius: 16px; overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  text-decoration: none; color: inherit; display: block;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(13,27,42,.1);
  color: inherit;
}
.product-card-img {
  aspect-ratio: 1; object-fit: cover; width: 100%;
  background: var(--sa-surface);
}
.product-card-img-placeholder {
  aspect-ratio: 1; background: var(--sa-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--sa-border); font-size: 2.5rem;
}
.product-card-body { padding: .875rem 1rem 1rem; }
.product-card-seller {
  font-size: .7rem; color: var(--sa-muted);
  font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; margin-bottom: .2rem;
}
.product-card-name {
  font-weight: 700; font-size: .9rem;
  margin-bottom: .25rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.product-card-price {
  font-weight: 900; font-size: 1.05rem;
  color: var(--sa-accent);
}
.product-card-compare {
  font-size: .8rem; color: var(--sa-muted);
  text-decoration: line-through; margin-left: .4rem;
}
.discount-badge {
  position: absolute; top: .6rem; left: .6rem;
  background: var(--sa-accent); color: #fff;
  font-size: .65rem; font-weight: 800;
  padding: 2px 8px; border-radius: 6px;
}

/* ── Seller avatar strip ──────────────────────────────────────────────────── */
.seller-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--sa-border);
  background: var(--sa-surface);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem; color: var(--sa-muted);
}
.seller-avatar.pro-seller {
  border-color: var(--sa-pro); border-width: 2.5px;
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.sa-navbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--sa-border);
  position: sticky; top: 0; z-index: 1030;
  padding: .75rem 0;
}
.sa-navbar .nav-link {
  color: var(--sa-muted); font-weight: 500; font-size: .9rem;
  padding: .35rem .75rem; border-radius: 8px;
  transition: color .2s, background .2s;
}
.sa-navbar .nav-link:hover,
.sa-navbar .nav-link.active {
  color: var(--sa-text); background: var(--sa-surface);
}
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--sa-accent); color: #fff;
  font-size: .6rem; font-weight: 800;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Sidebar (seller dashboard) ──────────────────────────────────────────── */
.sa-sidebar {
  width: 240px; background: var(--sa-primary);
  min-height: 100vh; position: fixed; top: 0; left: 0;
  z-index: 100; display: flex; flex-direction: column;
  padding-top: 0;
}
.sa-sidebar-logo {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sa-sidebar .nav-link {
  color: rgba(255,255,255,.55); font-weight: 500;
  font-size: .875rem; padding: .7rem 1.25rem;
  border-radius: 0; display: flex; align-items: center; gap: .6rem;
  transition: all .2s; border-left: 3px solid transparent;
}
.sa-sidebar .nav-link:hover { color: #fff;
  background: rgba(255,255,255,.06); }
.sa-sidebar .nav-link.active {
  color: #fff; background: rgba(255,255,255,.08);
  border-left-color: var(--sa-accent);
}
.sa-sidebar .nav-link i { width: 18px; text-align: center; font-size: 1rem; }
.sa-main { margin-left: 240px; min-height: 100vh;
  background: var(--sa-surface); }
.sa-topbar {
  background: #fff; border-bottom: 1px solid var(--sa-border);
  padding: .875rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stat-card {
  background: #fff; border: 1px solid var(--sa-border);
  border-radius: 14px; padding: 1.25rem;
}
.stat-label { font-size: .75rem; color: var(--sa-muted);
  font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: .3rem; }
.stat-value { font-size: 1.75rem; font-weight: 900;
  line-height: 1; margin-bottom: .2rem; }
.stat-sub { font-size: .75rem; color: var(--sa-muted); }
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.sa-table { width: 100%; border-collapse: collapse; }
.sa-table thead th {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--sa-muted);
  padding: .6rem 1rem; border-bottom: 1px solid var(--sa-border);
  background: var(--sa-surface); text-align: left;
}
.sa-table tbody td {
  padding: .9rem 1rem; border-bottom: 1px solid var(--sa-border);
  font-size: .875rem; vertical-align: middle;
}
.sa-table tbody tr:hover { background: var(--sa-surface); }
.sa-table tbody tr:last-child td { border-bottom: none; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .7rem; font-weight: 700;
}
.status-badge::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor;
}
.status-active    { background: rgba(0,200,150,.12); color: #007a5e; }
.status-pending   { background: rgba(245,158,11,.12); color: #b45309; }
.status-shipped   { background: rgba(59,130,246,.12); color: #1d4ed8; }
.status-delivered { background: rgba(0,200,150,.12); color: #007a5e; }
.status-cancelled { background: rgba(255,77,59,.12); color: #c53030; }
.status-paid      { background: rgba(0,200,150,.12); color: #007a5e; }
.status-free      { background: var(--sa-surface); color: var(--sa-muted); border: 1px solid var(--sa-border); }
.status-pro       { background: rgba(232,200,74,.2); color: #7a6200; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.sa-input {
  border: 1.5px solid var(--sa-border); border-radius: 10px;
  padding: .65rem .875rem; font-size: .875rem;
  width: 100%; background: #fff; transition: border-color .2s;
  font-family: inherit;
}
.sa-input:focus {
  outline: none; border-color: var(--sa-accent);
  box-shadow: 0 0 0 3px rgba(255,77,59,.1);
}
.sa-label {
  font-size: .8rem; font-weight: 700;
  color: var(--sa-muted); margin-bottom: .35rem;
  display: block; text-transform: uppercase; letter-spacing: .04em;
}
.sa-input-group { margin-bottom: 1rem; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.sa-alert {
  border-radius: 10px; padding: .875rem 1rem;
  font-size: .875rem; border: 1px solid transparent;
  display: flex; gap: .6rem; align-items: flex-start;
}
.sa-alert-error {
  background: rgba(255,77,59,.08);
  border-color: rgba(255,77,59,.2); color: #c53030;
}
.sa-alert-success {
  background: rgba(0,200,150,.08);
  border-color: rgba(0,200,150,.2); color: #007a5e;
}
.sa-alert-info {
  background: rgba(13,27,42,.05);
  border-color: var(--sa-border); color: var(--sa-muted);
}

/* ── AI search bar ───────────────────────────────────────────────────────── */
.ai-search-bar {
  background: var(--sa-primary); border-radius: 20px;
  padding: 2.5rem 2rem; position: relative; overflow: hidden;
}
.ai-search-bar::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,77,59,.15); pointer-events: none;
}
.ai-search-input {
  border: none; border-radius: 12px; padding: .875rem 1.25rem;
  font-size: 1rem; background: rgba(255,255,255,.12);
  color: #fff; width: 100%; font-family: inherit;
}
.ai-search-input::placeholder { color: rgba(255,255,255,.5); }
.ai-search-input:focus {
  outline: none; background: rgba(255,255,255,.18);
  box-shadow: 0 0 0 3px rgba(255,77,59,.3);
}

/* ── Progress bar ────────────────────────────────────────────────────────── */
.sa-progress { height: 6px; border-radius: 4px;
  background: var(--sa-border); overflow: hidden; }
.sa-progress-bar { height: 100%; border-radius: 4px;
  background: var(--sa-accent); transition: width .5s ease; }
.sa-progress-bar.success { background: var(--sa-success); }

/* ── Upgrade card ────────────────────────────────────────────────────────── */
.upgrade-card {
  background: linear-gradient(135deg, var(--sa-primary), #1a3a5c);
  border-radius: 18px; padding: 1.75rem; color: #fff;
}
.upgrade-card .feature-check {
  color: var(--sa-success); font-size: .875rem;
  margin-bottom: .4rem; display: flex; align-items: center; gap: .5rem;
}

/* ── Responsive sidebar ──────────────────────────────────────────────────── */
@media (max-width: 992px) {
  .sa-sidebar { transform: translateX(-100%);
    transition: transform .3s; }
  .sa-sidebar.open { transform: translateX(0); }
  .sa-main { margin-left: 0; }
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-accent   { color: var(--sa-accent) !important; }
.text-muted-sa { color: var(--sa-muted)  !important; }
.text-success-sa { color: var(--sa-success) !important; }
.bg-surface    { background: var(--sa-surface); }
.border-sa     { border: 1px solid var(--sa-border); }
.rounded-sa    { border-radius: 14px; }
.shadow-sa     { box-shadow: 0 4px 24px rgba(13,27,42,.08); }
.fw-800        { font-weight: 800; }
.fw-900        { font-weight: 900; }
