/* ============================================================
   Single course page — "Course Page v2 / 1d"
   Dark navy hero + tabbed content + overlapping course-first rail.

   Calm Workspace: tokens only (no hardcoded hex/px colors), white cards on a
   pale page, the navy hero is the one sanctioned dark (player-dark) surface.
   Structure: single-sfwd-courses.php → hero, then .sf-course-cols
   (main tabs + related | sticky rail). All values reference tokens.css.
   ============================================================ */

.sf-course-wrap {
  background: var(--page);
}

/* Shared inner width for hero and columns so they align horizontally. */
.sf-course-hero__inner,
.sf-course-cols {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* ----------------------------------------------------------- Dark hero */
.sf-course-hero {
  background: var(--player-dark);
  padding-top: 30px;
  padding-bottom: 36px; /* compact — the rail is pulled up to overlap it */
}

.sf-course-hero__inner {
  /* keep the hero copy clear of the overlapping 340px rail on the right */
  padding-right: 400px;
}

.sf-course-breadcrumb {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--on-navy-faint);
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sf-course-breadcrumb a {
  color: var(--on-navy-strong);
  text-decoration: none;
}

.sf-course-breadcrumb a:hover {
  color: var(--on-navy);
  text-decoration: underline;
}

.sf-course-breadcrumb__sep {
  color: var(--on-navy-faint);
}

.sf-course-title {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -.5px;
  color: var(--on-navy);
}

.sf-course-subtitle {
  font-size: 15px;
  line-height: 1.55;
  color: var(--on-navy-muted);
  margin: 12px 0 16px;
  max-width: 640px;
}

.sf-course-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.sf-instructor-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sf-instructor-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--on-navy-fill);
  color: var(--on-navy);
  font-weight: 900;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.sf-instructor-avatar--photo {
  background: none;
  object-fit: cover;
}

.sf-instructor-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--on-navy);
  text-decoration: none;
}

.sf-instructor-name:hover {
  text-decoration: underline;
  color: var(--on-navy);
}

.sf-instructor-callout {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-navy-faint);
}

.sf-course-rating {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--star);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sf-course-rating__star {
  color: var(--star);
}

.sf-course-rating__count {
  color: var(--on-navy-faint);
  font-weight: 700;
  font-size: 12.5px;
  text-decoration: none;
}

.sf-course-rating__count:hover {
  color: var(--on-navy-strong);
  text-decoration: underline;
}

.sf-course-enrolled {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--on-navy-faint);
}

.sf-course-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sf-course-pills .sf-pill {
  font-size: 12px;
  font-weight: 800;
  color: var(--on-navy);
  border: 1px solid var(--on-navy-line);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  background: none;
}

/* ------------------------------------------------------- Columns layout */
.sf-course-cols {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  padding-top: 24px;
  padding-bottom: 64px;
}

.sf-course-main {
  flex: 1;
  min-width: 0;
}

.sf-course-rail {
  width: 340px;
  flex: none;
  margin-top: -250px; /* pull the rail up so its top sits near the hero top */
  position: sticky;
  top: 16px;
  z-index: 2;
}

/* --------------------------------------------------------------- Cards */
.sf-course-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: var(--r-card);
  padding: 24px 28px;
  margin-bottom: 20px;
}

.sf-course-card__heading {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 900;
  color: var(--ink);
}

