/* ══════════════════════════════════════════════════════════════════════
   ChloeZ Marketplace — marketplace.css
   Loaded alongside index.css (course cards, tooltip hover-preview, nav,
   footer — all reused verbatim, same classes, same JS interaction ported
   from assets/js/index.js) and about.css (mobile nav drawer). Everything
   in THIS file is new to the marketplace page specifically: the hero
   search, filter bar, results grid wrapper, and the fullscreen overlay.
   Uses the exact same design tokens as index.css/about.css/admin.css —
   no new colors introduced.
   ══════════════════════════════════════════════════════════════════════ */

.nav-links a.active { color: var(--black); font-weight: 700; }
.nav-links a.active::after { content: ''; display: block; height: 2px; background: var(--black); margin-top: 4px; border-radius: 2px; }

/* ── HERO ─────────────────────────────────────────────────────────────*/
.mkt-hero { padding: 4.5rem 0 3rem; text-align: center; background: linear-gradient(180deg, var(--g05) 0%, var(--white) 100%); border-bottom: 1px solid var(--border); }
.mkt-hero-title { font-size: clamp(1.8rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.mkt-hero-sub { color: var(--g6); font-size: 1.02rem; max-width: 560px; margin: 0 auto 1.75rem; }
.mkt-search { max-width: 620px; margin: 0 auto; position: relative; display: flex; align-items: center; background: var(--white); border: 1.5px solid var(--border-d); border-radius: 999px; padding: 0.2rem 0.4rem 0.2rem 1.1rem; box-shadow: 0 8px 24px rgba(0,0,0,.06); transition: border-color .15s, box-shadow .15s; }
.mkt-search:focus-within { border-color: var(--black); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
.mkt-search .ic { color: var(--g5); flex-shrink: 0; }
.mkt-search input { flex: 1; border: none; outline: none; padding: 0.85rem 0.8rem; font-family: var(--f); font-size: 0.95rem; background: transparent; }

/* ── FILTER BAR — sticky under the nav ───────────────────────────────*/
.mkt-filterbar { position: sticky; top: 0; z-index: 40; background: var(--white); border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.mkt-filterbar-inner { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 0; flex-wrap: wrap; }
.mkt-cat-pills { display: flex; gap: 0.5rem; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.mkt-cat-pills::-webkit-scrollbar { display: none; }
.mkt-pill { flex-shrink: 0; border: 1px solid var(--border); background: var(--white); color: var(--g6); border-radius: 999px; padding: 0.45rem 0.9rem; font-size: 0.82rem; font-weight: 600; white-space: nowrap; transition: all .15s; }
.mkt-pill span { color: var(--g4); font-weight: 500; margin-left: 0.2rem; }
.mkt-pill:hover { border-color: var(--border-d); background: var(--g05); }
.mkt-pill.active { background: var(--black); border-color: var(--black); color: var(--white); }
.mkt-pill.active span { color: var(--g4); }
.mkt-selects { display: flex; gap: 0.5rem; flex-shrink: 0; }
.mkt-select { border: 1px solid var(--border); border-radius: var(--rl); padding: 0.45rem 0.7rem; font-family: var(--f); font-size: 0.8rem; background: var(--white); color: var(--black); cursor: pointer; }

/* ── RESULTS ──────────────────────────────────────────────────────────*/
.mkt-results { padding: 2rem 0 5rem; }
.mkt-results-head { margin-bottom: 1.25rem; }
.mkt-results-count { font-size: 0.85rem; color: var(--g5); }
.mkt-grid { grid-template-columns: repeat(4, 1fr); }
.mkt-grid .c-wrap { width: auto; }
@media (max-width: 1100px) { .mkt-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .mkt-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .mkt-grid { grid-template-columns: 1fr; } }

.mkt-empty { text-align: center; padding: 4rem 1rem; color: var(--g5); }
.mkt-empty .ic { width: 40px; height: 40px; margin-bottom: 1rem; opacity: 0.4; }
.mkt-empty h3 { color: var(--black); font-size: 1.1rem; margin-bottom: 0.4rem; }
.mkt-empty p { margin-bottom: 1.2rem; font-size: 0.88rem; }

.mkt-pagination { display: flex; justify-content: center; gap: 0.4rem; margin-top: 2.5rem; }
.mkt-page-btn { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--rl); background: var(--white); font-size: 0.85rem; font-weight: 600; color: var(--g6); }
.mkt-page-btn.active { background: var(--black); border-color: var(--black); color: var(--white); }
.mkt-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Card skeleton while loading */
.mkt-skel { border: 1px solid var(--border); border-radius: var(--rl); overflow: hidden; background: var(--white); }
.mkt-skel-thumb { height: 140px; background: linear-gradient(90deg, var(--g1) 25%, var(--g2) 37%, var(--g1) 63%); background-size: 400% 100%; animation: mktShimmer 1.4s ease infinite; }
.mkt-skel-line { height: 10px; margin: 0.9rem 0.9rem 0; border-radius: 3px; background: linear-gradient(90deg, var(--g1) 25%, var(--g2) 37%, var(--g1) 63%); background-size: 400% 100%; animation: mktShimmer 1.4s ease infinite; }
.mkt-skel-line.w60 { width: 60%; } .mkt-skel-line.w40 { width: 40%; margin-bottom: 0.9rem; }
@keyframes mktShimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ══════════════════════════════════════════════════════════════════════
   FULLSCREEN COURSE OVERLAY
   ══════════════════════════════════════════════════════════════════════ */
.mkt-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(10,10,10,.6); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; overflow-y: auto; }
.mkt-overlay.open { opacity: 1; visibility: visible; }
body.mkt-lock { overflow: hidden; }

.mkt-overlay-scroll { min-height: 100%; display: flex; justify-content: center; padding: 2.5rem 1rem 4rem; }
.mkt-overlay-close { position: fixed; top: 1.25rem; right: 1.5rem; z-index: 310; width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--white); box-shadow: 0 4px 16px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; }

.mkt-overlay-body { background: var(--white); border-radius: var(--rxx); width: min(1080px, 100%); max-height: none; box-shadow: 0 30px 80px rgba(0,0,0,.35); transform: translateY(16px) scale(.98); opacity: 0; transition: transform .3s ease, opacity .3s ease; }
.mkt-overlay.open .mkt-overlay-body { transform: none; opacity: 1; }
.mkt-overlay-loading { display: flex; align-items: center; justify-content: center; min-height: 400px; }

/* ── Video / thumbnail header ─────────────────────────────────────────*/
.mkt-ov-media { position: relative; width: 100%; aspect-ratio: 16/7.2; background: var(--black); border-radius: var(--rxx) var(--rxx) 0 0; overflow: hidden; }
.mkt-ov-media img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.mkt-ov-media video { width: 100%; height: 100%; object-fit: contain; background: var(--black); display: none; }
.mkt-ov-media.playing img { display: none; }
.mkt-ov-media.playing video { display: block; }
.mkt-ov-play { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; background: linear-gradient(0deg, rgba(0,0,0,.55), rgba(0,0,0,.15)); border: none; cursor: pointer; color: var(--white); }
.mkt-ov-media.playing .mkt-ov-play { display: none; }
.mkt-ov-play-btn { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.95); display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.mkt-ov-play:hover .mkt-ov-play-btn { transform: scale(1.08); }
.mkt-ov-play-btn svg { width: 24px; height: 24px; fill: var(--black); margin-left: 3px; }
.mkt-ov-play-label { font-size: 0.85rem; font-weight: 600; }
.mkt-ov-noPreview { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--g4); font-size: 0.85rem; }

/* ── Layout: main content + sticky purchase card ──────────────────────*/
.mkt-ov-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; padding: 2rem 2.25rem 2.5rem; }
@media (max-width: 860px) { .mkt-ov-layout { grid-template-columns: 1fr; padding: 1.5rem 1.25rem 2rem; } }

