/* ==========================================================
   MARKETPLACE THEME
   Palette: Deep Ink Navy + Warm Marigold accent (marketplace/trust feel)
   ========================================================== */
:root {
  --ink: #0F1C2E;        /* deep navy - headers, text */
  --ink-soft: #46536B;   /* secondary text */
  --paper: #F7F8FA;      /* page background */
  --card: #FFFFFF;
  --marigold: #F5A623;   /* primary accent - CTAs */
  --marigold-dark: #D6890A;
  --line: #E3E7ED;
  --success: #1E9E6B;
  --danger: #D64545;
  --radius: 10px;
  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

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

/* ---------- Layout shell ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

.auth-side {
  background: linear-gradient(160deg, var(--ink) 0%, #1B2E4A 100%);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-side .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.5px;
}
.auth-side .brand span { color: var(--marigold); }

.auth-side .pitch h1 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.15;
  margin-bottom: 16px;
  font-weight: 600;
}
.auth-side .pitch p {
  color: #C7D0DE;
  max-width: 380px;
  font-size: 15px;
}

.auth-side .stack-note {
  font-size: 12px;
  color: #8291A8;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 16px;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  font-family: var(--font-display);
  font-size: 26px;
  margin-bottom: 6px;
}
.auth-card .sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 28px;
}

.tab-switch {
  display: flex;
  background: var(--line);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 24px;
}
.tab-switch button {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-switch button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--card);
}
.field input:focus {
  outline: none;
  border-color: var(--marigold);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.18);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--marigold);
  color: var(--ink);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--marigold-dark); }

.btn-google {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-google:hover { background: var(--paper); }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--ink-soft);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.form-footer {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
.form-footer a { color: var(--marigold-dark); font-weight: 600; }

.msg {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: none;
}
.msg.show { display: block; }
.msg.error { background: #FCEAEA; color: var(--danger); }
.msg.success { background: #E7F6EF; color: var(--success); }

.hidden { display: none !important; }

/* ---------- Dashboard shells (user/admin) ---------- */
.dash-topbar {
  background: var(--ink);
  color: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-topbar .brand { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.dash-topbar .brand span { color: var(--marigold); }
.dash-topbar .logout-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.dash-topbar .logout-btn:hover { background: rgba(255,255,255,0.1); }

.dash-body {
  padding: 40px 32px;
  max-width: 1100px;
  margin: 0 auto;
}
.dash-body h1 {
  font-family: var(--font-display);
  margin-bottom: 8px;
}
.dash-body p.lead {
  color: var(--ink-soft);
  margin-bottom: 32px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .label { font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.stat-card .value { font-family: var(--font-display); font-size: 28px; font-weight: 600; }

/* ---------- Shared shop nav ---------- */
.shop-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.shop-nav a {
  font-size: 14px;
  font-weight: 600;
  color: #C7D0DE;
}
.shop-nav a:hover, .shop-nav a.active { color: #fff; }
.shop-nav .cart-badge {
  background: var(--marigold);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
}

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.search-bar input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.search-bar button {
  padding: 0 20px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.filter-bar select, .filter-bar input {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: var(--card);
}

/* ---------- Product grid/cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease;
}
.product-card:hover { box-shadow: 0 6px 18px rgba(15,28,46,0.08); }
.product-card .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--paper);
}
.product-card .body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-card .name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.product-card .brand { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.product-card .price-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.product-card .price { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.product-card .stars { color: var(--marigold-dark); font-size: 12px; }
.wishlist-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink-soft);
}
.wishlist-btn.active { color: var(--danger); }

.stock-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; display: inline-block; }
.stock-badge.in { background: #E7F6EF; color: var(--success); }
.stock-badge.out { background: #FCEAEA; color: var(--danger); }
.stock-badge.low { background: #FFF3E0; color: var(--marigold-dark); }

/* ---------- Product detail page ---------- */
.pdp-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 800px) { .pdp-layout { grid-template-columns: 1fr; } }

.carousel-main {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--paper);
  margin-bottom: 10px;
}
.carousel-thumbs { display: flex; gap: 8px; }
.carousel-thumbs img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  cursor: pointer; border: 2px solid transparent;
}
.carousel-thumbs img.active { border-color: var(--marigold); }

.variant-group { margin-bottom: 18px; }
.variant-group .label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.variant-options { display: flex; gap: 8px; flex-wrap: wrap; }
.variant-chip {
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; font-size: 13px; background: var(--card);
}
.variant-chip.selected { border-color: var(--marigold); background: #FFF7EA; font-weight: 600; }
.variant-chip.disabled { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }

.qty-selector { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.qty-selector button {
  width: 34px; height: 34px; border: 1px solid var(--line); background: var(--card);
  border-radius: 8px; font-size: 16px; cursor: pointer;
}

.review-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.review-item .who { font-weight: 600; font-size: 13px; }
.review-item .stars { color: var(--marigold-dark); font-size: 13px; margin: 4px 0; }
.review-item .comment { font-size: 14px; color: var(--ink-soft); }

/* ---------- Cart / Checkout ---------- */
.cart-row {
  display: grid; grid-template-columns: 80px 1fr auto auto auto;
  align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.cart-row img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.cart-row .qty-selector { margin: 0; }
.cart-row .remove-link { color: var(--danger); font-size: 13px; cursor: pointer; }

.summary-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; height: fit-content;
}
.summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; }
.summary-row.total { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }

.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
@media (max-width: 800px) { .checkout-grid { grid-template-columns: 1fr; } }

.payment-option {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; cursor: pointer;
}
.payment-option.selected { border-color: var(--marigold); background: #FFF7EA; }
.payment-option .title { font-weight: 600; font-size: 14px; }
.payment-option .desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Orders / tracking ---------- */
.order-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.order-card .top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.status-pill { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; text-transform: capitalize; }
.status-pill.pending { background: #FFF3E0; color: var(--marigold-dark); }
.status-pill.shipped { background: #E3EEFC; color: #2563A6; }
.status-pill.delivered { background: #E7F6EF; color: var(--success); }

.track-steps { display: flex; margin: 16px 0; }
.track-step { flex: 1; text-align: center; position: relative; font-size: 12px; color: var(--ink-soft); }
.track-step::before {
  content: ""; display: block; width: 14px; height: 14px; border-radius: 50%;
  background: var(--line); margin: 0 auto 6px;
}
.track-step.done::before { background: var(--marigold); }
.track-step.done { color: var(--ink); font-weight: 600; }
