/* ═══════════════════════════════════════
   PRINTARA — Marketplace Styles
   Public pages: browse, model detail, profile
   Premium dark theme — cool navy, glassmorphism, glow effects
   ═══════════════════════════════════════ */

/* ── Marketplace Navigation (Public Pages) ── */
.marketplace-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px;
  background: rgba(7, 9, 14, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  padding: 0 24px;
  transition: background .3s, box-shadow .3s;
}
.marketplace-nav.scrolled {
  background: rgba(7, 9, 14, 0.95);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.04);
}
.marketplace-nav-inner {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}
.marketplace-nav .logo {
  flex-shrink: 0;
}
.marketplace-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.marketplace-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
}
.marketplace-search input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1), 0 0 20px rgba(0, 229, 255, 0.06);
}
.marketplace-search input::placeholder { color: var(--text-muted); }
.marketplace-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}
.marketplace-nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.marketplace-nav-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color .25s;
  position: relative;
}
.marketplace-nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform .25s;
}
.marketplace-nav-links a:hover { color: var(--text); }
.marketplace-nav-links a:hover::after { transform: scaleX(1); }
.marketplace-nav-links a.active { color: var(--accent); }
.marketplace-nav-links a.active::after { transform: scaleX(1); }
.marketplace-nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Marketplace Layout ── */
.marketplace-page {
  padding-top: 64px;
  min-height: 100vh;
  background: var(--bg-primary);
}
.marketplace-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}
.marketplace-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

/* ── Filters Sidebar ── */
.marketplace-filters {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  padding-right: 8px;
}
.filter-section {
  margin-bottom: 24px;
}
.filter-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.filter-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all .2s;
}
.filter-option:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.filter-option.active { background: rgba(0, 229, 255, 0.08); color: var(--accent); }
.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}
.filter-range {
  display: flex;
  gap: 8px;
  align-items: center;
}
.filter-range input {
  width: 80px;
  padding: 6px 8px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
  transition: border-color .2s;
}
.filter-range input:focus { border-color: var(--accent); }
.filter-range span { color: var(--text-muted); font-size: 0.82rem; }

/* ── Marketplace Header (sort + count) ── */
.marketplace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.marketplace-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}
.marketplace-header .result-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 8px;
}
.marketplace-sort {
  display: flex;
  gap: 8px;
  align-items: center;
}
.marketplace-sort select {
  padding: 7px 32px 7px 12px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color .2s;
}
.marketplace-sort select:hover { border-color: rgba(255, 255, 255, 0.12); }

/* ── Product Card Grid ── */
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
}
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity .3s;
  z-index: 1;
}
.product-card:hover {
  border-color: rgba(0, 229, 255, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 229, 255, 0.08);
}
.product-card:hover::before { opacity: 1; }
.product-thumb {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-secondary);
  overflow: hidden;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}