.mkt-ov-cat { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--g5); background: var(--g1); padding: 0.25rem 0.6rem; border-radius: var(--r); margin-bottom: 0.7rem; }
.mkt-ov-title { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 0.5rem; }
.mkt-ov-subtitle { color: var(--g6); font-size: 1rem; margin-bottom: 0.9rem; }
.mkt-ov-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; font-size: 0.85rem; color: var(--g6); margin-bottom: 1.4rem; }
.mkt-ov-stats .stars { color: #d97706; display: inline-flex; align-items: center; gap: 2px; }
.mkt-ov-stats strong { color: var(--black); }
.mkt-ov-instr { display: flex; align-items: center; gap: 0.7rem; padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 1.75rem; }
.mkt-ov-instr-av { width: 44px; height: 44px; border-radius: 50%; background: var(--g1); object-fit: cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--g6); }
.mkt-ov-instr-name { font-weight: 700; font-size: 0.92rem; }
.mkt-ov-instr-role { font-size: 0.78rem; color: var(--g5); }

.mkt-ov-section { margin-bottom: 2rem; }
.mkt-ov-h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.9rem; }
.mkt-ov-desc { font-size: 0.92rem; line-height: 1.7; color: var(--g7); white-space: pre-line; }

.mkt-ov-outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.2rem; background: var(--g05); border-radius: var(--rl); padding: 1.2rem; }
@media (max-width: 540px) { .mkt-ov-outcomes { grid-template-columns: 1fr; } }
.mkt-ov-outcome { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.85rem; line-height: 1.5; }
.mkt-ov-outcome svg { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; margin-top: 2px; }