/* ---------------------------------------------------------------- Tabs */
.sf-tabs__nav {
  display: none; /* revealed only after JS enhancement */
  gap: 4px;
  border-bottom: 2px solid var(--card-border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sf-tabs.is-enhanced .sf-tabs__nav {
  display: flex;
}

.sf-tabs__tab {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted-2);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 13px 16px;
  cursor: pointer;
  font-family: var(--font);
}

.sf-tabs__tab:hover {
  color: var(--ink);
}

.sf-tabs__tab.is-active {
  color: var(--ink);
  font-weight: 800;
  border-bottom-color: var(--blue);
}

.sf-tabs__tab:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Without JS every panel shows (stacked). With JS only the active one shows. */
.sf-tabs.is-enhanced .sf-tabs__panel {
  display: none;
}

.sf-tabs.is-enhanced .sf-tabs__panel.is-active {
  display: block;
}

/* ------------------------------------------------ Overview: outcomes */
.sf-outcomes-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.sf-outcome-item {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  color: var(--body-2);
  line-height: 1.5;
}

.sf-outcome-check {
  color: var(--green);
  font-weight: 900;
  flex: none;
}

/* ------------------------------------------------- Overview: about */
.sf-course-about__body {
  font-size: 14px;
  color: var(--body-2);
  line-height: 1.65;
  max-width: 720px;
}

.sf-course-about__body h2,
.sf-course-about__body h3 {
  color: var(--ink);
  font-weight: 900;
}

.sf-course-about__body h3 {
  font-size: 15.5px;
  margin: 18px 0 8px;
}

.sf-course-about__body p {
  margin: 0 0 12px;
}

.sf-course-about__body a {
  color: var(--deep-blue);
  font-weight: 700;
}

.sf-course-about__body ul,
.sf-course-about__body ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

.sf-course-about__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-card-sm);
}

/* Skill chips at foot of the About card */
.sf-course-skills-block {
  margin-top: 18px;
  border-top: 1px solid var(--strip);
  padding-top: 14px;
}

.sf-course-skills-block__label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 8px;
}

.sf-course-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sf-course-skill-chip {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--deep-blue);
  background: var(--blue-fill);
  border-radius: var(--r-btn);
  padding: 6px 14px;
  text-decoration: none;
}

.sf-course-skill-chip:hover {
  background: var(--blue);
  color: var(--white);
}

/* ---------------------------------------------- Overview: instructor card */
.sf-instructor-card {
  display: flex;
  gap: 20px;
}

.sf-instructor-card__avatar {
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--blue), var(--blue-hover));
  color: var(--white);
  font-weight: 900;
  font-size: 22px;
  display: grid;
  place-items: center;
}

.sf-instructor-card__avatar--photo {
  background: none;
  object-fit: cover;
}

.sf-instructor-card__body {
  flex: 1;
  min-width: 0;
}

.sf-instructor-card__name {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sf-instructor-card__name a {
  color: var(--ink);
  text-decoration: none;
}

.sf-instructor-card__name a:hover {
  text-decoration: underline;
}

.sf-instructor-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--deep-blue);
  background: var(--blue-fill);
  border-radius: 6px;
  padding: 2px 8px;
}

.sf-instructor-card__callout {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--deep-blue);
  margin-top: 6px;
}

.sf-instructor-card__bio {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 6px 0 0;
}

.sf-instructor-card__link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--deep-blue);
  text-decoration: none;
}

.sf-instructor-card__link:hover {
  text-decoration: underline;
}

/* ------------------------------------------- Content: try it free first */
.sf-tryfree {
  background: var(--blue-fill);
  border-color: var(--blue-border);
}

.sf-tryfree__heading {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 12px;
}

.sf-tryfree__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--r-card-sm);
  padding: 12px 16px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
  transition: box-shadow .12s ease;
}

.sf-tryfree__item:hover {
  box-shadow: var(--shadow-card);
}

.sf-tryfree__play {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--blue-fill);
  color: var(--deep-blue);
  display: grid;
  place-items: center;
}

.sf-tryfree__play svg { width: 16px; height: 16px; }

.sf-tryfree__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sf-tryfree__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.sf-tryfree__meta {
  font-size: 11.5px;
  color: var(--muted-2);
  font-weight: 600;
}

.sf-tryfree__badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--green-ink);
  background: var(--green-fill);
  border-radius: 6px;
  padding: 2px 8px;
}

/* -------------------------------------------------- Content: accordion */
.sf-course-content__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.sf-course-content__tools {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.sf-course-content__counts {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted-2);
}

.sf-course-content__toggle-all {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--deep-blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
}

.sf-course-content__toggle-all:hover {
  text-decoration: underline;
}

.sf-chapters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sf-chapter {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
}

.sf-chapter__header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 13px 16px;
  min-height: 44px;
  box-sizing: border-box;
  list-style: none;
}

.sf-chapter__header::-webkit-details-marker { display: none; }

