/* ==========================================================================
   eCampus Market — Product detail page
   All variables are scoped to .market-page (nothing is defined on :root, so
   it can't change fonts or colours anywhere else on the site).
   ========================================================================== */

.market-page {
  --market-blue: #1A56FF;
  --market-blue-deep: #0D3FD4;
  --market-blue-soft: #E8EFFF;
  --market-orange: #FF6B35;
  --market-navy: #0A0E1A;
  --market-gold: #F5B83D;
  --market-gold-deep: #D99A00;
  --market-success: #159A79;
  --market-paper: #F9FAFB;
  --market-card: #FFFFFF;
  --market-ink: #111827;
  --market-quiet: #6B7280;
  --market-faint: #9CA3AF;
  --market-border: #E5E7EB;
  --market-destructive: #DC2626;
  --market-font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --market-font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

@keyframes market-premium-sheen {
  0% { background-position: 180% 0; }
  100% { background-position: -180% 0; }
}

@keyframes market-soft-arrive {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.market-page {
  min-height: 100vh;
  background: var(--market-paper);
  color: var(--market-ink);
  font-family: var(--market-font-body);
}

.market-shell { width: min(1200px, calc(100% - 40px)); margin-inline: auto; }
.market-main { padding: 24px 0 64px; }

/* Breadcrumbs */
.market-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--market-quiet); font-size: 11px; }
.market-crumbs a { color: inherit; text-decoration: none; }
.market-crumbs a:hover { color: var(--market-blue); }
.market-crumbs-current { max-width: min(340px, 60vw); overflow: hidden; color: var(--market-ink); text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* Featured banner */
.market-featured-banner { display: flex; align-items: center; gap: 9px; min-height: 39px; padding: 8px 14px; margin-bottom: 17px; overflow: hidden; border-radius: 7px; color: var(--market-gold); background: linear-gradient(100deg, var(--market-navy), #1e293b); font-size: 11px; font-weight: 800; }
.market-featured-trust { margin-left: auto; color: #cbd5e1; font-size: 10px; font-weight: 500; }

/* Layout */
.market-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr); align-items: start; gap: 28px; }

/* Gallery */
.market-gallery { position: relative; padding: 6px; border: 1px solid var(--market-border); border-radius: 9px; background: var(--market-card); }
.market-featured .market-gallery { border: 1px solid var(--market-gold-deep); box-shadow: 0 0 0 3px rgba(245, 184, 61, 0.18), 0 12px 30px rgba(10, 14, 26, 0.15); }
.market-gallery-frame { position: relative; aspect-ratio: 1.24 / 1; overflow: hidden; border-radius: 6px; background: #f3f4f6; cursor: zoom-in; }
.market-gallery-image { width: 100%; height: 100%; display: none; object-fit: cover; }
.market-gallery-image.active { display: block; animation: market-soft-arrive 220ms ease both; }
.market-gallery-empty { display: grid; width: 100%; height: 100%; place-items: center; color: var(--market-quiet); font-size: 14px; text-align: center; }
.market-gallery-badge { position: absolute; top: 13px; left: 13px; display: inline-flex; align-items: center; gap: 6px; min-height: 31px; padding: 0 10px; border: 1px solid var(--market-border); border-radius: 5px; color: var(--market-ink); background: rgba(255, 255, 255, 0.92); font-size: 10px; font-weight: 800; }
.market-featured .market-gallery-badge { border-color: var(--market-gold); color: var(--market-navy); background: var(--market-gold); background-image: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%); background-size: 220% 100%; animation: market-premium-sheen 5s ease-in-out infinite; }
.market-gallery-counter { position: absolute; right: 12px; bottom: 12px; padding: 6px 9px; border-radius: 5px; color: #fff; background: rgba(10, 14, 26, 0.82); font-size: 10px; font-weight: 700; }
.market-gallery-expand { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.9); color: var(--market-ink); cursor: pointer; }
.market-gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--market-ink); background: rgba(255, 255, 255, 0.92); font-size: 24px; line-height: 1; cursor: pointer; }
.market-gallery-arrow-left { left: 12px; }
.market-gallery-arrow-right { right: 12px; }

.market-thumbnails { display: flex; gap: 8px; padding: 10px 2px 2px; overflow-x: auto; scrollbar-width: thin; }
.market-thumb { width: 68px; height: 58px; flex: 0 0 auto; padding: 2px; overflow: hidden; border: 1px solid var(--market-border); border-radius: 6px; background: var(--market-card); cursor: pointer; }
.market-thumb.active { border: 2px solid var(--market-blue); }
.market-featured .market-thumb.active { border-color: var(--market-gold-deep); }
.market-thumb img { width: 100%; height: 100%; border-radius: 3px; object-fit: cover; }
.market-mobile-dots { display: none; }

