/* ========================================================
   GLOBAL DESIGN SYSTEM — Ultra-Premium Tech Aesthetic
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-primary: #050505;
  --bg-secondary: #0A0A0C;
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-hover: rgba(255, 255, 255, 0.04);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.15);

  --accent-blue: #000000;
  --accent-cyan: #000000;
  --accent-blue-light: #111111;
  --accent-cyan-light: #222222;

  --gradient-main: linear-gradient(135deg, #000000, #222222);
  --gradient-subtle: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.05));
  --gradient-bg: radial-gradient(circle at top, rgba(255,255,255,0.02) 0%, transparent 40%),
                 #050505;

  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 40px rgba(255, 255, 255, 0.02);
  --shadow-glow-cyan: 0 0 40px rgba(255, 255, 255, 0.02);

  --transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-slow: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  max-width: 100vw;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  background-image: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* prevent horizontal scroll without breaking sticky positioning */
  max-width: 100%;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--bg-glass); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- Navbar (Apple Style) --- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: transparent;
  padding: 0 32px;
  height: 56px;
  width: 100%;
  max-width: 100vw;
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), backdrop-filter 0.4s, border-bottom 0.4s;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-glass);
}

.navbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em;
}

.navbar-brand .logo-icon {
  width: 28px; height: 28px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.navbar-brand span {
  color: var(--text-primary);
}

.navbar-links {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 32px;
}

.navbar-links a, .navbar-links button {
  padding: 8px 0;
  font-size: 0.85rem; font-weight: 500; letter-spacing: -0.01em;
  color: var(--text-secondary);
  transition: color 0.3s;
  border: none; background: none; cursor: pointer;
}

.navbar-links a:hover, .navbar-links button:hover {
  color: var(--text-primary);
}

.navbar-links a.active {
  color: var(--text-primary);
}

.navbar-user {
  display: flex; align-items: center; gap: 24px;
}

.user-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary);
}

.user-badge .avatar {
  width: 24px; height: 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text-primary);
}

.btn-logout {
  padding: 6px 12px;
  border: none;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* --- Container --- */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 56px 24px 0; /* space for fixed navbar */
}

/* --- Page Header --- */
.page-header {
  padding: 48px 0 32px;
  text-align: center;
}

.page-header h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-glass-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding-bottom: 48px;
}

.product-card {
  background: #111112;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 24px;
  overflow: visible; /* to allow tooltips to overflow cleanly */
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-6px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.75), 0 0 50px rgba(0, 80, 255, 0.04);
}

.product-img {
  width: 100%;
  height: 200px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 16px;
}

.product-img img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.65));
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s;
}

.product-card:hover .product-img img {
  transform: scale(1.08) translateY(-6px);
  filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.8));
}

.product-img.placeholder {
  background: var(--gradient-subtle);
  border-radius: 18px;
  margin: 16px;
  height: 218px;
}

.product-body {
  padding: 16px 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.product-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  padding-right: 14px;
}

.product-price {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.01em;
}

.product-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  margin-top: 4px;
  letter-spacing: -0.01em;
}

.product-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Info Icon & Tooltip */
.product-info-container {
  position: relative;
  display: inline-flex;
  margin-bottom: auto;
  align-self: flex-end;
}

.product-info-trigger {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.product-info-trigger:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.product-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: rgba(10, 10, 12, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 50;
  pointer-events: none;
}

.product-info-container:hover .product-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Stock text style */
.product-stock-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: -0.01em;
}

.product-stock-text.out-of-stock { color: var(--danger); }
.product-stock-text.low-stock { color: var(--warning); }
.product-stock-text.in-stock { color: rgba(255, 255, 255, 0.65); }

/* Custom Peach/Orange Buy Button */
.btn-buy {
  background: #e79851;
  color: #050505;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.btn-buy:hover {
  background: #f1a561;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(231, 152, 81, 0.3);
}

.btn-buy:active {
  transform: translateY(0);
}

.btn-buy:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.02);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- Buttons --- */
.btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: var(--transition);
  border: none; display: inline-flex; align-items: center; gap: 8px;
}

.btn-primary {
  background: var(--gradient-main);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-blue-light);
  box-shadow: 0 8px 24px rgba(0,80,255,0.2);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--accent-blue);
  background: rgba(0,80,255,0.1);
}

.btn-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: var(--success-bg);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--success);
}

