:root {
  --maroon: #bc5a3a;
  --maroon-dark: #8f4429;
  --ink: #2a241d;
  --ink-soft: #6b6055;
  --cream: #fdf8f0;
  --surface: #ffffff;
  --line: #e6ddd0;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
}

/* Jyotesh flavor of this same marketplace — deployed separately at
   market.jyotesh.com, sharing this app's database with market.astrojay.com.
   Mirrors the palette used on jyotesh.com itself. */
:root[data-brand="jyotesh"] {
  --maroon: #35588f;
  --maroon-dark: #223c66;
  --ink: #182338;
  --ink-soft: #4f5c74;
  --cream: #f4f6fb;
  --surface: #ffffff;
  --line: #d8dfec;
  --font-body: 'Manrope', -apple-system, sans-serif;
  --font-display: 'Cinzel', Georgia, serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

.site-header { background: var(--maroon-dark); padding: 18px 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { color: #fff; font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; text-decoration: none; }
.brand-accent { color: #f0c9a8; font-weight: 500; }
.brand-devanagari {
  display: inline-block;
  margin-left: 0.5em;
  font-family: 'Tiro Devanagari Sanskrit', serif;
  font-weight: 400;
  font-size: 0.75em;
  color: #f0c9a8;
}
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a, .nav-login { color: #f0e6da; text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.nav-logout-form { display: inline; margin: 0; }
.nav-logout-btn { background: none; border: none; color: #f0e6da; font-weight: 600; font-size: 0.92rem; cursor: pointer; font-family: inherit; padding: 0; }

.hero {
  position: relative;
  padding: 120px 0 100px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.hero .eyebrow { color: #f0c9a8; }
.hero h1 { color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45); }
.hero .hero-lede { color: #f0e9de; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4); }

.eyebrow { color: var(--maroon); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
h1 { font-family: var(--font-display); font-size: 2.4rem; margin: 8px 0 16px; color: var(--maroon-dark); }
.hero-lede { max-width: 560px; margin: 0 auto 28px; color: var(--ink-soft); }

/* Category showcase — a slow crossfade-with-flash cycle through the
   marketplace's categories, standing in for real vendor photography until
   there's a product-image pipeline (see README: "no image upload/CDN yet").
   Each panel gets an equal 1/8 slice of one shared 28s loop; the same
   keyframes just start at a different offset per panel (see inline
   animation-delay), so they stay in perfect rotation indefinitely. */
.showcase {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.showcase-panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation-name: showcase-cycle;
  animation-duration: 28s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
.showcase-panel svg { width: 220px; height: 220px; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35)); }
.showcase-label {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.hero::after {
  /* keeps hero copy readable regardless of which panel is behind it */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0.55) 0%, rgba(10, 8, 6, 0.72) 100%);
}

@keyframes showcase-cycle {
  0%    { opacity: 0; filter: brightness(1); }
  0.4%  { opacity: 1; filter: brightness(2.4); }
  2%    { opacity: 1; filter: brightness(1); }
  10%   { opacity: 1; filter: brightness(1); }
  12%   { opacity: 0; filter: brightness(1); }
  100%  { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .showcase-panel {
    animation: none;
    opacity: 0;
  }
  .showcase-panel:first-child {
    opacity: 1;
  }
}

.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
}
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-dark); }
.btn-primary:disabled { background: #c9bdae; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--maroon); border: 1px solid var(--maroon); }
.btn-secondary:hover { background: rgba(188, 90, 58, 0.08); }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.section { padding: 48px 0; }
.account-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 28px;
  max-width: 480px;
}
.account-card p { margin: 0 0 10px; }
.account-hint { color: var(--ink-soft); font-size: 0.88rem; margin-top: 16px; }

/* Forms (shared: apply / product-form) */
label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--maroon-dark); }
.optional { font-weight: 400; color: var(--ink-soft); font-size: 0.88rem; }
.form-row { margin-bottom: 18px; }
.form-row--split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type="text"], input[type="email"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(188, 90, 58, 0.15);
}
.apply-form, .product-form { max-width: 560px; }
.alert {
  background: #fbe9e4;
  border: 1px solid #e3a993;
  color: #7a3319;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}
.alert-info { background: #eef2fb; border-color: #a9bde3; color: #2c4a8f; }
.alert-success { background: #e7f3e5; border-color: #9fc99a; color: #2f6b2a; }

/* Shop */
.shop-search { display: flex; gap: 10px; max-width: 480px; margin: 20px 0 28px; }
.shop-layout { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: start; }
.shop-categories h2 { font-size: 1rem; font-family: var(--font-body); color: var(--maroon-dark); margin: 0 0 10px; }
.shop-categories ul { list-style: none; margin: 0; padding: 0; }
.shop-categories li { margin-bottom: 6px; }
.shop-categories a { color: var(--ink-soft); text-decoration: none; font-size: 0.92rem; }
.shop-categories a:hover, .shop-categories a.active { color: var(--maroon); font-weight: 700; }
.empty-state-text { color: var(--ink-soft); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; }
.product-card { display: block; text-decoration: none; color: var(--ink); }
.product-card-image {
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}
.product-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 0.82rem; background: var(--line);
}
.product-card-category { color: var(--ink-soft); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 2px; }
.product-card-name { font-weight: 700; margin: 0 0 2px; }
.product-card-vendor { color: var(--ink-soft); font-size: 0.85rem; margin: 0 0 4px; }
.product-card-price { color: var(--maroon-dark); font-weight: 700; margin: 0; }

.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 20px; }
.product-detail-images img { width: 100%; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 12px; }
.product-detail-placeholder { aspect-ratio: 1/1; border-radius: 10px; }
.product-detail-vendor { color: var(--ink-soft); margin: 6px 0; }
.product-detail-price { font-size: 1.6rem; font-weight: 700; color: var(--maroon-dark); margin: 10px 0; }
.product-detail-description { margin: 16px 0; }
.product-detail-stock { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 20px; }
@media (max-width: 700px) {
  .shop-layout, .product-detail { grid-template-columns: 1fr; }
}

/* Vendor dashboard */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.dashboard-header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.payouts-history-heading { margin-top: 32px; }
.cart-item-dates, .checkout-line-dates { color: var(--ink-soft); font-size: 0.85rem; }
.link-back { color: var(--maroon); text-decoration: none; font-weight: 600; display: inline-block; margin-bottom: 16px; }
.vendor-product-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.vendor-product-table th, .vendor-product-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.vendor-product-table th { background: var(--cream); color: var(--maroon-dark); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.vendor-product-table tr:last-child td { border-bottom: none; }
.vendor-product-thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-right: 8px; }
.vendor-product-actions { display: flex; gap: 12px; align-items: center; }
.vendor-product-actions form { display: inline; margin: 0; }
.link-btn { background: none; border: none; color: var(--maroon); font-weight: 600; font-size: 0.88rem; cursor: pointer; padding: 0; font-family: inherit; }
.link-btn-danger { color: #b0402a; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; text-transform: uppercase; }
.status-active, .status-paid { background: #e7f3e5; color: #2f6b2a; }
.status-draft, .status-pending { background: #f1ede4; color: var(--ink-soft); }
.status-archived, .status-canceled { background: #f1e4e4; color: #94443a; }
.status-refunded { background: #eef2fb; color: #2c4a8f; }
.vendor-product-note { color: var(--ink-soft); font-size: 0.85rem; font-style: italic; }

/* Cart */
.add-to-cart-form { display: flex; gap: 10px; align-items: center; }
.add-to-cart-form input[type="number"] { width: 70px; }
.cart-vendor-group { margin-bottom: 28px; }
.cart-vendor-name { font-size: 1.05rem; color: var(--maroon-dark); margin: 0 0 10px; }
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item--unavailable { opacity: 0.55; }
.cart-item-image { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item-name { color: var(--ink); font-weight: 700; text-decoration: none; display: block; }
.cart-item-price { color: var(--ink-soft); font-size: 0.85rem; margin: 2px 0 0; }
.cart-item-qty-form { display: flex; gap: 6px; align-items: center; }
.cart-item-qty-form input { width: 56px; padding: 6px 8px; }
.cart-item-line-total { font-weight: 700; color: var(--maroon-dark); margin: 0; white-space: nowrap; }
@media (max-width: 640px) {
  .cart-item { grid-template-columns: 56px 1fr; grid-template-areas: "img info" "qty qty" "total remove"; }
}
.cart-summary { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding-top: 20px; border-top: 2px solid var(--line); }
.cart-subtotal { font-size: 1.15rem; margin: 0; }

/* Checkout */
.checkout-summary { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin: 20px 0; max-width: 500px; }
.checkout-vendor-group { margin-bottom: 14px; }
.checkout-vendor-group h3 { font-size: 0.95rem; color: var(--maroon-dark); margin: 0 0 8px; }
.checkout-line { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 4px 0; }
.checkout-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.1rem; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); }
.checkout-order-status { margin: 4px 0 20px; }

/* Orders */
.order-list { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.order-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.order-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.order-card-id { font-weight: 700; margin: 0; }
.order-card-date { color: var(--ink-soft); font-size: 0.82rem; margin: 2px 0 0; }
.order-card-total { font-weight: 700; text-align: right; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.account-links { margin-top: 16px; }
.account-links a { color: var(--maroon); font-weight: 600; text-decoration: none; }

/* Admin */
.admin-nav { display: flex; gap: 10px; margin: 20px 0 28px; flex-wrap: wrap; }
.admin-nav-link {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--maroon-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.admin-nav-link:hover { border-color: var(--maroon); }
.badge {
  display: inline-block;
  background: var(--maroon);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  margin-left: 4px;
}
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.admin-stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; text-align: center; }
.admin-stat-number { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--maroon-dark); margin: 0; }
.admin-stat-label { color: var(--ink-soft); font-size: 0.85rem; margin: 4px 0 0; }
@media (max-width: 600px) { .admin-stats { grid-template-columns: 1fr; } }

.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-list li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.audit-list li:last-child { border-bottom: none; }
.audit-action { font-weight: 700; color: var(--maroon-dark); margin-right: 8px; }
.audit-detail { color: var(--ink); margin-right: 8px; }
.audit-meta { color: var(--ink-soft); font-size: 0.82rem; }

.admin-tabs { display: flex; gap: 4px; margin: 16px 0 24px; border-bottom: 1px solid var(--line); }
.admin-tab { padding: 10px 16px; color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.9rem; border-bottom: 2px solid transparent; }
.admin-tab.active, .admin-tab:hover { color: var(--maroon); border-bottom-color: var(--maroon); }

.admin-vendor-list { display: flex; flex-direction: column; gap: 14px; }
.admin-vendor-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.admin-vendor-info h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.15rem; color: var(--maroon-dark); }
.admin-vendor-email { color: var(--ink-soft); font-size: 0.85rem; margin: 0 0 6px; }
.admin-vendor-description { font-size: 0.9rem; margin: 0 0 6px; }
.admin-vendor-meta { color: var(--ink-soft); font-size: 0.8rem; margin: 0; }
.admin-vendor-reason { color: #94443a; font-size: 0.85rem; margin: 6px 0 0; }
.admin-vendor-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.admin-vendor-actions form { margin: 0; }
.admin-reject-form { display: flex; gap: 6px; }
.admin-reject-form input[type="text"] { width: 160px; padding: 8px 10px; font-size: 0.85rem; }
.btn-small { padding: 8px 16px; font-size: 0.85rem; }