.product-card:hover .product-thumb img {
  transform: scale(1.06);
}
.product-thumb .placeholder-3d {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 3rem;
  opacity: 0.1;
}
.product-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
}
.product-price-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(12px);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.product-price-tag.free { color: var(--success); }
.product-body {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-seller {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.product-seller-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.product-seller-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.product-stats {
  display: flex;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.product-stats span {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ── Verified Badge ── */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.verified-badge svg { width: 14px; height: 14px; }
.verified-badge.artist svg { color: var(--accent); filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.4)); }
.verified-badge.printer svg { color: #f5a623; filter: drop-shadow(0 0 4px rgba(245, 166, 35, 0.4)); }

/* ── Rating Stars ── */
.rating-stars {
  display: inline-flex;
  gap: 1px;
  align-items: center;
}
.rating-stars .star {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.rating-stars .star.filled { color: #f5a623; }
.rating-stars .rating-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-left: 4px;
  font-weight: 500;
}

/* ── Dual CTA Buttons ── */
.dual-cta {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.dual-cta .btn { flex: 1; }

/* ── Pagination ── */
.marketplace-pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 32px;
  padding: 16px 0;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .25s;
}
.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 229, 255, 0.06);
}
.page-btn.active {
  background: linear-gradient(135deg, #00E5FF, #7C3AED);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.2);
}
.page-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Model Detail Page ── */
.model-detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}
.model-detail-viewer {
  position: relative;
  background: var(--bg-secondary);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.model-detail-viewer canvas {
  width: 100%;
  height: 520px;
  display: block;
  cursor: grab;
}
.model-detail-viewer canvas:active { cursor: grabbing; }
.model-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Seller Card */
.seller-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color .3s;
}
.seller-card:hover { border-color: rgba(255, 255, 255, 0.1); }
.seller-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.seller-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
}
.seller-avatar img { width: 100%; height: 100%; object-fit: cover; }
.seller-info { flex: 1; min-width: 0; }
.seller-name {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.seller-stats {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Model Info Card */
.model-info-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.model-info-card h1 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}
.model-info-card .model-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.model-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.model-tag {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all .2s;
}
.model-tag:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.2);
  color: var(--accent);
}
.model-detail-stats {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.model-detail-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.model-price-big {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin: 16px 0;
}
.model-price-big.free {
  color: var(--success);
}
.model-formats {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.format-pill {
  padding: 4px 10px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

/* ═══════════════════════════════════════
   BEFORE/AFTER SLIDER — Hero showcase
   ═══════════════════════════════════════ */
.ba-slider-wrap {
  max-width: 800px;
  margin: 0 auto;
}
.ba-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  overflow: hidden;
  cursor: ew-resize;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(0, 229, 255, 0.06);
  background: var(--bg-secondary);
}
.ba-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.ba-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}
.ba-layer--textured {
  z-index: 2;
  clip-path: inset(0 0 0 50%);
}
.ba-layer--gray {
  z-index: 1;
}
.ba-gray-img {
  filter: saturate(0) brightness(0.65) contrast(1.15);
}
.ba-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
}
.ba-icon {
  font-size: 4rem;
  opacity: 0.15;
  margin-bottom: 8px;
}
.ba-label {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.4;
}
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}
.ba-handle-line {
  flex: 1;
  width: 2px;
  background: rgba(255, 255, 255, 0.6);
}
.ba-handle-knob {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  font-size: 0.7rem;
  cursor: ew-resize;
  pointer-events: auto;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.4);
  transition: border-color .2s, box-shadow .2s;
  flex-shrink: 0;
}
.ba-handle-knob:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}
.ba-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 4px;
}
.ba-tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
}
.ba-tag--gray {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}
.ba-tag--color {
  background: rgba(0, 229, 255, 0.08);
  color: var(--accent);
}

/* ═══════════════════════════════════════
   GALLERY HOVER REVEAL — Textured ↔ Gray
   ═══════════════════════════════════════ */
.gallery-mode-toggle {
  display: none;
  justify-content: center;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 4px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.mode-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}
.mode-btn.active {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
}
.mode-btn:hover:not(.active) {
  color: var(--text);
}