.btn-success:hover {
  background: var(--success);
  color: white;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-full { width: 100%; justify-content: center; }

.btn:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none !important;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-label span.required { color: var(--accent-blue); }

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-blue);
  background: rgba(0,80,255,0.05);
  box-shadow: 0 0 0 3px rgba(0,80,255,0.1);
}

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

select.form-control option {
  background: #1a1a2e;
  color: var(--text-primary);
}

textarea.form-control { resize: vertical; min-height: 80px; }

/* --- Auth Pages --- */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .icon {
  width: 64px; height: 64px;
  background: var(--gradient-main);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}

.auth-logo h1 {
  font-size: 1.75rem; font-weight: 800; letter-spacing: -0.04em;
  color: var(--text-primary);
}

.auth-logo p { color: var(--text-secondary); font-size: 0.875rem; margin-top: 6px; }

.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1; padding: 10px;
  border: none; background: none; cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.875rem; font-weight: 500;
  border-radius: calc(var(--radius-md) - 4px);
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--gradient-main);
  color: white;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent-blue-light);
  font-weight: 500;
  transition: var(--transition);
}

.auth-footer a:hover { color: var(--accent-cyan-light); }

/* --- File Upload --- */
.file-upload-area {
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.file-upload-area:hover, .file-upload-area.dragover {
  border-color: var(--accent-blue);
  background: rgba(0,80,255,0.05);
}

.file-upload-area input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

.file-upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.file-upload-text { color: var(--text-secondary); font-size: 0.875rem; }
.file-upload-text strong { color: var(--accent-blue-light); }

.file-preview {
  margin-top: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.file-preview img { width: 100%; max-height: 200px; object-fit: cover; }

/* --- Admin Table --- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-glass);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--bg-card-hover); }

tbody td {
  padding: 16px 20px;
  font-size: 0.875rem;
  vertical-align: middle;
}

/* --- Admin Tabs --- */
.admin-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 32px;
}

.admin-tab {
  padding: 12px 24px;
  border: none; background: none; cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem; font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
}

.admin-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-blue);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1; pointer-events: all;
}

.modal {
  width: 100%; max-width: 520px; max-height: 90vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 24px 28px 0;
  display: flex; align-items: center; justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.2rem; font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; color: var(--text-secondary);
  transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px 28px 28px; }

/* --- Alerts --- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.875rem;
  display: flex; align-items: center; gap: 10px;
}

.alert-error {
  background: var(--danger-bg);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(16,185,129,0.25);
  color: #6ee7b7;
}

.alert-info {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  color: #a5b4fc;
}

/* --- Stats Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; align-items: center; gap: 16px;
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.purple { background: rgba(0,80,255,0.15); }
.stat-icon.pink { background: rgba(0,214,255,0.15); }
.stat-icon.green { background: var(--success-bg); }
.stat-icon.orange { background: var(--warning-bg); }

.stat-value {
  font-size: 1.75rem; font-weight: 800;
}

.stat-label {
  font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px;
}

/* --- Address Selection --- */
.address-list {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 16px;
}

.address-option {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: flex-start; gap: 12px;
}

.address-option:hover {
  border-color: var(--accent-blue);
  background: rgba(0,80,255,0.05);
}

.address-option.selected {
  border-color: var(--accent-blue);
  background: rgba(0,80,255,0.08);
}

.address-option input[type="radio"] { margin-top: 3px; accent-color: var(--accent-blue); }

.address-details h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.address-details p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* --- Order History --- */
.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.order-product { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.order-meta { font-size: 0.8rem; color: var(--text-secondary); }

.order-status {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600;
  text-align: center;
}

.status-pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.25);
}

.status-approved {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.25);
}

/* --- Loading --- */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(0,80,255,0.2);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); font-size: 0.875rem; }

/* --- Toast Notification --- */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideIn 0.3s ease;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 380px;
}

.toast-success {
  background: #0d2e1f;
  border: 1px solid rgba(16,185,129,0.3);
  color: #6ee7b7;
}

.toast-error {
  background: #2e0d0d;
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}

.toast-info {
  background: #0d0d2e;
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--accent-purple-light);
}

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

/* --- Section Headers --- */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 1.35rem; font-weight: 700;
}

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

