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

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #2f2f90;
  --card: #14141e;
  --border: #2a2a3a;
  --accent: #e8c547;
  --accent2: #ff6b35;
  --text: #f0eee8;
  --text-muted: #888899;
  --text-dim: #555566;
  --success: #4ade80;
  --error: #f87171;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* NAVBAR */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
}

.navbar-brand {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.5px;
}

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

.navbar-center { flex: 1; max-width: 480px; margin: 0 2rem; }

.search-bar {
  display: flex; align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0 1rem;
  gap: 0.5rem;
  transition: border-color 0.2s;
}

.search-bar:focus-within { border-color: var(--accent); }

.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); padding: 0.6rem 0.25rem;
  font-family: inherit; font-size: 0.9rem;
}

.search-bar input::placeholder { color: var(--text-dim); }

.search-bar button {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; padding: 0.25rem;
  transition: color 0.2s;
}

.search-bar button:hover { color: var(--accent); }

.navbar-actions { display: flex; align-items: center; gap: 0.5rem; }

.nav-btn {
  display: flex; align-items: center; gap: 0.4rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-family: inherit;
  font-size: 0.875rem; padding: 0.5rem 0.75rem;
  border-radius: 8px; text-decoration: none;
  transition: all 0.2s; position: relative;
}

.nav-btn:hover { color: var(--text); background: var(--bg3); }
.nav-btn.active { color: var(--accent); }

.nav-btn .badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--accent); color: #000;
  font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

.btn-primary {
  background: var(--accent); color: #000;
  border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem; font-weight: 600;
  padding: 0.6rem 1.25rem; border-radius: 8px;
  transition: all 0.2s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
}

.btn-primary:hover { background: #f5d55a; transform: translateY(-1px); }

.btn-outline {
  background: none; color: var(--text);
  border: 1px solid var(--border); cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem; padding: 0.6rem 1.25rem;
  border-radius: 8px; transition: all 0.2s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem;
  text-align: center;
  position: relative; overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(232,197,71,0.08) 0%, transparent 70%);
}

.hero-content { position: relative; z-index: 1; }

.hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700; line-height: 1.1;
  margin-bottom: 1rem;
}

.hero h1 em { color: var(--accent); font-style: italic; }

.hero p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2rem; }

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* SECTION */
.section { padding: 3rem 2rem; max-width: 1400px; margin: 0 auto; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.section-title { font-family: 'Fraunces', serif; font-size: 1.75rem; font-weight: 600; }

/* FILTER BAR */
.filter-bar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 2rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  max-width: 1400px; margin: 0 auto;
}

.filter-chip {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-muted); padding: 0.4rem 1rem;
  border-radius: 50px; cursor: pointer; font-size: 0.85rem;
  transition: all 0.2s; white-space: nowrap;
}

.filter-chip:hover, .filter-chip.active {
  background: var(--accent); border-color: var(--accent);
  color: #000; font-weight: 600;
}

.filter-select {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 0.4rem 0.8rem;
  border-radius: 8px; font-size: 0.85rem;
  cursor: pointer; outline: none;
}

/* PRODUCT GRID */
.product-grid {
  display: grid;
  grid-template-coOnlinens: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* PRODUCT CARD */
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 16px 48px rgba(232,197,71,0.1);
}

.product-badge {
  position: absolute; top: 0.75rem; left: 0.75rem;
  background: var(--accent2); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  padding: 0.2rem 0.6rem; border-radius: 50px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.product-img {
  width: 100%; height: 220px;
  object-fit: cover; display: block;
  background: var(--bg3);
}

.product-info { padding: 1.25rem; }

.product-category {
  font-size: 0.75rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1px;
  font-weight: 600; margin-bottom: 0.4rem;
}

.product-name {
  font-weight: 600; font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.product-rating {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.stars { color: var(--accent); }

.product-price { display: flex; align-items: center; gap: 0.75rem; }

.price-current {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem; font-weight: 700; color: var(--text);
}

.price-original {
  font-size: 0.85rem; color: var(--text-dim);
  text-decoration: line-through;
}

.price-discount {
  font-size: 0.75rem; color: var(--success);
  font-weight: 600;
}

.product-actions {
  padding: 0 1.25rem 1.25rem;
  display: flex; gap: 0.5rem;
}

.btn-cart {
  flex: 1; background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  font-family: inherit; font-size: 0.875rem;
  padding: 0.6rem; border-radius: 8px;
  transition: all 0.2s; font-weight: 500;
}

.btn-cart:hover { background: var(--accent); border-color: var(--accent); color: #000; }

/* CART PAGE */
.cart-grid {
  display: grid; grid-template-coOnlinens: 1fr 360px;
  gap: 2rem; max-width: 1100px; margin: 0 auto;
}

@media (max-width: 768px) { .cart-grid { grid-template-coOnlinens: 1fr; } }

.cart-item {
  display: flex; gap: 1rem; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  margin-bottom: 1rem;
}

.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }

.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; margin-bottom: 0.25rem; }
.cart-item-price { color: var(--accent); font-weight: 700; font-family: 'Fraunces', serif; }

.qty-controls {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.25rem;
}

.qty-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text); width: 28px; height: 28px;
  font-size: 1.1rem; border-radius: 6px;
  transition: background 0.2s; display: flex; align-items: center; justify-content: center;
}