/* Desktop: hover crossfade to gray */
.gallery-hover-reveal .product-thumb img {
  transition: filter .4s cubic-bezier(.4, 0, .2, 1), transform .4s cubic-bezier(.4, 0, .2, 1);
}
.gallery-hover-reveal .product-card:hover .product-thumb img {
  filter: saturate(0) brightness(0.65) contrast(1.15);
}
/* Show "Print-Ready" label on hover */
.gallery-hover-reveal .product-thumb::after {
  content: 'Print-Ready';
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(7, 9, 14, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity .3s;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gallery-hover-reveal .product-card:hover .product-thumb::after {
  opacity: 1;
}

/* Mobile toggle: force gray mode on all cards */
.gallery-gray-mode .product-thumb img {
  filter: saturate(0) brightness(0.65) contrast(1.15) !important;
}
.gallery-gray-mode .product-thumb::after {
  opacity: 1 !important;
}

@media (max-width: 768px) {
  .gallery-mode-toggle { display: flex; }
  /* Disable hover reveal on mobile — use toggle instead */
  .gallery-hover-reveal .product-card:hover .product-thumb img {
    filter: none;
  }
  .gallery-hover-reveal .product-card:hover .product-thumb::after {
    opacity: 0;
  }
  .ba-slider { aspect-ratio: 4 / 3; }
  .ba-handle-knob { width: 36px; height: 36px; font-size: 0.65rem; }
}

/* ── Profile Page ── */
.profile-header {
  position: relative;
  margin-bottom: 24px;
}
.profile-cover {
  height: 240px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-elevated) 50%, rgba(0, 229, 255, 0.04) 100%);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
}
.profile-cover::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--bg-primary), transparent);
  pointer-events: none;
}
.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-info {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  margin-top: -48px;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border: 4px solid var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.2);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-details {
  flex: 1;
  padding-bottom: 8px;
}
.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-bio {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
  max-width: 600px;
}
.profile-stats-row {
  display: flex;
  gap: 24px;
  margin-top: 12px;
}
.profile-stat {
  text-align: center;
}
.profile-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
}
.profile-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.profile-social {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.profile-social a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color .2s;
}
.profile-social a:hover { color: var(--accent); }

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 24px;
}

/* ── Settings Page ── */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-nav a {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all .2s;
}
.settings-nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.settings-nav a.active { background: rgba(0, 229, 255, 0.08); color: var(--accent); }
.settings-section {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.settings-section h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.settings-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.settings-row .input-group { flex: 1; }
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.avatar-upload-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
}
.avatar-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-upload {
  margin-bottom: 20px;
}
.cover-upload-preview {
  height: 120px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}
.cover-upload-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── Related Models Grid ── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* ── Reviews Section ── */
.review-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color .2s;
}
.review-card:hover { border-color: rgba(255, 255, 255, 0.1); }
.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.review-author {
  font-size: 0.85rem;
  font-weight: 600;
}
.review-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}
.review-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}
.empty-state-icon {
  font-size: 3rem;
  opacity: 0.1;
  margin-bottom: 12px;
}
.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* ── Featured Section (Homepage) ── */
.featured-section {
  padding: 48px 0;
}
.featured-section h2 {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

/* ── Footer (Marketplace) ── */
.marketplace-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 48px 0 24px;
  margin-top: 48px;
}

/* ── Viewer Loading Overlay ── */
.viewer-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg-primary);
  z-index: 10; transition: opacity .4s ease;
}
.viewer-loading.hidden { opacity: 0; pointer-events: none; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.06);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-text { margin-top: 12px; color: var(--text-muted); font-size: 0.85rem; }

/* ── Mobile Filters Toggle ── */
.mobile-filters-btn {
  display: none;
  align-items: center; gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px; color: var(--text);
  font-size: 0.85rem; cursor: pointer;
  margin-bottom: 16px;
  transition: all .2s;
}
.mobile-filters-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.06);
}
.marketplace-filters-mobile {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px);
}
.marketplace-filters-mobile.open { display: flex; justify-content: flex-end; }
.marketplace-filters-mobile .filters-drawer {
  width: 300px; max-width: 85vw; height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  padding: 24px; overflow-y: auto;
  animation: slideInRight .25s cubic-bezier(.4, 0, .2, 1);
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
.filters-drawer-close {
  background: none; border: none; color: var(--text);
  font-size: 1.5rem; cursor: pointer; float: right;
  transition: color .2s;
}
.filters-drawer-close:hover { color: var(--accent); }

/* ── Mobile Nav Links ── */
.nav-links.open {
  display: flex !important;
  flex-direction: column;
  position: absolute; top: 100%; left: 0; right: 0;
  background: rgba(7, 9, 14, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px; gap: 12px; z-index: 100;
}

/* ═══════════════════════════════════════
   HOMEPAGE — Gallery-First Layout
   ═══════════════════════════════════════ */

/* Compact Hero */
.hero-compact {
  min-height: auto;
  padding: 140px 24px 48px;
}
.hero-compact h1 { font-size: 3.5rem; margin-bottom: 16px; }
.hero-compact p { font-size: 1.05rem; margin-bottom: 24px; }
.hero-generate-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-cta-btn {
  font-size: 1rem;
  gap: 8px;
}

/* Gallery Section */
.gallery-section {
  padding: 24px 0 48px;
}
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.gallery-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}
.gallery-view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 3px;
}
.view-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.view-btn.active {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
}
.view-btn:hover:not(.active) { color: var(--text); }