.sf-chapter__header:hover {
  background: var(--page);
}

.sf-chapter__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.sf-chapter__count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-2);
}

.sf-chapter__chevron {
  color: var(--muted-2);
  display: inline-flex;
  transition: transform .15s ease;
}

.sf-chapter__chevron svg { width: 18px; height: 18px; }

.sf-chapter[open] .sf-chapter__chevron {
  transform: rotate(180deg);
}

.sf-chapter__lessons {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 16px 12px;
  border-top: 1px solid var(--strip);
}

.sf-lesson-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--body-2);
  padding: 6px 0;
  text-decoration: none;
}

.sf-lesson-row:hover .sf-lesson-title {
  color: var(--deep-blue);
}

/* Free-preview rows render as <button> triggers for the preview modal —
   reset UA button chrome to match the anchor rows exactly. */
button.sf-lesson-row--preview {
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

button.sf-lesson-row--preview .sf-lesson-icon {
  color: var(--blue);
}

.sf-lesson-icon {
  color: var(--faint);
  display: inline-flex;
  flex: none;
}

.sf-lesson-icon svg { width: 14px; height: 14px; }

.sf-lesson-title {
  font-weight: 600;
  color: var(--body-2);
}

.sf-lesson-free {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--green-ink);
  background: var(--green-fill);
  border-radius: 6px;
  padding: 2px 8px;
}

.sf-lesson-dur {
  margin-left: auto;
  font-weight: 600;
  color: var(--muted-2);
}

/* -------------------------------------------------------------- Reviews */
.sf-reviews-summary {
  display: flex;
  gap: 32px;
  margin-bottom: 18px;
}

.sf-reviews-summary__left {
  text-align: center;
  flex: none;
}

.sf-reviews-score {
  font-size: 44px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
  display: block;
}

.sf-reviews-stars {
  font-size: 15px;
  color: var(--star);
  font-weight: 800;
  margin: 4px 0 2px;
}

.sf-star--empty {
  color: var(--star-track);
}

.sf-reviews-count {
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 700;
}

.sf-reviews-histogram {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 420px;
}

.sf-histogram-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.sf-histogram-label {
  width: 30px;
  text-align: right;
  color: var(--muted);
}

.sf-histogram-bar {
  flex: 1;
  height: 8px;
  background: var(--strip);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.sf-histogram-fill {
  height: 100%;
  background: var(--star);
  border-radius: var(--r-pill);
}

.sf-histogram-count {
  width: 20px;
  color: var(--muted-2);
}

.sf-review {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--strip);
}

.sf-review__avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--strip);
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.sf-review__author {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.sf-review__date {
  font-weight: 600;
  color: var(--faint);
  font-size: 11.5px;
}

.sf-review__stars {
  font-size: 12px;
  color: var(--star);
  font-weight: 800;
  margin: 2px 0;
}

.sf-review__content {
  font-size: 13.5px;
  color: var(--body-2);
  line-height: 1.55;
  margin: 0;
}

.sf-review-reply {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--page);
  border-radius: var(--r-card-sm);
  border: 1px solid var(--card-border);
}

.sf-review-reply__author {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
}

.sf-review-reply__badge {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--deep-blue);
  background: var(--blue-fill);
  border-radius: 6px;
  padding: 2px 7px;
  margin-left: 6px;
}

.sf-review-reply__date {
  font-size: 11.5px;
  color: var(--faint);
  font-weight: 600;
  margin-left: 6px;
}

.sf-review-reply__content {
  font-size: 13px;
  color: var(--body-2);
  line-height: 1.5;
  margin: 6px 0 0;
}

/* Review pager (built by course-page.js) */
.sf-reviews-pager {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  border-top: 1px solid var(--strip);
  padding-top: 16px;
  flex-wrap: wrap;
}

.sf-reviews-pager__btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--r-btn);
  background: var(--white);
  color: var(--ink);
  font: 700 12.5px var(--font);
  cursor: pointer;
}

.sf-reviews-pager__btn:hover:not(:disabled) {
  background: var(--page);
}

.sf-reviews-pager__btn.is-current {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
  font-weight: 800;
  cursor: default;
}

