/* =========================================================
   SummitStock App CSS — marketplace pages
   Extends theme.css (loaded before this file).
   Owns: nav, shop, vendor directory, vendor profile,
         product detail, shared page chrome.
   Does NOT own: landing page styles (those live in theme.css).
   ========================================================= */

/* ---- NAV ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 15, 10, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-brand:hover { color: var(--accent); transition: color 0.2s; }

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--fg);
  background: var(--card-bg);
}

/* ---- SHARED PAGE CHROME ---- */
.app-main { min-height: calc(100vh - 64px); }

.breadcrumb-sep {
  color: var(--card-border);
  margin: 0 6px;
}

.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

.usa-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--earth-light);
  background: rgba(61, 90, 58, 0.15);
  border: 1px solid rgba(78, 112, 73, 0.3);
  border-radius: 100px;
  padding: 3px 10px;
  white-space: nowrap;
}

.usa-badge-sm {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--earth-light);
}

.btn-accent {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #0C0F0A;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn-accent:hover { background: var(--accent-light); transform: translateY(-1px); }

.btn-ghost {
  display: inline-block;
  padding: 10px 24px;
  border: 1px solid var(--card-border);
  color: var(--fg-muted);
  font-size: 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--earth); color: var(--fg); }

/* ---- SHOP PAGE ---- */
.shop-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--card-border);
  padding: 48px 24px 40px;
}

.shop-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.shop-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  margin-bottom: 8px;
}

.shop-lede {
  color: var(--fg-muted);
  font-size: 1rem;
}

.shop-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}

/* Category sidebar */
.category-sidebar {
  position: sticky;
  top: 88px;
}

.sidebar-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 12px;
  padding: 0 12px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg-muted);
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}

.category-item:hover {
  background: var(--card-bg);
  color: var(--fg);
}

.category-item.active {
  background: rgba(200, 169, 81, 0.1);
  color: var(--accent);
  border: 1px solid rgba(200, 169, 81, 0.2);
}

.cat-icon { font-size: 1rem; }
.cat-name { flex: 1; font-weight: 500; }
.cat-count {
  font-size: 0.75rem;
  color: var(--fg-muted);
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  padding: 1px 8px;
  min-width: 24px;
  text-align: center;
}

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

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  border-color: var(--earth);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.product-card-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-alt);
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
}

.placeholder-icon {
  font-size: 3rem;
  opacity: 0.4;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  background: var(--accent);
  color: #0C0F0A;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 100px;
}

.product-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

.product-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

.product-vendor {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
}

.product-location {
  font-size: 0.72rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-name {
  font-size: 1rem;
  color: var(--fg);
  line-height: 1.3;
}

.product-tagline {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.5;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
  gap: 8px;
  flex-wrap: wrap;
}

.product-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}

/* ---- VENDORS PAGE ---- */
.page-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--card-border);
  padding: 72px 24px 56px;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(61, 90, 58, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(200, 169, 81, 0.06) 0%, transparent 50%);
}

.page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.page-badge {
  display: inline-block;
  padding: 4px 16px;
  background: rgba(200, 169, 81, 0.12);
  border: 1px solid var(--accent-dark);
  border-radius: 100px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.75rem);
  margin-bottom: 16px;
}

.page-header .accent { color: var(--accent); }

.page-lede {
  color: var(--fg-muted);
  font-size: 1.05rem;
  max-width: 600px;
  line-height: 1.7;
}

.vendors-grid-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.vendors-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.vendor-dir-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--earth);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.vendor-dir-card:hover {
  border-top-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.vendor-dir-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vendor-dir-location {
  font-size: 0.78rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.vendor-featured-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.vendor-dir-name {
  font-size: 1.2rem;
  color: var(--fg);
}

.vendor-dir-tagline {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.5;
  flex: 1;
}

.vendor-dir-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}

.vendor-stat {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* ---- VENDOR PROFILE ---- */
.vendor-profile-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--card-border);
  padding: 40px 24px 48px;
  position: relative;
  overflow: hidden;
}