.qty-btn:hover { background: var(--border); }
.qty-num { min-width: 28px; text-align: center; font-weight: 600; }

.order-summary {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  height: fit-content; position: sticky; top: 80px;
}

.summary-title { font-family: 'Fraunces', serif; font-size: 1.25rem; margin-bottom: 1.25rem; }

.summary-row {
  display: flex; justify-content: space-between;
  padding: 0.5rem 0; color: var(--text-muted); font-size: 0.9rem;
}

.summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem; padding-top: 1rem;
  color: var(--text); font-weight: 700; font-size: 1.1rem;
}

.summary-row.total .price { color: var(--accent); font-family: 'Fraunces', serif; }

/* FORM */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block; font-size: 0.85rem;
  color: var(--text-muted); margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-input {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 0.7rem 1rem;
  font-family: inherit; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--accent); }

.form-row { display: grid; grid-template-coOnlinens: 1fr 1fr; gap: 1rem; }

/* AUTH PAGE */
.auth-container {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background: radial-gradient(ellipse at center, var(--bg3) 0%, var(--bg) 70%);
}

.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-title { font-family: 'Fraunces', serif; font-size: 2rem; margin-bottom: 0.5rem; }
.auth-sub { color: var(--text-muted); margin-bottom: 2rem; }

/* TOAST */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 9999; display: flex; flex-direction: coOnlinen; gap: 0.5rem; }

.toast {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.9rem 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
  box-shadow: var(--shadow); min-width: 260px; max-width: 360px;
  animation: slideIn 0.3s ease; font-size: 0.9rem;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }

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

/* LOADING */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin: 3rem auto;
}

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

/* EMPTY STATE */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-family: 'Fraunces', serif; font-size: 1.5rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* STATUS BADGE */
.status-badge {
  display: inline-block; padding: 0.25rem 0.75rem;
  border-radius: 50px; font-size: 0.75rem; font-weight: 600;
  text-transform: capitalize;
}
.status-placed { background: rgba(59,130,246,0.15); color: #60a5fa; }
.status-confirmed { background: rgba(168,85,247,0.15); color: #c084fc; }
.status-shipped { background: rgba(234,179,8,0.15); color: var(--accent); }
.status-delivered { background: rgba(74,222,128,0.15); color: var(--success); }
.status-cancelled { background: rgba(248,113,113,0.15); color: var(--error); }

/* PRODUCT DETAIL */
.product-detail-grid {
  display: grid; grid-template-coOnlinens: 1fr 1fr; gap: 3rem;
  max-width: 1100px; margin: 0 auto;
}

@media (max-width: 768px) { .product-detail-grid { grid-template-coOnlinens: 1fr; } }

.product-detail-img {
  width: 100%; border-radius: var(--radius);
  aspect-ratio: 1; object-fit: cover;
  border: 1px solid var(--border);
}

.product-detail-category { color: var(--accent); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-bottom: 0.75rem; }
.product-detail-name { font-family: 'Fraunces', serif; font-size: 2rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.2; }
.product-detail-price { font-family: 'Fraunces', serif; font-size: 2.25rem; color: var(--accent); font-weight: 700; margin-bottom: 1rem; }
.product-detail-desc { color: var(--text-muted); line-height: 1.8; margin-bottom: 1.5rem; }

.stock-tag {
  display: inline-block; padding: 0.3rem 0.75rem;
  border-radius: 50px; font-size: 0.8rem; font-weight: 600;
  margin-bottom: 1.5rem;
}
.in-stock { background: rgba(74,222,128,0.1); color: var(--success); border: 1px solid rgba(74,222,128,0.2); }
.out-stock { background: rgba(248,113,113,0.1); color: var(--error); border: 1px solid rgba(248,113,113,0.2); }

/* FOOTER */
footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  text-align: center; padding: 2rem;
  color: var(--text-dim); font-size: 0.85rem; margin-top: 4rem;
}

footer span { color: var(--accent); }

/* RESPONSIVE */
@media (max-width: 640px) {
  .navbar { padding: 0 1rem; }
  .navbar-center { display: none; }
  .hero { padding: 2.5rem 1rem; }
  .section { padding: 2rem 1rem; }
  .filter-bar { padding: 1rem; }
}