.sf-reviews-pager__btn:disabled {
  opacity: .5;
  cursor: default;
}

.sf-reviews-pager__status {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 600;
}

/* ----------------------------------------------------------- Purchase rail */
.sf-rail-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: 0 16px 44px rgba(33, 52, 75, .16);
}

.sf-rail-thumb {
  display: block;
  position: relative;
  height: 190px;
  background: var(--blue-fill);
  border: none;
  padding: 0;
  width: 100%;
  cursor: default;
  overflow: hidden;
}

.sf-rail-thumb--btn,
a.sf-rail-thumb {
  cursor: pointer;
}

.sf-rail-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sf-rail-thumb__ph {
  width: 100%;
  height: 100%;
}

.sf-rail-thumb__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(33, 52, 75, .12);
}

.sf-rail-thumb__play {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--white);
  color: var(--blue);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(33, 52, 75, .18);
}

.sf-rail-thumb__play svg { width: 20px; height: 20px; }

.sf-rail-thumb__pill {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  background: rgba(255, 255, 255, .92);
  border-radius: var(--r-pill);
  padding: 4px 12px;
}

/* Flash sale — red "Sale" band + dark days/hours/min/sec segments (soofos.nl reference). */
.sf-rail-flash {
  margin: 12px 16px 0;
  border-radius: var(--r-card);
  overflow: hidden;
}

.sf-rail-flash__band {
  background: var(--red);
  color: var(--white);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 10px;
}

.sf-flash-countdown {
  display: flex;
  align-items: stretch;
  gap: 6px;
  background: var(--ink);
  padding: 10px;
}

.sf-rail-flash__seg {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--soofos-on-navy-surface);
  border: 1px solid var(--soofos-on-navy-border);
  border-radius: var(--r-btn);
  padding: 6px 2px;
  min-width: 0;
}

.sf-rail-flash__num {
  font-size: 16px;
  font-weight: 900;
  color: var(--soofos-on-navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.sf-rail-flash__unit {
  font-size: 10px;
  font-weight: 600;
  color: var(--soofos-on-navy-muted);
  text-transform: lowercase;
}

/* Save control */
.sf-rail-save {
  padding: 12px 22px 0;
}

.sf-rail-save__btn,
.sf-rail-save__login-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-2);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
  padding: 0;
}

.sf-rail-save__btn:hover,
.sf-rail-save__login-link:hover {
  color: var(--deep-blue);
}

.sf-rail-save__icon {
  display: inline-flex;
}

.sf-rail-save__icon svg { width: 15px; height: 15px; }

.sf-rail-save__btn.is-wishlisted {
  color: var(--red);
}

.sf-rail-save__btn.is-wishlisted .sf-rail-save__icon svg {
  fill: var(--red);
}

/* Rail body */
.sf-rail-body {
  padding: 14px 22px 20px;
}

.sf-rail-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.sf-rail-price__amount {
  font-size: 32px;
  font-weight: 900;
  color: var(--ink);
}

.sf-rail-price__sub {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted-2);
}

.sf-rail-price__regular {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted-2);
  text-decoration: line-through;
}

.sf-rail-includes {
  list-style: none;
  margin: 13px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sf-rail-includes li {
  display: flex;
  gap: 9px;
  font-size: 13px;
  color: var(--body-2);
  font-weight: 700;
}

.sf-rail-check {
  color: var(--green);
  font-weight: 900;
  flex: none;
}

.btn-buy--rail,
.btn-primary.btn-buy--rail {
  width: 100%;
  padding: 15px;
  font-size: 15px;
  justify-content: center;
}

.btn-ghost--rail {
  width: 100%;
  margin-top: 9px;
  padding: 13px;
  border: 1.5px solid var(--input-border);
  border-radius: var(--r-btn);
  background: var(--white);
  color: var(--ink);
  font: 800 13.5px var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-ghost--rail:hover {
  border-color: var(--blue);
}

.sf-btn-icon {
  display: inline-flex;
}

.sf-btn-icon svg { width: 14px; height: 14px; }

.sf-rail-guarantee {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 10px;
  font-weight: 600;
}

/* Team-license quantity stepper (b2b-license-block.php) */
.sf-qty-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 12px;
}

.sf-qty-field__label {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.sf-qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--card-border);
  border-radius: var(--r-btn);
  background: var(--white);
  overflow: hidden;
}