.vendor-profile-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(61, 90, 58, 0.18) 0%, transparent 60%);
}

.vendor-profile-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.vendor-profile-breadcrumb {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 24px;
}

.vendor-profile-breadcrumb a {
  color: var(--fg-muted);
  text-decoration: none;
}
.vendor-profile-breadcrumb a:hover { color: var(--accent); }

.vendor-profile-location {
  font-size: 0.82rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.vendor-profile-name {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 10px;
}

.vendor-profile-tagline {
  font-size: 1.1rem;
  color: var(--fg-muted);
  max-width: 550px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.vendor-profile-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.vp-stat { display: flex; flex-direction: column; gap: 2px; }

.vp-stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.vp-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
}

.vp-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--card-border);
}

.vendor-story-section {
  padding: 56px 24px;
  border-bottom: 1px solid var(--card-border);
}

.vendor-story-inner {
  max-width: 760px;
  margin: 0 auto;
}

.vendor-story-text p {
  font-size: 1.05rem;
  color: var(--fg-muted);
  line-height: 1.8;
}

.vendor-products-section {
  padding: 56px 24px;
}

.vendor-products-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.empty-state-text {
  color: var(--fg-muted);
  font-size: 0.95rem;
  padding: 32px 0;
}

/* ---- PRODUCT DETAIL ---- */
.product-detail-page {
  padding: 40px 24px 80px;
}

.product-detail-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.pd-breadcrumb {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 40px;
}

.pd-breadcrumb a {
  color: var(--fg-muted);
  text-decoration: none;
}
.pd-breadcrumb a:hover { color: var(--accent); }

.pd-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.pd-image-frame {
  aspect-ratio: 4/3;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 88px;
}

.pd-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
}

.pd-placeholder-icon {
  font-size: 5rem;
  opacity: 0.3;
}

.pd-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pd-vendor-link {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.pd-vendor-link:hover { color: var(--accent-light); }

.pd-usa-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--earth-light);
  background: rgba(61, 90, 58, 0.15);
  border: 1px solid rgba(78, 112, 73, 0.3);
  border-radius: 100px;
  padding: 4px 12px;
}

.pd-title {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  margin-bottom: 12px;
}

.pd-tagline {
  font-size: 1.05rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.pd-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 32px;
}

.pd-section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 10px;
}

.pd-description,
.pd-materials {
  margin-bottom: 24px;
}

.pd-description p,
.pd-materials p {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.75;
}

.pd-made-in {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 32px;
}

.pd-made-in strong { color: var(--fg); }

.pd-vendor-callout {
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--earth);
  border-radius: var(--radius);
  margin-top: 8px;
}

.pd-vc-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.pd-vc-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}

.pd-vc-tagline {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.pd-vc-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.pd-vc-link:hover { color: var(--accent-light); }

/* ---- 404 / ERROR ---- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  text-align: center;
  padding: 40px;
}

.error-page h1 {
  font-size: 6rem;
  color: var(--card-border);
  line-height: 1;
}

.error-page p {
  color: var(--fg-muted);
  margin-bottom: 8px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 960px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .category-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
  }

  .sidebar-label { display: none; }

  .category-item {
    flex: 0 0 auto;
    padding: 7px 14px;
  }

  .cat-count { display: none; }

  .pd-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .pd-image-frame { position: static; aspect-ratio: 16/9; }
}

@media (max-width: 640px) {
  .vendor-profile-stats { gap: 20px; }
  .vp-stat-divider { display: none; }
  .product-grid { grid-template-columns: 1fr; }
  .vendors-directory-grid { grid-template-columns: 1fr; }
  .shop-header, .page-header { padding: 40px 20px 32px; }
  .shop-layout, .vendors-grid-wrap, .vendor-products-inner,
  .vendor-story-inner, .product-detail-inner { padding-left: 16px; padding-right: 16px; }
}
