/* ========================
   TIANGUIS GROW MX — Global
   ======================== */

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

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

:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-elevated: #1a1a1a;
  --border: #2a2a2a;
  --border-light: #333333;
  --text-primary: #f5f5f5;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #ffffff;
  --accent-dim: rgba(255,255,255,0.08);
  --accent-hover: rgba(255,255,255,0.12);
  --danger: #e53e3e;
  --success: #38a169;
  --warning: #d69e2e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.6);
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ======= SCROLLBAR ======= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ======= LAYOUT ======= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ======= BUTTONS ======= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-ghost:hover {
  background: var(--accent-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover {
  background: rgba(229,62,62,0.1);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ======= INPUTS ======= */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 14px;
  transition: border-color var(--transition);
  width: 100%;
}

.input:focus {
  outline: none;
  border-color: var(--text-muted);
}

.input::placeholder {
  color: var(--text-muted);
}

/* ======= CARDS ======= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ======= BADGES ======= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}

.badge-pending    { background: rgba(214,158,46,0.15); color: var(--warning); }
.badge-waiting    { background: rgba(66,153,225,0.15); color: #63b3ed; }
.badge-review     { background: rgba(159,122,234,0.15); color: #b794f4; }
.badge-confirmed  { background: rgba(56,161,105,0.15); color: var(--success); }
.badge-delivering { background: rgba(56,161,105,0.2); color: #68d391; }
.badge-delivered  { background: rgba(56,161,105,0.25); color: #9ae6b4; }
.badge-done       { background: rgba(255,255,255,0.08); color: var(--text-secondary); }

/* ======= NAVBAR ======= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo span {
  color: var(--text-secondary);
  font-weight: 300;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
}

.nav-cart-btn {
  position: relative;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-cart-btn:hover {
  background: var(--accent-hover);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none;
}

.cart-count.visible {
  display: flex;
}

/* ======= TOAST ======= */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  max-width: 320px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid #63b3ed; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ======= LOADING ======= */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ======= EMPTY STATE ======= */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 24px;
}

/* ======= DIVIDER ======= */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ======= MODAL ======= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  animation: scaleIn 0.2s ease;
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  color: var(--text-muted);
  font-size: 20px;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ======= RESPONSIVE ======= */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .navbar-inner { height: 56px; }
  .logo { font-size: 16px; }
}
