:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-alt: #f1f4f9;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #111827;
  --primary-hover: #1f2937;
  --accent: #009ee3; /* Mercado Pago blue */
  --accent-dark: #007eb5;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(17, 24, 39, 0.06);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Announcement */
.announcement {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
}
.search-box {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.search-box input:focus {
  background: #fff;
  border-color: var(--primary);
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-mp {
  background: var(--accent);
  color: #fff;
}
.btn-mp:hover { background: var(--accent-dark); }
.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--surface-alt); }
.btn-danger {
  background: #fee2e2;
  color: var(--danger);
}
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.cart-btn {
  position: relative;
}
.cart-count {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
}

/* Hero */
.hero {
  padding: 40px 0 28px;
}
.hero-card {
  background: linear-gradient(135deg, #111827 0%, #1e293b 55%, #0f172a 100%);
  color: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow);
}
.hero-card h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero-card p {
  margin: 0;
  color: #cbd5e1;
  max-width: 560px;
  font-size: 15px;
  line-height: 1.55;
}
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

/* Status Banner */
.status-banner {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}
.status-banner.success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.status-banner.warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.status-banner.danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* Categories */
.categories-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 20px;
}
.cat-pill {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.cat-pill.active, .cat-pill:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.product-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  overflow: hidden;
  cursor: pointer;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--success);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
}
.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.product-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-dark);
}
.product-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}
.product-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-footer {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.price-wrap { display: flex; flex-direction: column; }
.price-compare {
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
}
.price-current {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stock-note {
  font-size: 11px;
  color: var(--muted);
}

/* Drawer & Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 60;
  display: none;
  justify-content: flex-end;
}
.overlay.open { display: flex; }
.overlay.center {
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.drawer {
  width: 100%;
  max-width: 420px;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.14);
}
.modal {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}
.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-head h3 { margin: 0; font-size: 18px; }
.panel-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.panel-foot {
  padding: 18px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item img, .cart-item-ph {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-alt);
  flex-shrink: 0;
}
.qty-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.qty-ctrl button {
  border: none;
  background: #fff;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-weight: 700;
}
.qty-ctrl span {
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 28px 0;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Admin specific */
.admin-layout { padding: 28px 0 60px; }
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.tab-btn {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
}
th {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill-green { background: #d1fae5; color: #065f46; }
.pill-yellow { background: #fef3c7; color: #92400e; }
.pill-red { background: #fee2e2; color: #991b1b; }
.pill-gray { background: #f3f4f6; color: #374151; }

@media (max-width: 680px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
  .search-box { order: 3; max-width: 100%; flex-basis: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .hero-card { padding: 26px 20px; }
}
