@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary: #6C63FF;
  --primary-dark: #5A52E0;
  --primary-light: #8B85FF;
  --secondary: #FF6584;
  --accent: #43E97B;
  --accent2: #38F9D7;
  --gold: #FFD700;
  --elite: #00D4FF;
  --bg: #0D0D1A;
  --bg2: #1A1A2E;
  --surface: #16213E;
  --surface2: #1E2A45;
  --border: rgba(108,99,255,0.2);
  --text: #E8E8F0;
  --text-muted: #9090B0;
  --text-dim: #5A5A7A;
  --success: #2ECC71;
  --warning: #F39C12;
  --danger: #E74C3C;
  --info: #3498DB;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(108,99,255,0.2);
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
  --font: 'Inter', sans-serif;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ── Typography ── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.8rem,4vw,2.8rem); }
h2 { font-size: clamp(1.4rem,3vw,2rem); }
h3 { font-size: clamp(1.1rem,2.5vw,1.4rem); }
p { color: var(--text-muted); }
a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm); font-family: var(--font);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none;
  transition: var(--transition); white-space: nowrap; text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg,var(--primary),var(--primary-dark)); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108,99,255,0.4); filter: brightness(1.1); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); border-color: var(--primary); color: var(--text); }
.btn-success { background: linear-gradient(135deg,var(--success),#27AE60); color: #fff; }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(46,204,113,0.4); color: #fff; }
.btn-danger { background: linear-gradient(135deg,var(--danger),#C0392B); color: #fff; }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(231,76,60,0.4); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Inputs ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 12px 16px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 0.95rem;
  transition: var(--transition); outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── Cards ── */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: var(--transition);
}
.card:hover { border-color: rgba(108,99,255,0.4); box-shadow: var(--shadow-glow); }
.card-glass {
  background: rgba(22,33,62,0.6); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: var(--radius);
}

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
}
.badge-primary { background: rgba(108,99,255,0.2); color: var(--primary-light); border: 1px solid rgba(108,99,255,0.3); }
.badge-success { background: rgba(46,204,113,0.15); color: var(--success); border: 1px solid rgba(46,204,113,0.3); }
.badge-warning { background: rgba(243,156,18,0.15); color: var(--warning); border: 1px solid rgba(243,156,18,0.3); }
.badge-danger  { background: rgba(231,76,60,0.15); color: var(--danger); border: 1px solid rgba(231,76,60,0.3); }
.badge-info    { background: rgba(52,152,219,0.15); color: var(--info); border: 1px solid rgba(52,152,219,0.3); }

/* ── Trust Level Badges ── */
.trust-nuevo      { color: #888; }
.trust-confiable  { color: #C0C0C0; }
.trust-destacado  { color: var(--gold); }
.trust-elite      { color: var(--elite); text-shadow: 0 0 10px var(--elite); }

/* ── Stars ── */
.stars { display: inline-flex; gap: 2px; }
.star { font-size: 16px; color: var(--text-dim); }
.star.filled { color: var(--gold); }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(13,13,26,0.92); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 900; color: var(--text); text-decoration: none;
}
.navbar-brand span { background: linear-gradient(135deg,var(--primary),var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.navbar-brand .logo-icon { font-size: 1.8rem; }
.navbar-search {
  flex: 1; max-width: 480px;
  display: flex; align-items: center; gap: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 30px; overflow: hidden; transition: var(--transition);
}
.navbar-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }
.navbar-search input {
  flex: 1; background: none; border: none; outline: none;
  padding: 10px 16px; color: var(--text); font-family: var(--font); font-size: 0.9rem;
}
.navbar-search input::placeholder { color: var(--text-dim); }
.navbar-search button {
  background: var(--primary); border: none; padding: 10px 18px; cursor: pointer;
  color: #fff; font-size: 1rem; transition: var(--transition);
}
.navbar-search button:hover { background: var(--primary-dark); }
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.navbar-icon-btn {
  position: relative; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; font-size: 1.1rem; transition: var(--transition);
  color: var(--text); text-decoration: none;
}
.navbar-icon-btn:hover { border-color: var(--primary); background: var(--surface); color: var(--text); }
.badge-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--secondary); color: #fff; font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.user-avatar-btn {
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--primary); cursor: pointer; transition: var(--transition);
}
.user-avatar-btn:hover { border-color: var(--secondary); }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ── Sidebar ── */
.sidebar {
  width: 260px; min-height: calc(100vh - 64px);
  background: var(--bg2); border-right: 1px solid var(--border);
  padding: 24px 16px; position: sticky; top: 64px;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-title { font-size: 0.7rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; padding: 0 12px; margin-bottom: 8px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.9rem;
  font-weight: 500; transition: var(--transition); text-decoration: none; cursor: pointer;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(108,99,255,0.12); color: var(--primary-light);
}
.sidebar-link .icon { font-size: 1.1rem; width: 22px; text-align: center; }

/* ── Layout ── */
.layout { display: flex; min-height: calc(100vh - 64px); }
.main-content { flex: 1; padding: 32px 24px; max-width: 1200px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Product Card ── */
.product-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: var(--transition); cursor: pointer; position: relative;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); border-color: rgba(108,99,255,0.4); }
.product-card-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface); }
.product-card-img-placeholder { width: 100%; aspect-ratio: 1; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--text-dim); }
.product-card-body { padding: 14px; }
.product-card-name { font-weight: 600; font-size: 0.9rem; color: var(--text); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-seller { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 8px; }
.product-card-price { font-size: 1.2rem; font-weight: 800; color: var(--primary-light); }
.product-card-price-bs { font-size: 0.75rem; color: var(--text-dim); }
.product-card-original { font-size: 0.8rem; color: var(--text-dim); text-decoration: line-through; }
.product-card-discount { font-size: 0.75rem; color: var(--success); font-weight: 700; }
.product-card-rating { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--text-muted); }
.product-card-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--secondary); color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
}

