/* ==========================================================================
   TomiGuide - Reusable components
   Everything in here is driven by the tokens declared in style.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Cards & surfaces
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}
.card--flush { padding: 0; overflow: hidden; }
.card--raised { box-shadow: var(--shadow); border-color: transparent; }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.card__head h2, .card__head h3 { margin: 0; font-size: var(--fs-md); }
.card__body { padding: var(--sp-5); }
.card__foot {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

/* --------------------------------------------------------------------------
   Badges & pills
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--surface-sunken);
  color: var(--text-soft);
}
.badge--type { background: var(--primary-soft); color: var(--primary-dark); }
.badge--bestseller { background: var(--accent-soft); color: #8a4b00; }
.badge--free { background: var(--secondary-soft); color: var(--secondary-dark); }
.badge--new { background: var(--info-soft); color: var(--info); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--muted { background: var(--surface-sunken); color: var(--muted); }
.badge--discount { background: var(--danger-soft); color: var(--danger); }

/* Status dot used in tables */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status--published, .status--paid, .status--approved { color: var(--success); }
.status--pending_review, .status--pending { color: var(--warning); }
.status--draft { color: var(--muted); }
.status--rejected, .status--failed, .status--suspended { color: var(--danger); }
.status--hidden { color: var(--muted); }

/* --------------------------------------------------------------------------
   Product card
   -------------------------------------------------------------------------- */

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  height: 100%;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.product-card:focus-within {
  box-shadow: var(--shadow-md), var(--shadow-focus);
  border-color: transparent;
}

.product-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-sunken);
  overflow: hidden;
}
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.product-card:hover .product-card__media img { transform: scale(1.035); }

.product-card__flags {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  max-width: calc(100% - 5rem);
}

.fav-btn {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.fav-btn:hover { transform: scale(1.08); color: var(--danger); background: #fff; }
.fav-btn[aria-pressed="true"] { color: var(--danger); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }

.product-card__body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--sp-2);
}

.product-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.product-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.015em;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card__title a { color: var(--text); }
.product-card__title a:hover { color: var(--primary); text-decoration: none; }
/* Stretched link makes the whole card clickable without nesting links */
.product-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.product-card__desc {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__creator {
  font-size: var(--fs-sm);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.product-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-2);
}

/* Rating ------------------------------------------------------------------ */
.rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--fs-sm);
  color: var(--text-soft);
}
.rating__score { font-weight: 700; color: var(--text); }
.rating__stars { display: inline-flex; gap: 1px; color: var(--star); }
.rating__count { color: var(--muted); }
.rating--lg { font-size: var(--fs-md); }

/* Price ------------------------------------------------------------------- */
.price {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-2);
  font-family: var(--font-display);
}
.price__now { font-size: var(--fs-lg); font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.price__was {
  font-size: var(--fs-sm);
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 500;
}
.price__free { color: var(--secondary-dark); }
.price--lg .price__now { font-size: var(--fs-3xl); }
.price--lg .price__was { font-size: var(--fs-md); }

/* Compact list variant used in cart / order summaries ---------------------- */
.mini-product {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}
.mini-product__thumb {
  width: 84px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex: none;
  background: var(--surface-sunken);
}
.mini-product__title {
  font-weight: 650;
  font-size: var(--fs-base);
  line-height: 1.35;
  margin: 0 0 2px;
}
.mini-product__title a { color: var(--text); }
.mini-product__meta { font-size: var(--fs-sm); color: var(--muted); }

/* --------------------------------------------------------------------------
   Category card
   -------------------------------------------------------------------------- */

.category-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  height: 100%;
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
  text-decoration: none;
}
.category-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: var(--sp-2);
  transition: background var(--t), color var(--t);
}
.category-card:hover .category-card__icon { background: var(--primary); color: #fff; }
.category-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--text);
  margin: 0;
}
.category-card__desc { font-size: var(--fs-sm); color: var(--muted); margin: 0; line-height: 1.5; }
.category-card__count {
  font-size: var(--fs-xs);
  color: var(--muted-light);
  font-weight: 600;
  margin-top: auto;
  padding-top: var(--sp-3);
}