/* Curriculum accordion */
.mkt-curr-section { border: 1px solid var(--border); border-radius: var(--rl); margin-bottom: 0.6rem; overflow: hidden; }
.mkt-curr-head { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.1rem; background: var(--g05); border: none; font-weight: 700; font-size: 0.88rem; cursor: pointer; }
.mkt-curr-head .cnt { font-weight: 500; color: var(--g5); font-size: 0.78rem; margin-left: 0.5rem; }
.mkt-curr-head svg { width: 16px; height: 16px; transition: transform .2s; color: var(--g5); flex-shrink: 0; }
.mkt-curr-section.open .mkt-curr-head svg { transform: rotate(180deg); }
.mkt-curr-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.mkt-curr-section.open .mkt-curr-body { max-height: 1000px; }
.mkt-curr-lesson { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 1.1rem; font-size: 0.82rem; color: var(--g6); border-top: 1px solid var(--border); }
.mkt-curr-lesson svg { width: 15px; height: 15px; color: var(--g4); flex-shrink: 0; }
.mkt-curr-lesson .dur { margin-left: auto; color: var(--g4); flex-shrink: 0; }
.mkt-curr-lesson.preview { color: var(--black); cursor: pointer; }
.mkt-curr-lesson.preview:hover { background: var(--g05); }
.mkt-curr-preview-badge { font-size: 0.68rem; font-weight: 700; color: var(--blue); background: var(--blue-l); padding: 0.1rem 0.4rem; border-radius: var(--r); text-transform: uppercase; letter-spacing: .03em; }

/* Reviews */
.mkt-rating-summary { display: flex; gap: 2rem; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.mkt-rating-big { text-align: center; }
.mkt-rating-big .num { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.mkt-rating-big .stars { color: #d97706; margin: 0.4rem 0; }
.mkt-rating-big .cnt { font-size: 0.78rem; color: var(--g5); }
.mkt-rating-bars { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 0.3rem; }
.mkt-rating-bar-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.76rem; color: var(--g5); }
.mkt-rating-bar-row .track { flex: 1; height: 6px; border-radius: 999px; background: var(--g1); overflow: hidden; }
.mkt-rating-bar-row .fill { height: 100%; background: #d97706; }

.mkt-review { display: flex; gap: 0.8rem; padding: 1rem 0; border-top: 1px solid var(--border); }
.mkt-review-av { width: 38px; height: 38px; border-radius: 50%; background: var(--g1); object-fit: cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.78rem; color: var(--g6); }
.mkt-review-name { font-weight: 700; font-size: 0.85rem; }
.mkt-review-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.74rem; color: var(--g5); margin: 0.15rem 0 0.4rem; }
.mkt-review-meta .stars { color: #d97706; }
.mkt-review-text { font-size: 0.85rem; line-height: 1.6; color: var(--g7); }

/* ── Sticky purchase card ─────────────────────────────────────────────*/
.mkt-ov-buy { position: sticky; top: 1.5rem; align-self: start; border: 1px solid var(--border); border-radius: var(--rx); padding: 1.4rem; box-shadow: 0 12px 32px rgba(0,0,0,.08); }
.mkt-ov-price-row { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.3rem; }
.mkt-ov-price { font-size: 1.9rem; font-weight: 800; }
.mkt-ov-price-old { font-size: 1rem; color: var(--g4); text-decoration: line-through; }
.mkt-ov-free-badge { display: inline-block; background: var(--green-l); color: var(--green); font-weight: 700; font-size: 0.78rem; padding: 0.2rem 0.6rem; border-radius: var(--r); margin-bottom: 0.9rem; }
.mkt-ov-buy-btn { width: 100%; background: var(--black); color: var(--white); border: none; border-radius: var(--rl); padding: 0.85rem; font-weight: 700; font-size: 0.92rem; margin: 0.9rem 0 0.6rem; transition: opacity .15s; }
.mkt-ov-buy-btn:hover { opacity: 0.88; }
.mkt-ov-buy-hint { font-size: 0.74rem; color: var(--g5); text-align: center; margin-bottom: 1.1rem; }
.mkt-ov-includes { display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.82rem; color: var(--g6); padding-top: 1rem; border-top: 1px solid var(--border); }
.mkt-ov-includes div { display: flex; align-items: center; gap: 0.55rem; }
.mkt-ov-includes svg { width: 16px; height: 16px; color: var(--g5); flex-shrink: 0; }

@media (max-width: 860px) {
  .mkt-ov-buy { position: static; box-shadow: none; border: 1px solid var(--border); }
}
