/* ════════════════════════════════════════════
   ALMACE  —  Main Stylesheet
   ════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────── */
:root {
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;

  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --red-500:    #ef4444;
  --red-600:    #dc2626;
  --yellow-400: #facc15;
  --yellow-500: #eab308;
  --yellow-600: #ca8a04;
  --blue-500:   #3b82f6;
  --blue-600:   #2563eb;

  --sidebar-w: 240px;
  --header-h:  64px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.14);

  --font: 'Inter', system-ui, sans-serif;
  --transition: 150ms ease;
}

/* ── Reset & Base ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--gray-50); color: var(--gray-900); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img  { max-width: 100%; display: block; }
a    { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Typography ─────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem;     font-weight: 600; }
p  { color: var(--gray-600); }
.text-sm   { font-size: 0.875rem; }
.text-xs   { font-size: 0.75rem; }
.text-muted { color: var(--gray-500); }
.text-right { text-align: right; }
.text-center{ text-align: center; }
.font-bold  { font-weight: 700; }
.font-medium{ font-weight: 500; }

/* ── Utility ────────────────────────────────── */
.hidden { display: none !important; }
.flex   { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.mt-1   { margin-top: 0.25rem; }
.mt-2   { margin-top: 0.5rem; }
.mt-4   { margin-top: 1rem; }
.mb-4   { margin-bottom: 1rem; }
.p-4    { padding: 1rem; }
.w-full { width: 100%; }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 0.875rem; cursor: pointer;
  border: none; transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: var(--green-600); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--green-700); }
.btn-secondary { background: #fff; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-50); }
.btn-danger    { background: var(--red-600); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-ghost     { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-icon { padding: 0.5rem; border-radius: var(--radius-sm); background: transparent; color: var(--gray-500); cursor: pointer; border: none; transition: background var(--transition); }
.btn-icon:hover { background: var(--gray-100); color: var(--gray-800); }

/* ── Form Controls ──────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--gray-700); margin-bottom: 0.375rem; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--gray-900);
  background: #fff; transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.form-input.error, .form-select.error { border-color: var(--red-500); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.25rem; }
.form-row { display: grid; gap: 1rem; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Cards ──────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-body   { padding: 1.25rem; }
.card-footer { padding: 0.875rem 1.25rem; border-top: 1px solid var(--gray-100); background: var(--gray-50); border-radius: 0 0 var(--radius) var(--radius); }

/* ── Stat Cards ─────────────────────────────── */
.stat-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); margin-top: 0.25rem; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--gray-500); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-icon  { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

/* ── Badges ─────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge-green  { background: var(--green-100);  color: var(--green-800); }
.badge-yellow { background: #fef9c3;           color: #854d0e; }
.badge-blue   { background: #dbeafe;           color: #1e40af; }
.badge-gray   { background: var(--gray-100);   color: var(--gray-600); }
.badge-red    { background: #fee2e2;           color: #991b1b; }

/* ── Tables ─────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--gray-200); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th { background: var(--gray-50); padding: 0.75rem 1rem; text-align: left; font-weight: 600; color: var(--gray-600); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--gray-100); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 0.75rem 1rem; color: var(--gray-700); vertical-align: middle; }
.td-actions { display: flex; gap: 0.25rem; }

/* ── Modals ─────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%;
  max-width: 600px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px); transition: transform 0.2s;
}
.overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-body   { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 0.75rem; background: var(--gray-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-close  { background: none; border: none; cursor: pointer; color: var(--gray-400); padding: 4px; border-radius: 4px; display: flex; }
.modal-close:hover { color: var(--gray-700); background: var(--gray-100); }

/* ── Image Upload ───────────────────────────── */
.img-upload-area {
  border: 2px dashed var(--gray-300); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.img-upload-area:hover, .img-upload-area.dragover {
  border-color: var(--green-500); background: var(--green-50);
}
.img-upload-area img { max-height: 160px; margin: 0 auto; border-radius: var(--radius-sm); }
.img-upload-area .upload-icon { color: var(--gray-400); margin-bottom: 0.5rem; }
.img-upload-area p { font-size: 0.875rem; color: var(--gray-500); }
.img-upload-area input[type=file] { display: none; }

/* ── Toggle Switch ──────────────────────────── */
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-thumb {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--gray-300); cursor: pointer;
  transition: background .2s;
}
.toggle-thumb::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.toggle-switch input:checked + .toggle-thumb { background: var(--green-600); }
.toggle-switch input:checked + .toggle-thumb::before { transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-thumb { outline: 2px solid var(--green-500); outline-offset: 2px; }

/* ── Toast Notifications ────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  min-width: 260px; max-width: 340px; padding: 0.875rem 1rem;
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.875rem; font-weight: 500;
  animation: slideInRight .3s ease;
}
.toast-success { background: var(--green-600); color: #fff; }
.toast-error   { background: var(--red-600);   color: #fff; }
.toast-info    { background: var(--blue-600);  color: #fff; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Loading Spinner ────────────────────────── */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--gray-300); border-top-color: var(--green-600); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 3rem; color: var(--gray-500); }

/* ── Empty State ────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--gray-500); }
.empty-state svg { margin: 0 auto 1rem; opacity: .4; }
.empty-state h3 { color: var(--gray-700); margin-bottom: 0.5rem; }

/* ════════════════════════════════════════════
   ADMIN LAYOUT
   ════════════════════════════════════════════ */
.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); background: var(--gray-900); color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform var(--transition);
}
.sidebar-logo { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-logo .brand { font-size: 1.25rem; font-weight: 700; color: var(--green-400); letter-spacing: -.02em; }
.sidebar-logo .brand span { color: #fff; font-weight: 300; }
.sidebar-nav { flex: 1; padding: 0.75rem 0; overflow-y: auto; }
.nav-section { padding: 0.5rem 0; }
.nav-label { padding: 0.375rem 1.25rem; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-400); }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 1.25rem; font-size: 0.875rem; font-weight: 500;
  color: var(--gray-300); cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: rgba(34,197,94,.12); color: var(--green-400); border-left-color: var(--green-400); }