.sf-qty-stepper__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}

.sf-qty-stepper__btn:first-child {
  border-right: 1px solid var(--card-border);
}

.sf-qty-stepper__btn:last-child {
  border-left: 1px solid var(--card-border);
}

.sf-qty-stepper__btn:hover {
  background: var(--blue-fill);
  color: var(--deep-blue);
}

.sf-qty-stepper__btn svg {
  width: 16px;
  height: 16px;
}

.sf-qty-stepper__input {
  width: 64px;
  height: 44px;
  border: none;
  background: var(--white);
  color: var(--ink);
  font: 800 14px var(--font);
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.sf-qty-stepper__input::-webkit-outer-spin-button,
.sf-qty-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sf-qty-stepper__btn:focus-visible,
.sf-qty-stepper__input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

/* Enrolled variant */
.sf-rail-enrolled-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.sf-rail-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.sf-rail-progress__track {
  flex: 1;
  height: 8px;
  background: var(--strip);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.sf-rail-progress__fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--r-pill);
}

.sf-rail-progress__text {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.sf-rail-progress__meta {
  font-size: 12px;
  color: var(--muted-2);
  margin: 0 0 12px;
}

/* Upsell footer */
.sf-rail-upsell {
  border-top: 1px solid var(--card-border);
  background: var(--page);
  padding: 16px 22px;
}

.sf-rail-upsell__heading {
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: .05em;
  color: var(--deep-blue);
  margin-bottom: 6px;
}

.sf-rail-upsell__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
}

.sf-rail-upsell__row--border {
  border-bottom: 1px solid var(--card-border);
}

.sf-rail-upsell__label {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

.sf-rail-upsell__label:hover {
  color: var(--deep-blue);
}

.sf-rail-upsell__price {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
}

.sf-rail-upsell__per {
  font-size: 11px;
  color: var(--muted-2);
  font-weight: 700;
}

.sf-rail-upsell__sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 4px 0 0;
}

.sf-rail-upsell__sub a {
  font-weight: 800;
  color: var(--deep-blue);
}

/* Plus-first fallback extras */
.sf-rail-trial-badge,
.sf-rail-lifetime {
  font-weight: 800;
}

.sf-rail-trial-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--green-ink);
  background: var(--green-fill);
  border-radius: 6px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

.sf-rail-lifetime {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--r-card-sm);
  background: var(--white);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
}

.sf-rail-lifetime__price {
  font-weight: 900;
}

/* Social proof under the rail */
.sf-rail-social {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 0 6px;
}

.sf-rail-social__avatars {
  display: inline-flex;
}

.sf-rail-social__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--page);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
}

.sf-rail-social__avatar + .sf-rail-social__avatar {
  margin-left: -8px;
}

.sf-rail-social__avatar--a { background: var(--blue-fill); color: var(--deep-blue); }
.sf-rail-social__avatar--b { background: var(--amber-fill); color: var(--amber-text); }
.sf-rail-social__avatar--c { background: var(--green-fill); color: var(--green-ink); }

.sf-rail-social__text {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-2);
}

/* ----------------------------------------------------- Discover more */
.sf-course-related {
  margin-top: 4px;
}

.sf-course-related__heading {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 900;
  color: var(--ink);
}

.sf-course-related__row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  align-items: stretch;
}

.sf-related-plus {
  background: var(--blue-fill);
  border: 1px solid var(--blue-border);
  border-radius: var(--r-card-sm);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
}

.sf-related-plus__title {
  font-size: 13.5px;
  font-weight: 900;
  color: var(--ink);
}

.sf-related-plus__body {
  font-size: 12px;
  color: var(--deep-blue);
  font-weight: 700;
  line-height: 1.4;
}

.sf-related-plus__price {
  font-size: 14.5px;
  font-weight: 900;
  color: var(--ink);
  margin-top: auto;
}

