:root {
  --blue:       #1e3a8a;
  --blue-dark:  #1e2d6b;
  --blue-light: #dbeafe;
  --orange:     #f97316;
  --orange-dark:#ea6c0a;
  --bg:         #f9fafb;
  --white:      #ffffff;
  --text:       #111827;
  --muted:      #6b7280;
  --border:     #e5e7eb;
  --green:      #10b981;
  --red:        #ef4444;
  --radius:     8px;
  --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --font:       system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout ── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ── Header ── */
.site-header {
  background: var(--blue);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  flex-shrink: 0;
}
.logo span { color: var(--orange); }

.search-bar {
  flex: 1;
  max-width: 480px;
  display: flex;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--text);
}
.search-bar button {
  background: var(--orange);
  color: var(--white);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background .15s;
}
.search-bar button:hover { background: var(--orange-dark); }

.header-nav { display: flex; gap: 4px; margin-left: auto; }
.header-nav a {
  color: rgba(255,255,255,.85);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all .15s;
}
.header-nav a:hover { color: var(--white); background: rgba(255,255,255,.1); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--blue) 0%, #2563eb 100%);
  color: var(--white);
  text-align: center;
  padding: 48px 16px;
}
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 12px; }
.hero p  { font-size: 1rem; color: rgba(255,255,255,.8); max-width: 520px; margin: 0 auto 24px; }
.hero-search {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 20px;
  font-size: 1rem;
  color: var(--text);
}
.hero-search button {
  background: var(--orange);
  color: var(--white);
  padding: 14px 28px;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 0 50px 50px 0;
  transition: background .15s;
}
.hero-search button:hover { background: var(--orange-dark); }

/* ── Section ── */
.section { padding: 40px 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-title { font-size: 1.375rem; font-weight: 700; color: var(--text); }
.view-all {
  font-size: 0.875rem;
  color: var(--blue);
  font-weight: 600;
}
.view-all:hover { text-decoration: underline; }

/* ── Category chips ── */
.category-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover, .chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.chip .count {
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 50px;
}
.chip.active .count, .chip:hover .count {
  background: rgba(255,255,255,.2);
  color: var(--white);
}

/* ── Course grid ── */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ── Pagination / Load more ── */
.load-more-wrap { text-align: center; margin-top: 36px; }

/* ── Page header (category/search) ── */
.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-header p  { color: var(--muted); margin-top: 4px; font-size: 0.9rem; }

/* ── Filters bar ── */
.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.filter-label { font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--blue); }
.result-count { margin-left: auto; font-size: 0.875rem; color: var(--muted); }

/* ── Course detail ── */
.course-detail {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
  padding: 40px 0;
}
.course-detail .breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.course-detail .breadcrumb a { color: var(--blue); }
.course-detail .breadcrumb a:hover { text-decoration: underline; }
.course-detail h1 { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 800; margin-bottom: 12px; }
.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.course-meta span { display: flex; align-items: center; gap: 4px; }
.course-description { font-size: 0.9rem; line-height: 1.75; color: var(--text); }
.course-description p { margin-bottom: 12px; }

.course-sidebar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 72px;
  overflow: hidden;
}
.course-sidebar img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.sidebar-body { padding: 20px; }
.price-block { margin-bottom: 16px; }
.price-free { font-size: 1.75rem; font-weight: 800; color: var(--green); }
.price-original { font-size: 0.9rem; color: var(--muted); text-decoration: line-through; }
.price-discount { font-size: 0.8rem; color: var(--orange); font-weight: 700; margin-left: 6px; }

/* ── Footer ── */
.site-footer {
  margin-top: auto;
  background: var(--blue-dark);
  color: rgba(255,255,255,.7);
  padding: 40px 0 20px;
  font-size: 0.8rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col h4 { color: var(--white); font-size: 0.875rem; font-weight: 600; margin-bottom: 12px; }
.footer-col a  { display: block; margin-bottom: 8px; color: rgba(255,255,255,.6); }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── States ── */
.empty-state {
  text-align: center;
  padding: 64px 16px;
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .course-detail { grid-template-columns: 1fr; }
  .course-sidebar { position: static; }
  .hero { padding: 32px 16px; }
}
@media (max-width: 480px) {
  .search-bar { display: none; }
  .course-grid { grid-template-columns: 1fr; }
}
