:root {
  --accent: #1f8a6f;
  --accent-ink: oklch(99% 0.004 160);
  --bg: oklch(98.5% 0.004 160);
  --surface: oklch(100% 0 0);
  --ink: oklch(22% 0.015 160);
  --muted: oklch(50% 0.01 160);
  --muted-2: oklch(48% 0.01 160);
  --line: oklch(90% 0.008 160);
  --line-soft: oklch(92% 0.008 160);
  --input-border: oklch(88% 0.008 160);
  --placeholder: oklch(60% 0.01 160);
  --slot-bg: oklch(95% 0.006 160);
  --slot-border: oklch(82% 0.01 160);
  --slot-text: oklch(55% 0.01 160);
  --shadow: 0 8px 24px oklch(20% 0.02 160 / 0.08);
  --radius: 12px;
  --font-display: "Sora", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --max: 1160px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

::placeholder {
  color: var(--placeholder);
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
}

.wrap {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* —— Header (exact canvas) —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: oklch(98.5% 0.004 160 / 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  padding-top: 16px;
  padding-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.search {
  flex: 1;
  min-width: 200px;
}

.search input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.search input:focus {
  border-color: var(--accent);
}

.results-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* —— Hero —— */
.hero {
  padding: 56px 24px 24px;
  width: min(var(--max), 100%);
  margin: 0 auto;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
  max-width: 680px;
}

.hero p {
  font-size: 16px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.6;
  margin: 0;
}

/* —— Filters —— */
.filters {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 0 24px 16px;
}

.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--input-border);
  background: var(--surface);
  color: oklch(35% 0.01 160);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pill:hover {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--input-border));
}

.pill.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* —— Catalog —— */
.catalog {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 16px 24px 80px;
  flex: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
  font: inherit;
  padding: 0;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* Image-slot style cover (from Design Canvas) */
.cover-slot {
  height: auto;
  aspect-ratio: 16 / 9;
  position: relative;
  background: oklch(95.5% 0.005 160);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cover-slot.has-image {
  aspect-ratio: auto;
  height: auto;
  background: oklch(96% 0.006 160);
}

.cover-slot img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

.cover-slot-inner {
  position: absolute;
  inset: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
  pointer-events: none;
  border: 1px dashed oklch(78% 0.01 160);
  border-radius: 10px;
  background: oklch(97.5% 0.004 160 / 0.55);
}

.cover-slot-inner svg {
  width: 26px;
  height: 26px;
  color: oklch(58% 0.01 160);
  opacity: 0.9;
}

.cover-slot-inner span {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  color: oklch(55% 0.01 160);
  max-width: 170px;
}

/* Category badge — match Design Canvas */
.card-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: oklch(22% 0.015 160 / 0.85);
  color: oklch(98% 0.004 160);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: none;
  text-transform: none;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.card-instructor {
  font-size: 13px;
  color: var(--muted);
}

.card p {
  font-size: 13.5px;
  color: var(--muted-2);
  line-height: 1.5;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.card-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.card-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.empty {
  text-align: center;
  padding: 80px 20px;
  color: oklch(55% 0.01 160);
  grid-column: 1 / -1;
}

.empty strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  color: oklch(30% 0.015 160);
}

.empty span {
  font-size: 14px;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0;
  max-width: var(--max);
  margin: 0 auto;
}

.site-footer .logo {
  font-size: 14px;
}

.site-footer p {
  font-size: 13px;
  color: oklch(55% 0.01 160);
  margin: 0;
}

/* —— Modal (exact canvas) —— */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(15% 0.01 160 / 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  animation: rise 0.22s ease both;
}

.modal .cover-slot {
  height: auto;
  aspect-ratio: auto;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

.modal .cover-slot-inner {
  inset: 12px;
}

.modal .card-cat {
  display: none;
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: oklch(55% 0.01 160);
  cursor: pointer;
  padding: 0;
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.modal-instructor {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.modal-desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: oklch(35% 0.01 160);
  margin: 0 0 24px;
}

.curriculum-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: oklch(30% 0.01 160);
  margin-bottom: 10px;
}

.curriculum {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.curriculum li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: oklch(30% 0.01 160);
  align-items: flex-start;
  list-style: none;
}

.curriculum li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.modal-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 8px;
  white-space: nowrap;
  transition: filter 0.15s;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* —— Checkout / success pages —— */
.page-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px 80px;
}

.page-card {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.page-card h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 8px 0 10px;
}

.page-card > p {
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 14.5px;
  line-height: 1.5;
}

.page-card .amount {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 8px 0 20px;
}

.page-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-hint {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.page-card {
  width: min(520px, 100%);
}

.pay-networks-label {
  margin: 22px 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pay-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.pay-method {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pay-method:hover,
.pay-method.is-on {
  border-color: var(--accent);
  color: var(--accent);
}

.invoice {
  display: none;
  margin-top: 8px;
}

.invoice.is-on {
  display: block;
}

.invoice-qr {
  display: block;
  width: 196px;
  height: 196px;
  margin: 0 auto 16px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.invoice-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.invoice-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 36px;
  }

  .modal {
    padding: 22px;
  }

  .modal-actions {
    flex-wrap: wrap;
  }
}