.nav-item svg { flex-shrink: 0; }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.1); font-size: 0.75rem; color: var(--gray-400); }
.logout-link {
  display: block; margin-top: .5rem; background: none; border: none; padding: 0;
  font-size: 0.75rem; color: var(--gray-400); text-decoration: underline; cursor: pointer;
}
.logout-link:hover { color: #fff; }

/* Login screen */
.login-screen {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-50); padding: 1rem;
}
.login-card {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 2rem; width: 100%; max-width: 360px;
}
.login-error { color: var(--red-600); font-size: 0.85rem; text-align: center; margin: -.5rem 0 1rem; }

/* Main content */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  height: var(--header-h); background: #fff; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm);
}
.admin-topbar .page-title { font-size: 1rem; font-weight: 600; color: var(--gray-900); }
.admin-content { padding: 1.5rem; flex: 1; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.section-header h2 { margin: 0; }

/* Hamburger (mobile) */
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--gray-700); padding: 4px; }

/* ════════════════════════════════════════════
   STORE LAYOUT
   ════════════════════════════════════════════ */
.store-header {
  background: #fff; border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm);
}
.store-header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0.5rem 1.5rem;
  min-height: 90px; display: flex; align-items: center; justify-content: space-between;
}
.store-brand { font-size: 1.375rem; font-weight: 700; color: var(--green-600); }
.store-brand span { color: var(--gray-900); font-weight: 400; }
.store-nav-links { display: flex; gap: 1.5rem; font-size: 0.875rem; font-weight: 500; }
.store-nav-links a { color: var(--gray-600); transition: color var(--transition); }
.store-nav-links a:hover { color: var(--green-600); }
.cart-btn {
  position: relative; background: var(--green-600); color: #fff;
  border: none; border-radius: var(--radius); padding: 0.5rem 1rem;
  display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background var(--transition);
}
.cart-btn:hover { background: var(--green-700); }
.whatsapp-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: #25D366; color: #fff;
  transition: background var(--transition);
}
.whatsapp-btn:hover { background: #1ebe5b; }
.mp-logo { flex-shrink: 0; }
.cart-badge {
  position: absolute; top: -8px; right: -8px;
  background: var(--red-500); color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.cart-badge.hidden { display: none; }

.store-main { max-width: 1280px; margin: 0 auto; padding: 1.5rem; }

/* Filter bar */
.filter-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; }
.filter-bar input[type=search] {
  flex: 1; min-width: 200px; padding: 0.5rem 0.875rem;
  border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: 0.875rem;
}
.filter-bar input[type=search]:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.category-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pill {
  padding: 0.35rem 0.875rem; border-radius: 999px; font-size: 0.8rem; font-weight: 500;
  border: 1px solid var(--gray-300); background: #fff; color: var(--gray-600);
  cursor: pointer; transition: all var(--transition);
}
.pill:hover { border-color: var(--green-500); color: var(--green-600); }
.pill.active { background: var(--green-600); border-color: var(--green-600); color: #fff; }

.delivery-type-btn.active { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.pickup-option {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--gray-300); border-radius: var(--radius);
  padding: 0.75rem 1rem; cursor: pointer; transition: border-color var(--transition);
}
.pickup-option:hover { border-color: var(--green-500); }
.pickup-option.selected { border-color: var(--green-600); background: var(--green-50); }
.pickup-option .maps-link { color: var(--green-600); display: flex; }

/* Product Grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.product-card {
  background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card-img { aspect-ratio: 4/3; overflow: hidden; background: var(--gray-100); position: relative; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-img .no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--gray-300); }
.product-card-body { padding: 0.875rem; flex: 1; display: flex; flex-direction: column; }
.product-card-category { margin-bottom: 0.375rem; }
.product-card-name { font-weight: 600; color: var(--gray-900); font-size: 0.9rem; margin-bottom: 0.25rem; line-height: 1.3; }
.product-card-desc { font-size: 0.8rem; color: var(--gray-500); margin-bottom: 0.75rem; flex: 1; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-card-footer { border-top: 1px solid var(--gray-100); padding-top: 0.75rem; display: flex; align-items: center; justify-content: space-between; }
.product-price { font-size: 1.1rem; font-weight: 700; color: var(--green-600); }
.product-unit  { font-size: 0.75rem; color: var(--gray-400); }
.product-card .btn-add { width: 36px; height: 36px; border-radius: 50%; padding: 0; display: flex; align-items: center; justify-content: center; background: var(--green-600); color: #fff; border: none; cursor: pointer; transition: background var(--transition); }
.product-card .btn-add:hover { background: var(--green-700); }
.product-card.out-of-stock .btn-add { background: var(--gray-300); cursor: not-allowed; }

/* Cart Drawer */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; opacity: 0; pointer-events: none; transition: opacity .25s; }
.cart-overlay.open { opacity: 1; pointer-events: all; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 400px;
  background: #fff; z-index: 201; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
  box-shadow: var(--shadow-lg);
}
.cart-overlay.open .cart-drawer { transform: translateX(0); }
.cart-drawer-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-item { display: flex; gap: 0.875rem; padding: 0.875rem 0; border-bottom: 1px solid var(--gray-100); }
.cart-item-img { width: 60px; height: 60px; border-radius: var(--radius-sm); overflow: hidden; background: var(--gray-100); flex-shrink: 0; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 0.875rem; }
.cart-item-unit { font-size: 0.75rem; color: var(--gray-500); }
.cart-item-price { font-weight: 700; color: var(--green-600); font-size: 0.9rem; margin-top: 0.25rem; }
.qty-control { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.qty-btn { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--gray-300); background: #fff; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.qty-btn:hover { background: var(--gray-100); }
.qty-value { font-weight: 600; font-size: 0.875rem; min-width: 24px; text-align: center; }
.cart-drawer-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); }
.cart-total-row { display: flex; justify-content: space-between; font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.cart-total-row .total-val { font-size: 1.25rem; color: var(--green-600); }

/* Tracking page */
.tracking-page { max-width: 640px; margin: 4rem auto; padding: 0 1.5rem; }
.tracking-steps { display: flex; flex-direction: column; gap: 0; margin: 2rem 0; }
.tracking-step { display: flex; gap: 1rem; }
.step-line { display: flex; flex-direction: column; align-items: center; }
.step-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--gray-300); flex-shrink: 0; margin-top: 4px; }
.step-dot.done { background: var(--green-600); }
.step-dot.current { background: var(--blue-500); box-shadow: 0 0 0 4px rgba(59,130,246,.2); }
.step-connector { width: 2px; flex: 1; background: var(--gray-200); margin: 4px 0; min-height: 32px; }
.step-connector.done { background: var(--green-600); }
.step-content { padding-bottom: 1.5rem; }
.step-label { font-weight: 600; font-size: 0.9rem; }
.step-meta  { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.125rem; }

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */

/* Sidebar backdrop (mobile overlay) */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 99;
}
.sidebar-backdrop.visible { display: block; }

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  /* ── Admin sidebar ── */
  .sidebar { transform: translateX(-240px); width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 1rem; }

  /* Topbar: hide date, keep title + hamburger */
  #currentDate { display: none; }

  /* Config section: single column */
  #configGrid { grid-template-columns: 1fr !important; }

  /* ── Tables: compact cells ── */
  .admin-content table th,
  .admin-content table td { padding: 0.5rem 0.625rem; font-size: 0.8rem; }

  /* Products table (9 cols): keep name, sale, stock, actions */
  #productsTable th:nth-child(2), #productsTable td:nth-child(2),
  #productsTable th:nth-child(3), #productsTable td:nth-child(3),
  #productsTable th:nth-child(4), #productsTable td:nth-child(4),
  #productsTable th:nth-child(6), #productsTable td:nth-child(6),
  #productsTable th:nth-child(8), #productsTable td:nth-child(8) { display: none; }

  /* Stock table (6 cols): keep name, stock, adjust */
  #section-stock table th:nth-child(2), #section-stock table td:nth-child(2),
  #section-stock table th:nth-child(3), #section-stock table td:nth-child(3),
  #section-stock table th:nth-child(5), #section-stock table td:nth-child(5) { display: none; }

  /* Sales table (6 cols): keep id, customer, total, status */
  #section-ventas table th:nth-child(3), #section-ventas table td:nth-child(3),
  #section-ventas table th:nth-child(6), #section-ventas table td:nth-child(6) { display: none; }

  /* ── Orders section filters ── */
  #section-pedidos .section-header { flex-direction: column; align-items: stretch; }
  #section-pedidos .section-header > div { flex-wrap: wrap; }
  #orderStatusFilter { min-width: 0 !important; width: 100%; }

  /* ── Product filters: full width ── */
  #prodSearch   { max-width: 100% !important; width: 100%; }
  #prodCatFilter { max-width: 100% !important; width: 100%; }

  /* ── Forms ── */
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }

  /* ── Store ── */
  .store-nav-links { display: none; }
  .store-header-inner img[alt="Bettiana Aciar"] { width: 56px !important; height: 56px !important; }
  .mp-logo { height: 36px !important; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.875rem; }

  /* ── Modals ── */
  .modal { margin: 0.5rem; max-height: 95vh; }
  .cart-drawer { max-width: 100%; }

  /* ── Order cards: stack info blocks ── */
  .order-card-body { flex-direction: column !important; gap: 1rem !important; }
  .order-card-body .order-total { margin-left: 0 !important; text-align: left !important; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.375rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .admin-content table th,
  .admin-content table td { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
}