/* Accent variations keep the grid from feeling monotone */
.category-card:nth-child(4n+2) .category-card__icon { background: var(--secondary-soft); color: var(--secondary-dark); }
.category-card:nth-child(4n+2):hover .category-card__icon { background: var(--secondary); color: #fff; }
.category-card:nth-child(4n+3) .category-card__icon { background: var(--accent-soft); color: var(--accent-dark); }
.category-card:nth-child(4n+3):hover .category-card__icon { background: var(--accent); color: #3a2500; }

/* --------------------------------------------------------------------------
   Trust / value strip
   -------------------------------------------------------------------------- */

.value-item { display: flex; gap: var(--sp-4); align-items: flex-start; }
.value-item__icon {
  width: 40px; height: 40px;
  flex: none;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.value-item h3 { font-size: var(--fs-md); margin-bottom: 0.25rem; }
.value-item p { font-size: var(--fs-base); color: var(--muted); margin: 0; line-height: 1.5; }

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}
.stat-tile__label {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.stat-tile__value {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-tile__sub { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--sp-1); }

/* --------------------------------------------------------------------------
   Tabs / segmented control
   -------------------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: var(--sp-3) var(--sp-4);
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }

.segmented {
  display: inline-flex;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 0.4375rem 0.875rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* --------------------------------------------------------------------------
   Filters (explore sidebar)
   -------------------------------------------------------------------------- */

.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}

.filter-group { border-bottom: 1px solid var(--border); padding-bottom: var(--sp-4); margin-bottom: var(--sp-4); }
.filter-group:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }

.filter-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: 0;
  padding: 0 0 var(--sp-3);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.filter-group__head svg { transition: transform var(--t); color: var(--muted); }
.filter-group__head[aria-expanded="false"] svg { transform: rotate(-90deg); }
.filter-group__body { display: block; }
.filter-group__head[aria-expanded="false"] + .filter-group__body { display: none; }

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.3125rem 0;
  font-size: var(--fs-base);
  color: var(--text-soft);
  cursor: pointer;
}
.filter-option input { accent-color: var(--primary); width: 1rem; height: 1rem; cursor: pointer; flex: none; }
.filter-option:hover { color: var(--text); }
.filter-option__count { margin-left: auto; font-size: var(--fs-sm); color: var(--muted-light); }

.active-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.3125rem 0.5rem 0.3125rem 0.75rem;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 0;
}
.filter-tag button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  display: flex;
  opacity: 0.7;
}
.filter-tag button:hover { opacity: 1; }

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.results-bar__count { font-size: var(--fs-base); color: var(--muted); }
.results-bar__count strong { color: var(--text); }

/* --------------------------------------------------------------------------
   Skeleton loaders
   -------------------------------------------------------------------------- */

