/* ============================================================
   DigiStore Pro v6 — Custom CSS
   ============================================================ */

:root {
  --dsp-primary: #4f46e5;
  --dsp-primary-dark: #3730a3;
  --dsp-sidebar-w: 260px;
  --dsp-sidebar-collapsed: 68px;
  --dsp-topbar-h: 60px;
}

/* ── Typography ────────────────────────────────────────────── */
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
.fw-black { font-weight: 900; }
.text-xs { font-size: .75rem; }

/* ── Auth pages ─────────────────────────────────────────────  */
.auth-page { background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%); min-height: 100vh; }
.brand-logo {
  width: 56px; height: 56px; background: var(--dsp-primary);
  border-radius: 16px; display: flex; align-items: center;
  justify-content: center; font-size: 1.5rem; color: #fff;
}

/* ── Sidebar Layout ──────────────────────────────────────────  */
.dsp-layout { display: flex; min-height: 100vh; }

.dsp-sidebar {
  width: var(--dsp-sidebar-w);
  background: #1e1b4b;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1030;
  transition: width .2s ease, transform .2s ease;
  overflow-y: auto;
  overflow-x: hidden;
}
.dsp-sidebar.collapsed { width: var(--dsp-sidebar-collapsed); }

.sidebar-brand {
  padding: 0 16px;
  height: var(--dsp-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.sidebar-brand-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #fff; min-width: 0;
}
.sidebar-logo-icon {
  width: 34px; height: 34px; background: var(--dsp-primary);
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.sidebar-logo { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.sidebar-brand-name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; }
.sidebar-close-btn { background: none; border: none; color: #fff; opacity: .6; cursor: pointer; }

.sidebar-nav { padding: 12px 8px; flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: rgba(255,255,255,.7);
  text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
  font-size: .88rem; margin-bottom: 2px;
}
.sidebar-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-link.active { background: var(--dsp-primary); color: #fff; }
.sidebar-link i { font-size: 1.1rem; flex-shrink: 0; }
.sidebar-divider { border-top: 1px solid rgba(255,255,255,.1); margin: 8px 0; }
.sidebar-section-title {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  color: rgba(255,255,255,.4); text-transform: uppercase;
  padding: 8px 12px 4px;
}
.sidebar-overlay { display: none; }

/* Collapsed state — hide text */
.dsp-sidebar.collapsed .sidebar-brand-name,
.dsp-sidebar.collapsed .sidebar-link span,
.dsp-sidebar.collapsed .sidebar-section-title { display: none; }
.dsp-sidebar.collapsed .sidebar-link { justify-content: center; }

/* ── Main content area ───────────────────────────────────────  */
.dsp-main {
  margin-left: var(--dsp-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .2s ease;
}
.dsp-main.expanded { margin-left: var(--dsp-sidebar-collapsed); }

/* ── Topbar ──────────────────────────────────────────────────  */
.dsp-topbar {
  height: var(--dsp-topbar-h);
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.topbar-toggle { background: none; border: none; color: #6b7280; cursor: pointer; font-size: 1.2rem; padding: 4px 8px; border-radius: 6px; }
.topbar-toggle:hover { background: #f3f4f6; }
.topbar-spacer { flex: 1; }

.dsp-content { padding: 24px; flex: 1; }

/* ── Avatar ──────────────────────────────────────────────────  */
.avatar-sm, .avatar-md, .avatar-lg, .avatar-xl {
  border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.avatar-sm  { width: 32px;  height: 32px;  font-size: .75rem; }
.avatar-md  { width: 40px;  height: 40px;  font-size: .9rem;  }
.avatar-lg  { width: 56px;  height: 56px;  font-size: 1.1rem; }
.avatar-xl  { width: 80px;  height: 80px;  font-size: 1.4rem; }

/* ── Cards ───────────────────────────────────────────────────  */
.stat-card { border: none; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }

/* ── Upload zone ─────────────────────────────────────────────  */
.upload-zone {
  border: 2px dashed #d1d5db; border-radius: 10px;
  cursor: pointer; transition: border-color .15s;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--dsp-primary); background: #f5f3ff; }

/* ── Notification bell ───────────────────────────────────────  */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  width: 8px; height: 8px; background: #ef4444;
  border-radius: 50%; border: 2px solid #fff;
}

/* ── Store / navbar ──────────────────────────────────────────  */
/* Sticky footer: body flex column, main flex:1, footer mt-auto */
.store-page, .auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.store-page > main,
.store-page > .container,
.store-page > .container-xl,
.auth-page > main {
  flex: 1 0 auto;
}
.store-page .navbar { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.product-card { border-radius: 12px; border: none; box-shadow: 0 2px 8px rgba(0,0,0,.07); transition: transform .15s, box-shadow .15s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }

/* ── Prose ────────────────────────────────────────────────────  */
.prose h1,.prose h2,.prose h3 { font-weight: 700; margin: 1rem 0 .5rem; }
.prose p { margin-bottom: .75rem; }
.prose ul,.prose ol { padding-left: 1.5rem; margin-bottom: .75rem; }

/* ── Responsive mobile ───────────────────────────────────────  */
@media (max-width: 991.98px) {
  .dsp-sidebar {
    transform: translateX(-100%);
    width: var(--dsp-sidebar-w) !important;
  }
  .dsp-sidebar.mobile-open { transform: translateX(0); }
  .dsp-main { margin-left: 0 !important; }
  .sidebar-overlay {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.4); z-index: 1029; opacity: 0;
    pointer-events: none; transition: opacity .2s;
  }
  .sidebar-overlay.active { opacity: 1; pointer-events: all; }
}

@media print {
  .dsp-sidebar, .dsp-topbar, .no-print { display: none !important; }
  .dsp-main { margin-left: 0 !important; }
}

.site-footer { margin-top: auto; }

/* ── Dashboard footer (copyright bar tipis) ─────────────────  */
.dashboard-footer {
  padding: 10px 24px;
  font-size: .75rem;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  flex-shrink: 0;
}
[data-bs-theme="dark"] .dashboard-footer {
  background: #1e1e2e;
  border-top-color: rgba(255,255,255,.08);
  color: rgba(255,255,255,.35);
}
.dashboard-footer-version { opacity: .5; }