/* --- Pill/Tag --- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 600;
  background: rgba(124,58,237,0.15);
  color: var(--accent-purple-light);
  border: 1px solid rgba(124,58,237,0.25);
}

/* --- Quantity Input --- */
.qty-control {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.qty-control input {
  width: 70px;
  text-align: center;
  background: transparent;
  border: none; border-left: 1px solid var(--border-glass); border-right: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 8px;
  font-size: 0.9rem;
  outline: none;
}

.qty-btn {
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.qty-btn:hover { background: var(--bg-glass); color: var(--text-primary); }

/* --- Product Image in Order Page --- */
.order-product-info {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 32px;
}

.order-product-img {
  width: 80px; height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--gradient-subtle);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.5s ease forwards;
}

.fade-up-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-up-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-up-delay-3 { animation-delay: 0.3s; opacity: 0; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .navbar {
    padding: 0 12px !important;
  }
  .navbar-links {
    position: static !important;
    transform: none !important;
    display: flex !important;
    gap: 12px !important;
    margin-left: auto !important;
    margin-right: 12px !important;
  }
  .navbar-links a {
    font-size: 0.78rem !important;
    padding: 4px 0 !important;
  }
  #nav-home {
    display: none !important; /* Hide home link to save space */
  }
  .navbar-user {
    gap: 8px !important;
  }
  #user-name-display {
    display: none !important; /* Hide username on mobile to prevent overlapping */
  }
  .user-badge {
    gap: 0 !important;
  }
  .btn-logout {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
  }
  .container { padding: 0 16px; }
  .auth-card { padding: 28px 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .order-card { grid-template-columns: 1fr; }

  /* 3-column mobile product grid */
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding-bottom: 24px;
    width: 75%;
    margin: 0 auto;
    min-width: 0;
  }
  .product-card {
    border-radius: 12px;
    aspect-ratio: 1 / 1.2;
    overflow: visible;
    position: relative;
    min-width: 0;
  }
  .product-img {
    height: 44% !important;
    padding: 6px !important;
    position: relative;
  }
  .product-img img {
    max-width: 90%;
    max-height: 90%;
  }
  .product-body {
    height: 56% !important;
    padding: 4px 6px 6px !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    gap: 2px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.02) !important;
  }
  .product-left {
    padding-right: 14px !important; /* Make room for the 'i' button */
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    flex: none !important;
  }
  .product-price {
    font-size: 0.6rem !important;
    font-weight: 700 !important;
  }
  .product-name {
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
    margin-top: 1px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .product-right {
    height: auto !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 4px !important;
    width: 100% !important;
  }
  .product-info-container {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    display: flex !important;
  }
  .product-info-trigger {
    width: 16px !important;
    height: 16px !important;
    font-size: 8px !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px) !important;
  }
  .product-tooltip {
    width: 130px !important;
    padding: 8px 10px !important;
    font-size: 0.68rem !important;
    border-radius: 8px !important;
    right: 0 !important;
  }
  .product-stock-text {
    font-size: 0.55rem !important;
    text-align: left !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }
  .btn-buy {
    width: auto !important;
    flex: 1 !important;
    max-width: 55px !important;
    padding: 3px 0 !important;
    font-size: 0.55rem !important;
    border-radius: 4px !important;
    text-align: center !important;
  }
}

/* --- Lightbox Overlay --- */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(5,5,5,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1); }
.lightbox.active { opacity: 1; display: flex; }
.lightbox-close { position: absolute; top: 24px; right: 24px; background: rgba(255,255,255,0.1); border: none; color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; z-index: 1001; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.05); color: #fff; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; cursor: pointer; z-index: 1001; transition: background 0.2s; -webkit-user-select: none; user-select: none; }
.lightbox-nav:hover { background: rgba(255,255,255,0.15); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-content { max-width: 900px; width: 90%; max-height: 90vh; display: flex; flex-direction: column; align-items: center; cursor: default; }
.lightbox-img-wrapper { width: 100%; height: 50vh; display: flex; justify-content: center; align-items: center; margin-bottom: 24px; }
#lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.8)); }
.lightbox-details { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 600px; text-align: left; }
.lightbox-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
#lightbox-title { font-family: 'Playfair Display', Georgia, serif; font-size: 2rem; color: #fff; margin: 0; }
.lightbox-price { font-family: 'Inter', sans-serif; font-size: 1.25rem; color: rgba(255,255,255,0.6); }
#lightbox-desc { color: var(--text-secondary); line-height: 1.6; font-size: 1rem; margin: 0; }
@media (max-width: 768px) { .lightbox-nav { width: 36px; height: 36px; font-size: 1.2rem; } .lightbox-prev { left: 12px; } .lightbox-next { right: 12px; } #lightbox-title { font-size: 1.5rem; } .lightbox-details { padding: 16px; } .lightbox-img-wrapper { height: 40vh; } }
