@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');
:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #9ca3af;
  --text: #e5e7eb;
  --primary: #3b82f6;
  --secondary: #22c55e;
  --danger: #ef4444;
  --light: #334155;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px; }
.navbar { background: rgba(17,24,39,0.8); border-bottom: 1px solid #1f2937; position: sticky; top: 0; backdrop-filter: blur(6px); z-index: 100; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--text); text-decoration: none; font-weight: 600; }

/* Desktop nav */
.nav-links a { color: var(--text); margin-right: 16px; text-decoration: none; opacity: 0.9; }
.nav-links a:hover { opacity: 1; }
.dropdown { position: relative; display: inline-block; margin-right: 12px; }
.dropdown > span { cursor: default; }
.dropdown-menu { display: none; position: absolute; background: var(--card); border: 1px solid #1f2937; padding: 8px; border-radius: 8px; min-width: 180px; z-index: 10; }
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; color: var(--text); text-decoration: none; padding: 6px 8px; border-radius: 6px; }
.dropdown-menu a:hover { background: #1f2937; }

/* Kebab button */
.menu-toggle { display: none; align-items: center; justify-content: center; gap: 4px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid #1f2937; background: #0b1220; color: var(--text); cursor: pointer; }
.menu-toggle .dot { width: 4px; height: 4px; background: var(--text); opacity: .9; border-radius: 999px; display: inline-block; }
.menu-toggle:active { transform: scale(0.98); }

/* Mobile cart button */
.cart-toggle { display: none; position: relative; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid #1f2937; background: #0b1220; color: var(--text); text-decoration: none; }
.cart-toggle .badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: white; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; border: 2px solid #0b1220; }

/* Backdrop (mobile) */
.mobile-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); z-index: 90; }
.navbar.open .mobile-backdrop { display: block; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid #1f2937; border-radius: 16px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.link-card { text-decoration: none; color: var(--text); transition: transform .1s ease; }
.link-card:hover { transform: translateY(-2px); }

h1 { margin-top: 8px; }
.category-title { margin: 16px 0 8px; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.product-item { background: #0b1220; border: 1px solid #1f2937; border-radius: 12px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-name { font-weight: 600; }
.product-price { color: var(--muted); }
.qty-input { width: 64px; padding: 6px; border-radius: 8px; border: 1px solid #1f2937; background: #0a0f1c; color: var(--text); }
.inline { display: inline-flex; align-items: center; gap: 8px; }

.btn { border: none; border-radius: 10px; padding: 10px 14px; cursor: pointer; font-weight: 600; color: white; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.btn-secondary { background: linear-gradient(135deg, #16a34a, #22c55e); }
.btn-danger { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.btn-light { background: var(--light); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; border-bottom: 1px solid #1f2937; text-align: left; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

.form, .form-grid, .form-inline { display: grid; gap: 10px; }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.form-inline { grid-template-columns: 1fr auto; align-items: end; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select { padding: 10px; border-radius: 8px; border: 1px solid #1f2937; background: #0a0f1c; color: var(--text); }
label.checkbox { display: flex; align-items: center; gap: 8px; }

.alert { padding: 10px 12px; border-radius: 10px; }
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid #7f1d1d; }
.muted { color: var(--muted); font-size: 12px; }
.auth-card { max-width: 420px; margin: 40px auto; }

.cart-list { list-style: none; padding: 0; margin: 0; }
.cart-list li { padding: 8px 0; border-bottom: 1px solid #1f2937; }
.cart-total { font-size: 18px; margin-top: 8px; }
.cart-actions { display: flex; align-items: center; justify-content: space-between; }

.footer { border-top: 1px solid #1f2937; margin-top: 40px; padding: 20px 0; color: var(--muted); }

/* Category vertical list */
.category-list { display: flex; flex-direction: column; gap: 10px; }
.category-btn { display: block; width: 100%; padding: 16px 18px; border-radius: 14px; color: #fff; text-decoration: none; font-size: 18px; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,0.25); transition: transform .05s ease, filter .15s ease; }
.category-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.category-btn.active { outline: 2px solid rgba(255,255,255,0.45); }

/* Mobile adjustments */
@media (max-width: 640px) {
  .container { padding: 12px; }
  .nav-inner { gap: 8px; }

  /* Show kebab on mobile */
  .menu-toggle { display: inline-flex; }
  .cart-toggle { display: inline-flex; }

  /* Hide nav by default and show as panel when open */
  .nav-links { display: none; position: fixed; left: 12px; right: 12px; top: 64px; background: var(--card); border: 1px solid #1f2937; border-radius: 14px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); z-index: 95; }
  .navbar.open .nav-links { display: block; }
  .nav-links a, .nav-links .btn { display: block; margin: 8px 0; }

  /* Dropdowns inside panel are expanded */
  .dropdown { display: block; margin: 8px 0; }
  .dropdown-menu { position: static; display: block; padding: 8px 0; border: none; background: transparent; }

  /* Improve product list for mobile */
  .products-grid { grid-template-columns: 1fr; gap: 12px; }
  .product-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px; border-radius: 14px; }
  .product-name { font-size: 18px; text-align: center; }
  .product-price { text-align: center; font-size: 14px; }
  .inline { width: 100%; flex-direction: column; gap: 8px; }
  .inline .btn { width: 100%; }
  .qty-input { width: 100%; }
  .btn { width: 100%; }

  /* Backdrop visibility when open */
  .navbar.open + .mobile-backdrop { display: block; }

  /* Safe space for sticky cart button */
  main.container { padding-bottom: 84px; }
}

/* Mobile sticky cart CTA */
.mobile-cart-cta { display: none; }
@media (max-width: 640px) {
  .mobile-cart-cta { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: linear-gradient(180deg, rgba(17,24,39,0), rgba(17,24,39,0.85)); backdrop-filter: blur(6px); z-index: 50; }
  .mobile-cart-btn { display: block; text-align: center; text-decoration: none; color: #fff; font-weight: 700; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, #2563eb, #3b82f6); box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
}