.skeleton {
  background: linear-gradient(90deg, var(--surface-sunken) 25%, #e6eaf2 37%, var(--surface-sunken) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-xs);
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.skeleton--text { height: 0.75rem; margin-bottom: var(--sp-2); }
.skeleton--title { height: 1.125rem; width: 80%; margin-bottom: var(--sp-3); }
.skeleton--line-short { width: 55%; }
.skeleton--media { aspect-ratio: 16 / 10; border-radius: 0; }
.skeleton--avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton--btn { height: 2.5rem; width: 8rem; border-radius: var(--radius-sm); }
.skeleton--block { height: 200px; border-radius: var(--radius-lg); }

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.skeleton-card__body { padding: var(--sp-4); }

/* --------------------------------------------------------------------------
   Empty & error states
   -------------------------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: var(--sp-9) var(--sp-5);
  max-width: 460px;
  margin-inline: auto;
}
.empty-state__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-4);
}
.empty-state h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.empty-state p { color: var(--muted); margin-bottom: var(--sp-5); }

.alert {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  border: 1px solid transparent;
  margin-bottom: var(--sp-4);
  align-items: flex-start;
}
.alert svg { flex: none; margin-top: 2px; }
.alert p { margin: 0; }
.alert--error { background: var(--danger-soft); border-color: #f5c6c7; color: #8e2225; }
.alert--success { background: var(--success-soft); border-color: #bfe6d3; color: #0a6b41; }
.alert--warning { background: var(--warning-soft); border-color: #f5dfae; color: #8a5900; }
.alert--info { background: var(--info-soft); border-color: #c9dcf0; color: #1e4c74; }
.alert__title { font-weight: 700; margin-bottom: 0.25rem; }
.alert a { color: inherit; text-decoration: underline; font-weight: 600; }

/* Demo-mode ribbon shown when Firebase is not configured yet --------------- */
.demo-banner {
  background: var(--warning-soft);
  border-bottom: 1px solid #f0dcae;
  color: #7a4f00;
  font-size: var(--fs-sm);
  text-align: center;
  padding: var(--sp-2) var(--sp-4);
}
.demo-banner strong { font-weight: 700; }
.demo-banner a { color: inherit; text-decoration: underline; }

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */

.toast-region {
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
  max-width: min(380px, calc(100vw - 2rem));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  background: var(--text);
  color: #fff;
  padding: var(--sp-4);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 260ms var(--ease);
  font-size: var(--fs-base);
}
.toast.is-leaving { animation: toast-out 200ms var(--ease) forwards; }
.toast svg { flex: none; margin-top: 1px; }
.toast--success svg { color: #5fd6a0; }
.toast--error svg { color: #ff8b8e; }
.toast--info svg { color: #8fb6ff; }
.toast__body { flex: 1; }
.toast__title { font-weight: 700; margin-bottom: 2px; }
.toast__msg { color: rgba(255, 255, 255, 0.8); font-size: var(--fs-sm); }
.toast__close {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  display: flex;
}
.toast__close:hover { color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* --------------------------------------------------------------------------
   Modal / dialog
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 23, 43, 0.55);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  transform: translateY(10px) scale(0.99);
  transition: transform var(--t);
}
.modal-backdrop.is-open .modal { transform: none; }
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
}
.modal__head h2 { margin: 0; font-size: var(--fs-xl); }
.modal__body { padding: 0 var(--sp-5) var(--sp-5); }
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-wrap: wrap;
}
.modal--wide { max-width: 720px; }

/* --------------------------------------------------------------------------
   Tables (admin / creator)
   -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.table { width: 100%; font-size: var(--fs-base); border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-alt); }
.table__actions { display: flex; gap: var(--sp-2); justify-content: flex-end; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table__cell-main { font-weight: 600; color: var(--text); }
.table__cell-sub { font-size: var(--fs-sm); color: var(--muted); }

/* --------------------------------------------------------------------------
   Progress
   -------------------------------------------------------------------------- */

.progress {
  height: 6px;
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--secondary);
  border-radius: inherit;
  transition: width var(--t-slow);
}
.progress--accent .progress__bar { background: var(--accent); }
.progress__label {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: var(--sp-2);
}

/* --------------------------------------------------------------------------
   Accordion (curriculum, FAQ)
   -------------------------------------------------------------------------- */

.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.accordion__item + .accordion__item { border-top: 1px solid var(--border); }
.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-4);
  background: var(--surface-alt);
  border: 0;
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.accordion__trigger:hover { background: var(--surface-sunken); }
.accordion__trigger svg { flex: none; transition: transform var(--t); color: var(--muted); }
.accordion__trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.accordion__panel { padding: var(--sp-2) var(--sp-4) var(--sp-4); }
.accordion__panel[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Lesson list (product page + player)
   -------------------------------------------------------------------------- */

.lesson-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-base);
  width: 100%;
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  text-align: left;
  font-family: inherit;
  color: var(--text-soft);
}
.lesson-row:last-child { border-bottom: 0; }
.lesson-row__icon { color: var(--muted); flex: none; display: flex; }
.lesson-row__title { flex: 1; min-width: 0; }
.lesson-row__dur { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Checklists (what you will learn / included)
   -------------------------------------------------------------------------- */

.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-3); }
.check-list--2col { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-5); }
.check-list li {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}
.check-list li svg { flex: none; margin-top: 3px; color: var(--secondary); }
.check-list--muted li svg { color: var(--muted); }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-7);
  flex-wrap: wrap;
}
.pagination__btn {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 var(--sp-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: all var(--t-fast);
}
.pagination__btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination__btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pagination__btn[aria-current="page"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Product detail
   -------------------------------------------------------------------------- */

.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: var(--sp-7);
  align-items: start;
  padding-block: var(--sp-6);
}

.pdp__media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}
.pdp__media img { width: 100%; height: 100%; object-fit: cover; }