/* Summary sidebar (sticky sits below the site's fixed header) */
.market-summary { position: sticky; top: 7rem; min-width: 0; padding: 22px; border: 1px solid var(--market-border); border-radius: 9px; background: var(--market-card); box-shadow: 0 7px 25px rgba(17, 24, 39, 0.04); }
.market-featured .market-summary { border-color: var(--market-gold-deep); box-shadow: 0 0 0 2px rgba(245, 184, 61, 0.16), 0 14px 32px rgba(10, 14, 26, 0.12); }
.market-badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 13px; }
.market-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 4px 8px; border: 1px solid var(--market-border); border-radius: 4px; color: var(--market-quiet); background: var(--market-card); font-size: 10px; font-weight: 700; }
.market-chip-category { color: var(--market-blue-deep); background: var(--market-blue-soft); border-color: #cbdcfc; }
.market-chip-negotiable { color: var(--market-success); border-color: #a7f3d0; background: #ecfdf5; }
.market-chip-featured { color: var(--market-navy); border-color: var(--market-gold); background: #fef3c7; }
.market-chip-discount { color: var(--market-orange); border-color: #fed7aa; background: #fff7ed; }

.market-title { margin: 0; color: var(--market-ink); font-family: var(--market-font-display); font-size: 27px; line-height: 1.2; font-weight: 800; overflow-wrap: anywhere; }
.market-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; margin: 16px 0 12px; }
.market-price { color: var(--market-blue); font-family: var(--market-font-display); font-size: 30px; font-weight: 800; }
.market-featured .market-price { color: var(--market-gold-deep); }
.market-original-price { color: var(--market-faint); font-size: 13px; text-decoration: line-through; }
.market-summary-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; padding: 12px 0 15px; border-top: 1px solid var(--market-border); border-bottom: 1px solid var(--market-border); }
.market-meta-item { display: inline-flex; align-items: center; gap: 5px; color: var(--market-quiet); font-size: 10px; }

/* Buttons & actions */
.market-contact-title { margin: 16px 0 10px; font-size: 12px; font-weight: 800; }
.market-contact-actions { display: grid; gap: 8px; }
.market-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 6px; font-family: inherit; font-weight: 700; font-size: 12px; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background 150ms ease, transform 150ms ease; }
.market-btn:active { transform: scale(0.98); }
.market-btn-primary { background: var(--market-blue); color: #fff; }
.market-btn-primary:hover { background: var(--market-blue-deep); color: #fff; }
.market-featured .market-btn-primary { background: linear-gradient(110deg, var(--market-gold), var(--market-gold-deep)); color: var(--market-navy); border-color: var(--market-gold-deep); }
.market-featured .market-btn-primary:hover { background: linear-gradient(110deg, #ffc857, var(--market-gold-deep)); color: var(--market-navy); }
.market-btn-outline { border-color: var(--market-border); color: var(--market-ink); background: var(--market-card); }
.market-btn-outline:hover { color: var(--market-ink); border-color: var(--market-blue); }
.market-btn-destructive { background: var(--market-destructive); color: #fff; }

.market-secondary-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 7px; }
.market-contact-link { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--market-border); border-radius: 6px; color: var(--market-ink); text-decoration: none; font-size: 11px; font-weight: 700; background: var(--market-card); }
.market-contact-link:hover { border-color: var(--market-blue); color: var(--market-blue); }
.market-contact-whatsapp { color: #128C4A; border-color: #bbf7d0; background: #f0fdf4; }
.market-contact-whatsapp:hover { color: #0b6b37; border-color: #4ade80; }

.market-owner-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.market-summary-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.market-inline-form { margin: 0; }
.market-text-action { background: none; border: 0; padding: 4px 0; color: var(--market-quiet); font-family: inherit; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.market-text-action:hover { color: var(--market-blue); }
.market-text-action[data-saved="true"] { color: var(--market-orange); }

.market-safety { padding: 12px 13px; margin-top: 14px; border: 1px solid #fed7aa; border-radius: 7px; color: var(--market-ink); background: #fffaf5; }
.market-safety strong { display: block; margin-bottom: 2px; font-size: 11px; }
.market-safety p { margin: 0; color: var(--market-quiet); font-size: 10px; line-height: 1.5; }

/* Lower grid */
.market-lower-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr); gap: 28px; margin-top: 30px; }
.market-section { padding: 21px 0; border-top: 1px solid var(--market-border); }
.market-section:first-child { padding-top: 0; border-top: 0; }
.market-section-heading { margin: 0 0 13px; color: var(--market-ink); font-family: var(--market-font-display); font-size: 16px; font-weight: 750; }
.market-subheading { margin-top: 14px; font-size: 13px; }

.market-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.market-detail { padding: 12px; border: 1px solid var(--market-border); border-radius: 6px; background: var(--market-card); }
.market-detail dt { margin-bottom: 5px; color: var(--market-quiet); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.market-detail dd { margin: 0; color: var(--market-ink); font-size: 11px; font-weight: 750; }

.market-description { max-width: 75ch; margin: 0; color: var(--market-quiet); font-size: 12px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.market-description[data-collapsed="true"] { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.market-read-more { background: none; border: 0; padding: 0; margin-top: 7px; color: var(--market-blue); font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }

.market-tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.market-tag { padding: 6px 10px; border: 1px solid var(--market-border); border-radius: 4px; color: var(--market-blue-deep); background: var(--market-card); text-decoration: none; font-size: 10px; font-weight: 700; }
.market-tag:hover { background: var(--market-blue-soft); color: var(--market-blue-deep); }

/* Seller card */
.market-seller { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--market-border); border-radius: 7px; background: var(--market-card); }
.market-avatar { width: 45px; height: 45px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--market-blue); font-weight: 800; font-size: 15px; }
.market-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.market-seller-copy { min-width: 0; flex: 1; }
.market-seller-name { margin: 0; color: var(--market-ink); font-size: 12px; font-weight: 800; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.market-seller-user { margin: 2px 0 0; color: var(--market-quiet); font-size: 10px; }
.market-verified { color: var(--market-success); font-size: 9px; font-weight: 800; }
.market-seller-meta { margin: 3px 0 0; color: var(--market-quiet); font-size: 9px; }
.market-profile-link { color: var(--market-blue); text-decoration: none; font-size: 10px; font-weight: 750; white-space: nowrap; }

.market-seller-list { display: grid; gap: 9px; margin-top: 12px; }
.market-mini-listing { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.market-mini-image { width: 55px; height: 48px; flex: 0 0 auto; border-radius: 5px; object-fit: cover; background: #e5e7eb; }
.market-mini-copy { min-width: 0; }
.market-mini-title { display: block; overflow: hidden; color: var(--market-ink); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.market-mini-price { display: block; margin-top: 3px; color: var(--market-blue); font-size: 10px; font-weight: 800; }

/* Related listings */
.market-related { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--market-border); }
.market-related-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.market-related-all { color: var(--market-blue); text-decoration: none; font-size: 10px; font-weight: 750; }
.market-related-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.market-related-card { overflow: hidden; border: 1px solid var(--market-border); border-radius: 7px; background: var(--market-card); text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease; }
.market-related-card:hover { transform: translateY(-2px); box-shadow: 0 7px 18px rgba(17, 24, 39, 0.08); }
.market-related-card img { width: 100%; aspect-ratio: 1.4 / 1; display: block; object-fit: cover; background: #e5e7eb; }
.market-related-copy { padding: 10px; }
.market-related-title { display: block; overflow: hidden; color: var(--market-ink); font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.market-related-price { display: block; margin-top: 4px; color: var(--market-blue); font-size: 11px; font-weight: 800; }
.market-related-place { display: block; margin-top: 4px; color: var(--market-quiet); font-size: 9px; }

/* Share */
.market-share { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 0; margin-top: 22px; border-top: 1px solid var(--market-border); }
.market-share-copy { margin: 4px 0 0; color: var(--market-quiet); font-size: 11px; overflow-wrap: anywhere; }
.market-share-list { display: flex; flex-wrap: wrap; gap: 7px; }
.market-share-link { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--market-border); border-radius: 6px; color: var(--market-ink); background: var(--market-card); font-family: inherit; text-decoration: none; font-size: 10px; font-weight: 700; cursor: pointer; }
.market-share-link:hover { border-color: var(--market-blue); color: var(--market-blue); }

/* Removed banner */
.market-removed { padding: 28px; border: 1px solid #fca5a5; border-radius: 8px; background: var(--market-card); }
.market-removed-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 50%; color: var(--market-destructive); background: #fee2e2; margin-bottom: 14px; }
.market-removed-title { margin: 0; font-family: var(--market-font-display); font-size: 22px; }
.market-removed-copy { margin: 8px 0 16px; color: var(--market-quiet); font-size: 12px; }
.market-removed-reason { padding: 12px; margin: 12px 0; border-left: 3px solid var(--market-orange); background: #fff7ed; font-size: 11px; }
.market-removed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.market-removed-actions form { margin: 0; }

/* Modals */
.market-modal-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.7); display: grid; place-items: center; padding: 16px; }
.market-modal-close { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--market-quiet); cursor: pointer; }
.market-report-dialog { width: min(480px, 100%); max-height: 92vh; overflow-y: auto; background: var(--market-card); border-radius: 8px; padding: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); font-family: var(--market-font-body); }
.market-report-head { display: flex; justify-content: space-between; align-items: center; }
.market-report-sub { margin: 4px 0 0; color: var(--market-quiet); font-size: 11px; }
.market-form-label { display: block; margin: 12px 0 6px; font-size: 11px; font-weight: 700; }
.market-form-control { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--market-border); border-radius: 5px; font-family: var(--market-font-body); font-size: 16px; box-sizing: border-box; }
.market-form-control:focus { outline: 2px solid var(--market-blue); outline-offset: 1px; }
.market-form-control-textarea { min-height: 90px; resize: vertical; }
.market-form-note { margin: 4px 0 0; color: var(--market-quiet); font-size: 10px; }
.market-report-warning { padding: 10px; margin-top: 12px; border-radius: 5px; color: var(--market-orange); background: #fff7ed; font-size: 10px; }
.market-report-status { margin-top: 10px; padding: 9px 10px; border-radius: 5px; font-size: 11px; }
.market-report-status.is-success { color: #0b6b37; background: #f0fdf4; }
.market-report-status.is-error { color: var(--market-destructive); background: #fef2f2; }
.market-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Lightbox */
.market-lightbox-dialog { position: relative; width: min(94vw, 1000px); }
.market-lightbox-close { position: absolute; top: -38px; right: 0; color: #fff; font-size: 32px; }
.market-lightbox-stage { min-height: 60vh; max-height: 75vh; display: grid; place-items: center; background: #000; border-radius: 6px; overflow: hidden; }
.market-lightbox-stage img { max-width: 100%; max-height: 75vh; object-fit: contain; }
.market-lightbox-controls { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 12px; color: #fff; font-size: 12px; }

/* Responsive */
@media (max-width: 800px) {
  .market-layout { grid-template-columns: 1fr; gap: 18px; }
  .market-summary { position: static; padding: 16px; }
  .market-lower-grid { grid-template-columns: 1fr; gap: 0; }
  .market-detail-grid { grid-template-columns: repeat(2, 1fr); }
  .market-related-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(150px, 44%); overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .market-related-list::-webkit-scrollbar { display: none; }
  .market-share { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .market-shell { width: calc(100% - 28px); }
  .market-featured-trust { display: none; }
  .market-gallery-frame { aspect-ratio: 1.05 / 1; }
  .market-gallery-arrow { display: none; }
  .market-thumbnails { display: none; }
  .market-mobile-dots { display: flex; justify-content: center; gap: 5px; padding: 9px 0 2px; }
  .market-mobile-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--market-border); border: 0; padding: 0; }
  .market-mobile-dot.active { width: 18px; border-radius: 5px; background: var(--market-blue); }
  .market-featured .market-mobile-dot.active { background: var(--market-gold-deep); }
  .market-title { font-size: 22px; }
  .market-price { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .market-featured .market-gallery-badge, .market-gallery-image.active { animation: none; }
  .market-related-card, .market-btn { transition: none; }
}

/* Pop-ups (report form + photo viewer) live outside .market-page, so they need the colours too */
.market-modal-overlay {
  --market-blue: #1A56FF;
  --market-blue-deep: #0D3FD4;
  --market-blue-soft: #E8EFFF;
  --market-orange: #FF6B35;
  --market-navy: #0A0E1A;
  --market-gold: #F5B83D;
  --market-gold-deep: #D99A00;
  --market-success: #159A79;
  --market-paper: #F9FAFB;
  --market-card: #FFFFFF;
  --market-ink: #111827;
  --market-quiet: #6B7280;
  --market-faint: #9CA3AF;
  --market-border: #E5E7EB;
  --market-destructive: #DC2626;
  --market-font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --market-font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.market-report-dialog { color: var(--market-ink); }
.market-form-control { color: var(--market-ink); background: var(--market-card); }