/* Course Manager Pro — Catalog CSS
   Design mirrors the approved catalog layout (sticky filter bar,
   category-grouped sections, badge/chip course cards). Colors flow
   in via CSS variables set inline on .cm-catalog-wrap from the
   "Course Page Design" admin settings, so this adapts to any theme. */

.cm-catalog-wrap{
  font-family:var(--cm-font,inherit);
  color:#0f172a;
  max-width:1200px;
  margin-left:auto;
  margin-right:auto;
  width:100%;
  box-sizing:border-box;
}
.cm-catalog-wrap *{box-sizing:border-box}

.cm-catalog-title{
  font-size:clamp(22px,3vw,32px);
  font-weight:800;
  margin:0 0 24px;
  letter-spacing:-.5px;
  color:#0f172a;
  font-family:inherit;
}
.cm-back-link{margin:0 auto 20px;max-width:1100px;width:100%;box-sizing:border-box}
.cm-back-link a{
  display:inline-flex;align-items:center;gap:6px;
  font-size:13px;font-weight:700;text-decoration:none !important;
  color:var(--cm-accent,#1e40af) !important;font-family:inherit;
}
.cm-back-link a:hover{text-decoration:underline !important}

/* ── Hero banner ────────────────────────────────── */
.cm-hero{
  background:var(--cm-hero-bg,#0f172a);
  border-radius:var(--cm-radius,14px);
  padding:56px 40px;text-align:center;
  position:relative;overflow:hidden;margin-bottom:36px;
}
.cm-hero::before{
  content:'';position:absolute;inset:0;
  background:radial-gradient(ellipse 55% 65% at 50% 0%, var(--cm-accent,#1e40af) 0%, transparent 65%);
  opacity:.25;
}
.cm-hero-inner{position:relative;z-index:2;max-width:640px;margin:0 auto}
.cm-hero-eyebrow{
  display:inline-flex;align-items:center;gap:8px;
  background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);
  border-radius:100px;padding:6px 16px;margin-bottom:20px;
  font-size:11px;font-weight:700;color:var(--cm-hero-text,#fff);
  letter-spacing:.1em;text-transform:uppercase;font-family:inherit;
}
.cm-hero-title{
  font-family:inherit;font-size:clamp(26px,4vw,42px);font-weight:800;
  color:var(--cm-hero-text,#fff);line-height:1.15;margin:0 0 14px;
}
.cm-hero-desc{
  font-size:15px;color:var(--cm-hero-text,#fff);opacity:.65;
  line-height:1.7;max-width:480px;margin:0 auto 32px;
}
.cm-hero-stats{
  display:flex;justify-content:center;
  background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);
  border-radius:14px;overflow:hidden;max-width:520px;margin:0 auto;
}
.cm-hero-stat{flex:1;padding:16px 12px;text-align:center;border-right:1px solid rgba(255,255,255,.08)}
.cm-hero-stat:last-child{border-right:none}
.cm-hero-stat-val{font-family:inherit;font-size:21px;font-weight:800;color:var(--cm-hero-text,#fff)}
.cm-hero-stat-label{font-size:10.5px;color:var(--cm-hero-text,#fff);opacity:.5;margin-top:3px}

@media (max-width:640px){
  .cm-hero{padding:40px 20px}
  .cm-hero-stats{flex-wrap:wrap}
  .cm-hero-stat{flex:1 1 45%;border-bottom:1px solid rgba(255,255,255,.08)}
}

/* ── Sticky filter bar ─────────────────────────── */
.cm-filter-bar{
  display:flex;gap:8px;flex-wrap:wrap;align-items:center;
  margin-bottom:32px;padding:14px 16px;
  background:#f8fafc;
  border:1px solid var(--cm-section-border,#e2e8f0);
  border-radius:14px;
  position:sticky;top:10px;z-index:20;
}
.cm-filter-btn{
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 16px;border-radius:100px;
  font-size:13px;font-weight:700;cursor:pointer;
  border:1.5px solid var(--cm-section-border,#e2e8f0);
  color:#475569;background:#fff;white-space:nowrap;
  transition:.15s;font-family:inherit;
}
.cm-filter-btn:hover{border-color:var(--cm-accent,#1e40af);color:var(--cm-accent,#1e40af)}
.cm-filter-btn.active{
  background:var(--cm-accent,#1e40af);
  color:var(--cm-btn-text,#fff);
  border-color:var(--cm-accent,#1e40af);
}
.cm-filter-btn .cm-count{font-size:11px;opacity:.75}
.cm-search-input{
  flex:1;min-width:160px;max-width:280px;margin-left:auto;
  padding:9px 16px;border:1.5px solid var(--cm-section-border,#e2e8f0);
  border-radius:100px;font-size:13px;font-family:inherit;
  outline:none;color:#0f172a;background:#fff;
}
.cm-search-input:focus{border-color:var(--cm-accent,#1e40af)}

/* ── Category sections ─────────────────────────── */
.cm-cat-section{margin-bottom:52px}
.cm-cat-section:last-of-type{margin-bottom:8px}
.cm-cat-header{display:flex;align-items:center;gap:16px;margin-bottom:22px}
.cm-cat-icon{
  width:44px;height:44px;border-radius:12px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;font-size:20px;
}
.cm-cat-heading{min-width:0}
.cm-cat-eyebrow{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.1em;margin-bottom:2px}
.cm-cat-name{font-size:19px;font-weight:800;color:#0f172a;font-family:inherit;line-height:1.2}
.cm-cat-divider{flex:1;height:1px;background:var(--cm-section-border,#e2e8f0)}
.cm-cat-count{font-size:12px;font-weight:700;color:#64748b;white-space:nowrap}

/* ── Grid + card ────────────────────────────────── */
.cm-courses-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
@media (max-width:900px){ .cm-courses-grid{grid-template-columns:repeat(2,1fr)} }
@media (max-width:640px){ .cm-courses-grid{grid-template-columns:1fr} }
.cm-course-card{
  background:var(--cm-section-bg,#fff);
  border:1px solid var(--cm-section-border,#e2e8f0);
  border-radius:var(--cm-radius,14px);
  overflow:hidden;display:flex;flex-direction:column;
  transition:transform .2s,box-shadow .2s,border-color .2s;
}
.cm-course-card:hover{transform:translateY(-4px);box-shadow:0 14px 36px rgba(15,23,42,.12)}

.cm-course-thumb{
  position:relative;height:148px;
  display:flex;align-items:center;justify-content:center;
  font-size:44px;background-size:cover;background-position:center;
}
.cm-thumb-badge{
  position:absolute;top:12px;left:12px;
  padding:4px 10px;border-radius:7px;color:#fff;
  font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;
}
.cm-duration-badge{
  position:absolute;top:12px;right:12px;
  background:rgba(15,23,42,.55);border-radius:7px;padding:4px 10px;
  font-size:11px;font-weight:700;color:#fff;
}

.cm-course-body{padding:18px 20px;flex:1}
.cm-course-cat-label{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;margin-bottom:6px}
.cm-course-title{font-size:16px;font-weight:800;color:#0f172a;margin-bottom:7px;line-height:1.35}
.cm-course-title a{color:inherit !important;text-decoration:none !important}
.cm-course-title a:hover{color:var(--cm-accent,#1e40af) !important}
.cm-course-desc{font-size:13px;color:#64748b;line-height:1.6;margin-bottom:14px}
.cm-course-chips{display:flex;gap:6px;flex-wrap:wrap}
.cm-chip{
  font-size:11px;font-weight:600;padding:3px 10px;border-radius:6px;
  background:var(--cm-highlight-bg,#f8fafc);color:#475569;
  border:1px solid var(--cm-section-border,#e2e8f0);
}

.cm-course-footer{
  padding:14px 20px;border-top:1px solid var(--cm-section-border,#e2e8f0);
  display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;
}
.cm-course-meta{display:flex;gap:12px;flex-wrap:wrap}
.cm-meta-item{font-size:11.5px;color:#64748b;font-weight:700;display:inline-flex;align-items:center;gap:4px}
.cm-course-enroll{
  display:inline-flex;align-items:center;gap:5px;
  font-size:13px;font-weight:800;
  text-decoration:none !important;white-space:nowrap;transition:gap .15s;
  background:none;border:none;padding:0;cursor:pointer;font-family:inherit;
  color:var(--cm-btn-color,var(--cm-accent,#1e40af)) !important;
}
.cm-course-enroll:hover{gap:9px;color:var(--cm-btn-color,var(--cm-accent,#1e40af)) !important}

/* ── Featured spotlight card (first card per category) ─ */
.cm-course-card-featured{
  grid-column:span 2;
  flex-direction:row;
}
@media (max-width:900px){ .cm-course-card-featured{grid-column:span 2} }
@media (max-width:640px){ .cm-course-card-featured{grid-column:span 1;flex-direction:column} }

.cm-featured-media{
  position:relative;width:38%;min-width:200px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  background-size:cover;background-position:center;
}
@media (max-width:640px){ .cm-featured-media{width:100%;height:170px} }
.cm-featured-icon{font-size:56px;opacity:.9}
.cm-featured-ribbon{
  position:absolute;top:14px;left:14px;
  padding:5px 12px;border-radius:7px;color:#fff;
  font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;
}
.cm-featured-body{padding:22px 26px;display:flex;flex-direction:column;flex:1;min-width:0}
.cm-featured-title{font-size:20px;font-weight:800;color:#0f172a;margin-bottom:8px;line-height:1.3}
.cm-featured-title a{color:inherit !important;text-decoration:none !important}
.cm-featured-title a:hover{color:var(--cm-accent,#1e40af) !important}
.cm-featured-body .cm-course-desc{margin-bottom:16px}
.cm-featured-body .cm-course-chips{margin-bottom:18px}
.cm-featured-body .cm-course-footer{
  margin-top:auto;padding:16px 0 0;border-top:1px solid var(--cm-section-border,#e2e8f0);
  background:none;
}

/* ── Slider ─────────────────────────────────────── */
.cm-slider-wrap{overflow:hidden}
.cm-slider-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.cm-slider-nav{display:flex;gap:8px;flex-shrink:0}
.cm-slider-arrow{
  width:38px;height:38px;border-radius:100px;flex-shrink:0;
  border:1.5px solid var(--cm-section-border,#e2e8f0);background:#fff;
  color:#334155;font-size:20px;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:.15s;
}
.cm-slider-arrow:hover{background:var(--cm-accent,#1e40af);color:#fff;border-color:var(--cm-accent,#1e40af)}
.cm-slider-track{
  display:flex;gap:20px;overflow-x:auto;scroll-snap-type:x proximity;
  padding-bottom:6px;scrollbar-width:none;
}
.cm-slider-track::-webkit-scrollbar{display:none}
.cm-slider-item{flex:0 0 300px;scroll-snap-align:start}
.cm-slider-item .cm-course-card{height:100%}
@media (max-width:480px){ .cm-slider-item{flex-basis:82vw} }

/* ── Empty states ───────────────────────────────── */
.cm-no-course{text-align:center;padding:48px;color:#64748b;font-size:15px}
.cm-empty-state{display:none;text-align:center;padding:56px 20px;color:#64748b;font-size:14px}
.cm-empty-state.show{display:block}

@media (max-width:640px){
  .cm-filter-bar{position:static}
  .cm-search-input{margin-left:0;max-width:100%}
}