.sf-related-plus__per {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.sf-related-plus__cta {
  margin-top: 6px;
  text-align: center;
  padding: 9px 12px;
  border-radius: var(--r-btn);
  background: var(--blue);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(99, 156, 224, .35);
}

.sf-related-plus:hover .sf-related-plus__cta {
  background: var(--blue-hover);
}

/* ---------------------------------------------------------- Preview modal */
.sf-preview-modal {
  border: none;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-pop);
  padding: 0;
  max-width: 720px;
  width: 94vw;
  background: var(--white);
}

.sf-preview-modal::backdrop {
  background: var(--overlay);
}

.sf-preview-modal__inner {
  display: flex;
  flex-direction: column;
}

.sf-preview-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--card-border);
}

.sf-preview-modal__labels {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sf-preview-modal__tag {
  display: inline-flex;
  align-self: flex-start;
}

.sf-preview-modal__title {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}

.sf-preview-modal__close {
  font-size: 24px;
  line-height: 1;
  color: var(--muted-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  flex: none;
  transition: color .15s;
}

.sf-preview-modal__close:hover {
  color: var(--ink);
}

.sf-preview-modal__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--player-dark);
}

.sf-preview-modal__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.sf-preview-modal__foot {
  padding: 14px 24px;
  font-size: 13px;
  color: var(--muted-2);
  text-align: center;
  margin: 0;
}

.sf-preview-modal__foot a {
  color: var(--blue);
  font-weight: 800;
}

/* Open animation — skipped for reduced-motion users. */
@media (prefers-reduced-motion: no-preference) {
  .sf-preview-modal[open] {
    animation: sf-preview-modal-in .18s ease-out;
  }

  @keyframes sf-preview-modal-in {
    from {
      opacity: 0;
      transform: translateY(8px) scale(.98);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* Scroll lock while the preview modal is open (toggled by
   course-preview-modal.js — native <dialog> does not lock the page). */
html.sf-modal-open,
html.sf-modal-open body {
  overflow: hidden;
}

/* --------------------------------------- Preview modal: end-of-lesson CTA */

/* Ended state: the video block gives way to the conversion panel
   (Presentation/course.html pv:2), header + close stay. */
.sf-preview-modal--ended .sf-preview-modal__video,
.sf-preview-modal--ended .sf-preview-modal__foot {
  display: none;
}

.sf-preview-end {
  padding: 36px 44px;
  text-align: center;
  background: var(--blue-tint);
}

.sf-preview-end__emoji {
  display: block;
  font-size: 36px;
  line-height: 1;
  margin-bottom: 8px;
}

.sf-preview-end__title {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  margin: 0;
}

.sf-preview-end__sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin: 8px auto 20px;
  max-width: 400px;
}

.sf-preview-end__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  margin: 0 auto;
}

.sf-preview-end__cta {
  padding: 14px;
  font-size: 14.5px;
}

.sf-preview-end__replay {
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  padding: 6px;
  min-height: 32px;
}

.sf-preview-end__replay:hover {
  color: var(--blue-hover);
}

@media (max-width: 480px) {
  .sf-preview-end {
    padding: 28px 18px;
  }
}

/* -------------------------------------------------------------- Responsive */
@media (max-width: 1000px) {
  .sf-course-hero {
    padding-bottom: 28px; /* rail no longer overlaps on narrow screens */
  }

  .sf-course-hero__inner {
    padding-right: 24px;
  }

  .sf-course-cols {
    flex-direction: column;
    padding-top: 20px;
  }

  /* Lead with the price/buy rail directly under the hero, then the tabs. */
  .sf-course-rail {
    width: auto;
    align-self: stretch;
    margin-top: 0;
    margin-bottom: 20px;
    position: static;
    order: -1;
  }

  .sf-course-related__row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 680px) {
  .sf-course-title { font-size: 27px; }

  .sf-outcomes-grid {
    grid-template-columns: 1fr;
  }

  .sf-course-card {
    padding: 18px 18px;
  }

  .sf-reviews-summary {
    flex-direction: column;
    gap: 14px;
  }

  .sf-reviews-summary__left {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
  }

  .sf-course-related__row {
    grid-template-columns: repeat(2, 1fr);
  }
}