/* Category Tabs */
.gallery-categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery-categories::-webkit-scrollbar { display: none; }
.cat-tab {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  flex-shrink: 0;
}
.cat-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
.cat-tab.active {
  background: var(--text);
  color: var(--bg-primary);
  border-color: var(--text);
}

/* Gallery Grid (larger, 4 col) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.gallery-grid .gallery-card {
  cursor: pointer;
}

/* Gallery Inject Banner */
.gallery-inject {
  grid-column: 1 / -1;
  margin: 16px 0;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.gallery-inject .ba-slider-wrap {
  max-width: 700px;
  margin: 0 auto;
}
.inject-label {
  text-align: center;
  margin-bottom: 20px;
}
.inject-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}
.inject-label h3 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}
.inject-label p {
  font-size: 0.88rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════
   MODEL VIEWER MODAL
   ═══════════════════════════════════════ */
.model-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.model-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.model-modal {
  width: 90vw;
  max-width: 1100px;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(0, 229, 255, 0.05);
  transform: translateY(20px) scale(0.97);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  position: relative;
}
.model-modal-overlay.active .model-modal {
  transform: translateY(0) scale(1);
}
.model-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.model-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.model-modal-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  height: 75vh;
  max-height: 75vh;
}
.model-modal-viewer {
  position: relative;
  background: #0E1117;
  overflow: hidden;
}
.model-modal-viewer canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
.model-modal-viewer canvas:active { cursor: grabbing; }
.model-modal-info {
  padding: 24px;
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}
.model-modal-info h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.model-modal-seller {
  margin-bottom: 4px;
}
.model-modal-meta {
  flex: 1;
}
.model-modal-actions {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.model-modal-toggle {
  width: 100%;
  justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .marketplace-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .model-detail-layout { grid-template-columns: 1fr 320px; }
  .related-grid { grid-template-columns: repeat(3, 1fr); }
  .model-modal-body { grid-template-columns: 1fr 300px; }
}
@media (max-width: 1024px) {
  .marketplace-layout { grid-template-columns: 1fr; }
  .marketplace-filters { display: none; }
  .mobile-filters-btn { display: flex; }
  .marketplace-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-compact h1 { font-size: 2.75rem; }
}
@media (max-width: 768px) {
  .marketplace-nav { padding: 0 16px; }
  .marketplace-nav-links { display: none; }
  .marketplace-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .model-detail-layout { grid-template-columns: 1fr; }
  .model-detail-viewer canvas { height: 360px; }
  .model-modal-body { grid-template-columns: 1fr; height: auto; max-height: 85vh; }
  .model-modal-viewer { height: 50vh; min-height: 280px; }
  .model-modal-info { border-left: none; border-top: 1px solid rgba(255,255,255,.06); }
  .model-modal { max-height: 90vh; }
  .profile-cover { height: 160px; }
  .profile-info { flex-direction: column; align-items: center; text-align: center; }
  .profile-stats-row { justify-content: center; }
  .settings-layout { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .dual-cta { flex-direction: column; }
  .hero-compact { padding: 120px 16px 32px; }
  .hero-compact h1 { font-size: 2.25rem; }
  .gallery-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .gallery-inject { padding: 20px; }
  .ba-slider { aspect-ratio: 4 / 3; }
  .ba-handle-knob { width: 36px; height: 36px; font-size: 0.65rem; }
}
@media (max-width: 480px) {
  .marketplace-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .marketplace-container { padding: 16px; }
  .hero-compact h1 { font-size: 1.75rem; }
}