/* ── Products Grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ── Stat Cards ── */
.stat-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); }
.stat-icon { width: 52px; height: 52px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* ── Tables ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface); }
th { padding: 12px 16px; text-align: left; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; font-size: 0.88rem; border-bottom: 1px solid rgba(108,99,255,0.08); }
tbody tr:hover { background: rgba(108,99,255,0.05); }
tbody tr:last-child td { border-bottom: none; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  transform: scale(0.9); transition: var(--transition);
  box-shadow: var(--shadow);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; padding: 4px; border-radius: var(--radius-sm); transition: var(--transition); }
.modal-close:hover { color: var(--danger); background: rgba(231,76,60,0.1); }

/* ── Alerts / Toasts ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px; min-width: 280px; max-width: 380px;
  display: flex; align-items: center; gap: 12px; font-size: 0.88rem; font-weight: 500;
  box-shadow: var(--shadow); animation: slideInRight 0.3s ease;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.info    { border-color: var(--info); }
.toast.warning { border-color: var(--warning); }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(120%); } }

/* ── Categories ── */
.categories-bar { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.categories-bar::-webkit-scrollbar { display: none; }
.cat-chip {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 30px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: var(--transition);
  white-space: nowrap; color: var(--text-muted);
}
.cat-chip:hover, .cat-chip.active { background: rgba(108,99,255,0.15); border-color: var(--primary); color: var(--primary-light); }

/* ── Loading Spinner ── */
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; min-height: 200px; }

/* ── Auth pages ── */
.auth-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255,101,132,0.1) 0%, transparent 60%),
              var(--bg);
}
.auth-card { width: 100%; max-width: 440px; padding: 40px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .brand { font-size: 2rem; font-weight: 900; }
.auth-logo .brand span { background: linear-gradient(135deg,var(--primary),var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-dim); font-size: 0.8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Hero / Banner ── */
.hero-banner {
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(255,101,132,0.1));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 48px 40px; text-align: center;
  position: relative; overflow: hidden;
}
.hero-banner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(108,99,255,0.08) 0%, transparent 70%);
}

/* ── Image Upload ── */
.img-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px;
  text-align: center; cursor: pointer; transition: var(--transition);
}
.img-upload-area:hover { border-color: var(--primary); background: rgba(108,99,255,0.05); }
.img-upload-area.drag-over { border-color: var(--primary); background: rgba(108,99,255,0.1); }
.img-preview-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(90px,1fr)); gap: 10px; margin-top: 16px; }
.img-preview-item { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.img-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.img-preview-remove { position: absolute; top: 4px; right: 4px; background: var(--danger); color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 0.7rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .navbar-search { max-width: 100%; }
  .products-grid { grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); }
  .main-content { padding: 16px; }
}
@media (max-width: 480px) {
  .products-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .navbar { padding: 0 12px; }
}

/* ── Animations ── */
@keyframes fadeIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
.fade-in { animation: fadeIn 0.4s ease forwards; }
.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.3s; opacity: 0; }

/* ── Status colors ── */
.status-pending_payment { color: var(--warning); }
.status-payment_submitted { color: var(--info); }
.status-payment_confirmed { color: var(--primary-light); }
.status-preparing { color: var(--accent); }
.status-delivered { color: var(--success); }
.status-cancelled { color: var(--danger); }

/* ── Misc ── */
.text-gradient { background: linear-gradient(135deg,var(--primary),var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.flex { display: flex; } .flex-center { display:flex; align-items:center; justify-content:center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 768px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } .grid-2 { grid-template-columns: 1fr; } }
.empty-state { text-align:center; padding:60px 20px; color:var(--text-dim); }
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 16px; opacity:0.5; }
.divider { height:1px; background:var(--border); margin: 24px 0; }
.chip { display:inline-flex; align-items:center; gap:4px; padding:4px 12px; background:var(--surface2); border:1px solid var(--border); border-radius:20px; font-size:0.78rem; color:var(--text-muted); }