.pdp__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform var(--t);
}
.pdp__play:hover { transform: scale(1.06); }

.pdp__title { font-size: clamp(1.6rem, 3.4vw, 2.25rem); margin-bottom: var(--sp-3); }
.pdp__lede { font-size: var(--fs-lg); color: var(--text-soft); line-height: var(--lh-loose); }

.pdp__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-base);
  color: var(--muted);
}
.pdp__fact { display: inline-flex; align-items: center; gap: 0.375rem; }

.pdp__buybox {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pdp__buybox-media { aspect-ratio: 16 / 10; background: var(--surface-sunken); display: none; }
.pdp__buybox-body { padding: var(--sp-5); }
.pdp__guarantee {
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: center;
  margin-top: var(--sp-4);
}

.pdp__block { padding-block: var(--sp-6); border-top: 1px solid var(--border); }
.pdp__block:first-child { border-top: 0; }
.pdp__block h2 { font-size: var(--fs-xl); margin-bottom: var(--sp-4); }

.creator-box { display: flex; gap: var(--sp-4); align-items: flex-start; }
.creator-box__meta { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-2); }

/* Reviews ----------------------------------------------------------------- */
.review { padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); }
.review:last-child { border-bottom: 0; }
.review__head { display: flex; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-2); }
.review__name { font-weight: 650; }
.review__date { font-size: var(--fs-sm); color: var(--muted); }
.review__title { font-weight: 650; margin-bottom: 0.25rem; }
.review__body { color: var(--text-soft); margin: 0; }

.rating-summary {
  display: flex;
  gap: var(--sp-6);
  align-items: center;
  padding: var(--sp-5);
  background: var(--surface-alt);
  border-radius: var(--radius);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.rating-summary__score {
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.rating-bars { flex: 1; min-width: 220px; display: grid; gap: 6px; }
.rating-bar { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--muted); }
.rating-bar .progress { flex: 1; height: 7px; }
.rating-bar .progress__bar { background: var(--star); }

/* Star input for the review form */
.star-input { display: inline-flex; gap: 2px; }
.star-input button {
  background: none;
  border: 0;
  padding: 2px;
  cursor: pointer;
  color: var(--border-strong);
  display: flex;
  transition: color var(--t-fast), transform var(--t-fast);
}
.star-input button:hover { transform: scale(1.12); }
.star-input button.is-on { color: var(--star); }
.star-input button.is-on svg { fill: currentColor; }

/* --------------------------------------------------------------------------
   Cart & checkout
   -------------------------------------------------------------------------- */

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: var(--sp-6);
  align-items: start;
  padding-block: var(--sp-6) var(--sp-9);
}

.summary {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}
.summary__row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  font-size: var(--fs-base);
  color: var(--text-soft);
}
.summary__row--total {
  border-top: 1px solid var(--border);
  margin-top: var(--sp-3);
  padding-top: var(--sp-4);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
}
.summary__row--discount { color: var(--success); }

.cart-line {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
}
.cart-line:last-of-type { border-bottom: 0; }
.cart-line__thumb {
  width: 120px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex: none;
  background: var(--surface-sunken);
}
.cart-line__body { flex: 1; min-width: 0; }
.cart-line__actions { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-2); }

/* --------------------------------------------------------------------------
   Course player
   -------------------------------------------------------------------------- */

.player {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
  background: var(--surface);
}

.player__side {
  border-right: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
}
.player__side-head { padding: var(--sp-5); border-bottom: 1px solid var(--border); }
.player__side-head h1 { font-size: var(--fs-md); margin-bottom: var(--sp-3); }
.player__lessons { overflow-y: auto; flex: 1; padding: var(--sp-3); }

.player__lesson {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  width: 100%;
  padding: var(--sp-3);
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--text-soft);
  cursor: pointer;
  transition: background var(--t-fast);
}
.player__lesson:hover { background: var(--surface-sunken); }
.player__lesson[aria-current="true"] {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}
.player__lesson-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  color: transparent;
}
.player__lesson.is-done .player__lesson-check {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}
.player__lesson-dur { font-size: var(--fs-sm); color: var(--muted); }

.player__main { padding: var(--sp-6); min-width: 0; }
.player__stage {
  aspect-ratio: 16 / 9;
  background: #0d1020;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b93aa;
  text-align: center;
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.player__stage video, .player__stage iframe { width: 100%; height: 100%; border: 0; }
.player__nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.lesson-body { max-width: 72ch; color: var(--text-soft); line-height: var(--lh-loose); }
.lesson-body h2 { font-size: var(--fs-xl); margin-top: var(--sp-6); }

/* --------------------------------------------------------------------------
   Creator / marketing blocks
   -------------------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-8);
  align-items: center;
}

.steps { counter-reset: step; display: grid; gap: var(--sp-5); }
.step { display: flex; gap: var(--sp-4); align-items: flex-start; }
.step__num {
  counter-increment: step;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-base);
}
.step__num::before { content: counter(step); }
.step h3 { font-size: var(--fs-md); margin-bottom: 0.25rem; }
.step p { color: var(--muted); margin: 0; }

.cta-band {
  background:
    radial-gradient(60% 120% at 15% 0%, rgba(255, 255, 255, 0.16) 0%, transparent 60%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  text-align: center;
}
.cta-band h2 { color: #fff; font-size: var(--fs-2xl); max-width: 22ch; margin-inline: auto; }
.cta-band p { color: rgba(255, 255, 255, 0.85); max-width: 56ch; margin: 0 auto var(--sp-5); }
.cta-band__actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* File upload dropzone ---------------------------------------------------- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: var(--sp-6);
  text-align: center;
  color: var(--muted);
  background: var(--surface-alt);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-softer); }
.dropzone input[type="file"] { display: none; }
.dropzone__hint { font-size: var(--fs-sm); margin-top: var(--sp-2); }

.file-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: var(--sp-3);
  font-size: var(--fs-base);
  background: var(--surface);
}
.file-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__size { font-size: var(--fs-sm); color: var(--muted); }

/* Tag input --------------------------------------------------------------- */
.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.tag-input:focus-within { border-color: var(--primary); box-shadow: var(--shadow-focus); }
.tag-input input {
  flex: 1;
  min-width: 120px;
  border: 0;
  padding: 0.375rem;
  font-family: inherit;
  font-size: var(--fs-base);
}
.tag-input input:focus { outline: none; }

/* Repeatable list rows (learning outcomes, requirements) ------------------- */
.repeat-row { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.repeat-row .input { flex: 1; }

/* --------------------------------------------------------------------------
   Explore layout
   -------------------------------------------------------------------------- */

.explore {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: start;
  padding-block: var(--sp-6) var(--sp-9);
}

.explore__filters {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  max-height: calc(100vh - var(--header-h) - var(--sp-7));
  overflow-y: auto;
}

.explore__main { min-width: 0; }

.load-more { display: flex; justify-content: center; margin-top: var(--sp-7); }

/* Category hero used on /category/<slug> */
.category-hero {
  padding-block: var(--sp-7);
  background:
    radial-gradient(60% 120% at 10% 0%, rgba(47, 62, 168, 0.10) 0%, transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--border);
}
.category-hero__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
}

/* Creator profile header */
.creator-hero {
  padding-block: var(--sp-7);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.creator-hero__inner { display: flex; gap: var(--sp-5); align-items: flex-start; flex-wrap: wrap; }
.creator-hero__stats { display: flex; gap: var(--sp-6); flex-wrap: wrap; margin-top: var(--sp-4); }
.creator-hero__stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  letter-spacing: -0.02em;
}
.creator-hero__stat span { font-size: var(--fs-sm); color: var(--muted); }

/* Prose check-lists sometimes have no inline icon (content pages). Give those
   a small dot marker so the list still reads as a list. */
.check-list li:not(:has(svg))::before {
  content: "";
  flex: none;
  margin-top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--secondary);
}
.check-list--muted li:not(:has(svg))::before { background: var(--muted-light); }

/* An order held by the payment webhook because the amount did not match the
   catalogue. Neither paid nor failed - a human needs to look at it. */
.status--review { color: var(--info); }
