/* ══════════════════════════════════════════════════════════════
   COURSE PAGES: list + My Courses (.cl), details (.cd), checkout (.co)
   Same language as Home: navy hero, gold accents, hairlines,
   start-aligned headers. Phones: compact rows, sticky action bar.
   ══════════════════════════════════════════════════════════════ */

/* ── PAGE HERO (shared) ───────────────────────────────────── */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 1.5rem + 3vw, 4rem) 0 clamp(2rem, 1.5rem + 2vw, 3rem);
  background: radial-gradient(60% 80% at 85% 0%, rgba(var(--rgb-gold), 0.12), transparent 60%), var(--gradient-hero);
  color: var(--color-on-dark);
}
[dir="rtl"] .page-hero { background: radial-gradient(60% 80% at 15% 0%, rgba(var(--rgb-gold), 0.12), transparent 60%), var(--gradient-hero); }
.page-hero__title { margin: 0; font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); font-weight: var(--fw-extrabold); line-height: 1.25; color: var(--color-on-dark) !important; }
.page-hero__desc { max-width: 60ch; margin: var(--sp-3) 0 0; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem); line-height: 1.8; color: var(--color-on-dark-muted); }
.page-hero .title-stroke { margin-inline: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-4); padding: 0; list-style: none; font-size: 0.875rem; color: var(--color-on-dark-muted); }
.crumbs a { color: var(--color-on-dark-muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-gold-light); }
.crumbs li + li::before { content: '/'; margin-inline-end: var(--sp-2); opacity: 0.5; }
.crumbs [aria-current] { color: var(--color-on-dark); max-width: 40ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

@media (prefers-reduced-motion: no-preference) {
  .page-hero__inner > * { animation: hero-rise 0.6s var(--ease-out-soft) both; }
  .page-hero__inner > :nth-child(2) { animation-delay: 70ms; }
  .page-hero__inner > :nth-child(3) { animation-delay: 140ms; }
  .page-hero__inner > :nth-child(4) { animation-delay: 210ms; }
}
@keyframes hero-rise { from { opacity: 0; transform: translateY(12px); } }

/* ── LIST HERO + REEL (the signature) ──────────────────────
   The real course covers drift by under the title like a content feed.
   Hovering or focusing pauses it; reduced motion shows one still row. */
.cl-hero { padding-bottom: 0; }
.cl-hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
.reel { --reel-gap: var(--sp-4); --reel-w: clamp(150px, 11rem + 4vw, 260px); position: relative; display: flex; gap: var(--reel-gap); margin-top: clamp(2rem, 1.5rem + 2vw, 3rem); padding: var(--sp-2) 0 clamp(2rem, 1.5rem + 2vw, 3rem); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.reel__track { display: flex; flex-shrink: 0; gap: var(--reel-gap); min-width: 100%; margin: 0; padding: 0; list-style: none; }
.reel__item { display: block; width: var(--reel-w); aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-xl); background: rgba(255, 255, 255, 0.06); box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.7); outline: 1px solid rgba(255, 255, 255, 0.12); outline-offset: -1px; transition: transform 0.5s var(--ease-out-soft), outline-color var(--transition-base); }
.reel__item img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.reel__item:hover, .reel__item:focus-visible { transform: translateY(-6px); outline: 2px solid var(--brand-gold-light); }
.reel li:nth-child(even) .reel__item { margin-top: var(--sp-5); }
@media (prefers-reduced-motion: no-preference) {
  .reel__track { animation: reel-ltr 60s linear infinite; }
  [dir="rtl"] .reel__track { animation-name: reel-rtl; }
  .reel:hover .reel__track, .reel:focus-within .reel__track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .reel { -webkit-mask-image: none; mask-image: none; overflow-x: auto; padding-inline: var(--container-padding); }
  .reel__track[aria-hidden="true"] { display: none; }
}
@keyframes reel-ltr { to { transform: translateX(calc(-100% - var(--reel-gap))); } }
@keyframes reel-rtl { to { transform: translateX(calc(100% + var(--reel-gap))); } }

/* ── TOOLBAR: sticks under the navbar ─────────────────────── */
.cl-toolbar { position: sticky; top: var(--navbar-height); z-index: 20; border-bottom: 1px solid var(--color-border); background: rgba(250, 248, 243, 0.86); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
.cl-toolbar { transition: transform 0.4s cubic-bezier(.22, .8, .24, 1); }
/* The navbar slides away while reading down; the toolbar follows so no strip is left above it */
:root[data-nav-hidden] .cl-toolbar { transform: translateY(calc(-1 * var(--navbar-height))); }
@media (prefers-reduced-motion: reduce) { .cl-toolbar { transition: none; } }
.cl-toolbar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding-block: var(--sp-3); }
.csearch { position: relative; flex: 1 1 260px; max-width: 380px; }
.csearch svg { position: absolute; top: 50%; inset-inline-start: 14px; width: 18px; height: 18px; transform: translateY(-50%); color: var(--color-text-secondary); pointer-events: none; }
.csearch input { width: 100%; min-height: 44px; padding: 0 var(--sp-4); padding-inline-start: 42px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-full); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 0.9375rem; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.csearch input::placeholder { color: var(--color-text-secondary); }
.csearch input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(var(--rgb-navy), 0.12); }
.ctabs { position: relative; display: inline-flex; padding: 4px; border-radius: var(--radius-full); background: rgba(var(--rgb-navy), 0.07); }
.ctabs__thumb { position: absolute; top: 4px; bottom: 4px; left: 0; width: var(--thumb-w, 0); border-radius: var(--radius-full); background: var(--color-surface); box-shadow: var(--shadow-sm); transform: translateX(var(--thumb-x, 0)); transition: transform 0.4s var(--ease-out-soft), width 0.4s var(--ease-out-soft); }
.ctabs a { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--sp-4); border-radius: var(--radius-full); color: var(--color-text-secondary); font-size: 0.9375rem; font-weight: var(--fw-semibold); text-decoration: none; white-space: nowrap; transition: color var(--transition-base); }
.ctabs a span { font-size: 0.75rem; font-variant-numeric: tabular-nums; opacity: 0.75; }
.ctabs a[aria-current="true"] { color: var(--color-primary); }
.ctabs a[hidden] { display: none; }
.ctabs a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.csort select { min-height: 44px; padding: 0 var(--sp-4); padding-inline-end: 36px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-full); background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6472' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat left 14px center; color: var(--color-text); font: inherit; font-size: 0.9375rem; appearance: none; cursor: pointer; }
html[dir="ltr"] .csort select { background-position: right 14px center; }
.csort select:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.ccount { margin: 0; margin-inline-start: auto; font-size: 0.875rem; font-weight: var(--fw-semibold); color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }

/* ── GRID OF THUMBNAILS ───────────────────────────────────────
   Unboxed: a 16:9 cover with a lesson chip like a video length, then the
   title on the page. Hover lifts the cover and scrubs a gold line along
   its bottom edge, like a video preview. */
.cl-sec { padding: clamp(2rem, 1.5rem + 2vw, 3.5rem) 0 0; scroll-margin-top: calc(var(--navbar-height) + 76px); }
.cl-sec:last-of-type { padding-bottom: clamp(3rem, 2rem + 3vw, 5rem); }
.cl-sec[hidden] { display: none; }
.cl-sec__head { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.cl-sec__head h2 { margin: 0; font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem); font-weight: var(--fw-extrabold); color: var(--color-text); }
.cl-sec__head h2::after { content: ''; display: block; width: 40px; height: 3px; margin-top: var(--sp-2); border-radius: var(--radius-full); background: var(--gradient-gold); }
.cl-sec__count { font-size: 0.875rem; font-weight: var(--fw-semibold); color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-6); margin: 0; padding: 0; list-style: none; }
.course-item { display: flex; min-width: 0; }
.course-item[hidden], .course-card[hidden] { display: none !important; }
/* Each course is one light card: the cover sits in it with a small inset,
   title and price under it. */
.course-card { position: relative; display: flex; flex-direction: column; gap: var(--sp-4); width: 100%; padding: 10px; border: 1px solid var(--color-border); border-radius: calc(var(--radius-2xl) + 4px); background: var(--color-surface); transition: transform 0.45s var(--ease-out-soft), box-shadow 0.45s var(--ease-out-soft), border-color 0.45s var(--ease-out-soft); }
.course-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-2xl); background: var(--color-background-alt); }
.course-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform 0.8s var(--ease-out-soft); }
.course-card__tags { position: absolute; top: var(--sp-3); inset-inline-start: var(--sp-3); display: flex; flex-wrap: wrap; gap: 6px; }
.ctag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: var(--fw-bold); line-height: 1.5; background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }
.ctag--free { background: var(--color-success-bg); color: var(--color-success-text); }
.ctag--paid { background: var(--brand-navy); color: var(--brand-gold-light); }
.ctag--off { background: var(--gradient-gold); color: var(--brand-navy-darker); }
.ctag--mine { background: var(--brand-navy); color: var(--brand-gold-light); }
.lesson-chip { position: absolute; bottom: var(--sp-3); inset-inline-end: var(--sp-3); display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-md); background: rgba(9, 22, 40, 0.82); color: #fff; font-size: 0.75rem; font-weight: var(--fw-semibold); line-height: 1.5; font-variant-numeric: tabular-nums; }
.lesson-chip svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.course-card__scrub { position: absolute; inset: auto 0 0; height: 3px; background: var(--brand-gold); transform: scaleX(0); transform-origin: left; }
[dir="rtl"] .course-card__scrub { transform-origin: right; }
.course-card:hover, .course-card:focus-within { transform: translateY(-5px); border-color: rgba(var(--rgb-gold), 0.5); box-shadow: 0 26px 44px -26px rgba(var(--rgb-navy), 0.5); }
.course-card:hover .course-card__media img { transform: scale(1.035); }
@media (prefers-reduced-motion: no-preference) {
  .course-card:hover .course-card__scrub, .course-card:focus-within .course-card__scrub { animation: scrub 1.4s cubic-bezier(.4, 0, .2, 1) forwards; }
}
@keyframes scrub { to { transform: scaleX(1); } }
.course-card__body { display: flex; flex: 1; flex-direction: column; gap: var(--sp-2); padding: 0 var(--sp-2) var(--sp-2); }
.course-card__title { margin: 0; font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem); font-weight: var(--fw-bold); line-height: 1.5; color: var(--color-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-card__title a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
.course-card__title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }   /* whole card is the link */
.course-card__title a:focus-visible { outline: none; }
/* The title link covers the whole card, so the ring goes on the card itself */
.course-card:has(.course-card__title a:focus-visible) { outline: 3px solid var(--color-primary); outline-offset: 3px; }
.course-card:hover .course-card__title a { color: var(--color-primary); }
.course-card__desc { margin: 0; font-size: 0.9375rem; line-height: 1.7; color: var(--color-text-secondary); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.course-card__foot { display: flex; align-items: center; gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--color-border); }
.course-price { display: inline-flex; align-items: baseline; gap: var(--sp-2); font-size: 1.1875rem; font-weight: var(--fw-extrabold); color: var(--color-text); font-variant-numeric: tabular-nums; }
.course-price--free { color: var(--color-success-text); font-size: 1rem; }
.course-price del { font-size: 0.875rem; font-weight: var(--fw-medium); color: var(--color-text-secondary); }
.course-card__cert { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8125rem; color: var(--color-text-secondary); }
.course-card__cert svg { width: 15px; height: 15px; color: var(--color-accent-text); }
.course-card__action { position: relative; z-index: 2; margin-inline-start: auto; display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--sp-4); border: 1px solid var(--color-border-strong); border-radius: var(--radius-full); font-size: 0.875rem; font-weight: var(--fw-bold); color: var(--color-primary); text-decoration: none; transition: background var(--transition-fast), color var(--transition-fast); }
.course-card__action:hover { background: var(--color-primary); color: var(--color-on-dark); }
.course-card__action--go { border: 0; background: var(--gradient-gold); color: var(--brand-navy-darker); }
.course-card__action--go:hover { background: var(--gradient-gold); color: var(--brand-navy-darker); }

/* Filtering/sorting: cards glide to their new place (View Transitions). */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-group(*) { animation-duration: 0.42s; animation-timing-function: var(--ease-out-soft); }
}

.course-empty, .course-empty-search { display: grid; justify-items: center; gap: var(--sp-3); padding: clamp(2.5rem, 2rem + 3vw, 4rem) var(--sp-6); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-2xl); background: var(--color-surface); text-align: center; }
.course-empty-search { margin-top: var(--sp-4); }
.course-empty-search[hidden] { display: none; }
.course-empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--color-primary-bg); color: var(--color-primary); }
.course-empty__icon svg { width: 28px; height: 28px; }
.course-empty h2, .course-empty-search p { margin: 0; font-size: 1.25rem; font-weight: var(--fw-bold); color: var(--color-text); }
.course-empty p { margin: 0; max-width: 46ch; color: var(--color-text-secondary); }
.course-empty .hbtn { margin-top: var(--sp-3); }

/* ── DETAILS ──────────────────────────────────────────────── */
.cd-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.cd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-4); }
.cd-desc { position: relative; max-width: 68ch; margin-top: var(--sp-4); }
.cd-desc p { margin: 0; font-size: 1.0625rem; line-height: 1.9; color: var(--color-on-dark-muted); white-space: pre-line; }
.cd-desc.is-clamped p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cd-desc__toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: var(--sp-1); padding: 0; border: 0; background: none; color: var(--brand-gold-light); font: inherit; font-weight: var(--fw-bold); cursor: pointer; }
.cd-desc__toggle svg { width: 16px; height: 16px; transition: transform var(--transition-base); }
.cd-desc__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.cd-facts { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); margin: var(--sp-6) 0 0; padding: 0; list-style: none; }
.cd-facts li { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: 0.9375rem; color: var(--color-on-dark); }
.cd-facts svg { width: 18px; height: 18px; color: var(--brand-gold-light); }

.cd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(2rem, 1rem + 3vw, 3.5rem); align-items: start; padding: clamp(2.5rem, 2rem + 2vw, 3.5rem) 0 clamp(3rem, 2rem + 3vw, 5rem); }
.cd-main { display: grid; gap: clamp(2rem, 1.5rem + 2vw, 3rem); min-width: 0; }
.cd-main > section { min-width: 0; }
.cd-outcomes li > span:last-child, .cd-lesson__title, .cd-ch__name { min-width: 0; overflow-wrap: anywhere; }
.cd-block__title { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-3); margin: 0 0 var(--sp-5); font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); font-weight: var(--fw-extrabold); color: var(--color-text); }
.cd-block__title small { font-size: 0.875rem; font-weight: var(--fw-semibold); color: var(--color-text-secondary); }

.cd-outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-6); margin: 0; padding: var(--sp-6); list-style: none; border: 1px solid var(--color-border); border-radius: var(--radius-2xl); background: var(--color-surface); }
.cd-outcomes li { display: flex; align-items: flex-start; gap: var(--sp-3); line-height: 1.75; color: var(--color-text); }
.cd-check { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-top: 3px; border-radius: 50%; background: var(--brand-gold-tint); color: var(--brand-gold-dark); }
.cd-check svg { width: 13px; height: 13px; }

.cd-curriculum { border: 1px solid var(--color-border); border-radius: var(--radius-2xl); background: var(--color-surface); overflow: hidden; }
.cd-ch + .cd-ch { border-top: 1px solid var(--color-border); }
.cd-ch summary { display: flex; align-items: center; gap: var(--sp-3); min-height: 60px; padding: var(--sp-3) var(--sp-5); cursor: pointer; list-style: none; transition: background var(--transition-fast); }
.cd-ch summary::-webkit-details-marker { display: none; }
.cd-ch summary:hover { background: var(--color-background); }
.cd-ch summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.cd-ch__num { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary-bg); color: var(--color-primary); font-size: 0.8125rem; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.cd-ch[open] .cd-ch__num { background: var(--brand-navy); color: var(--brand-gold-light); }
.cd-ch__name { flex: 1; min-width: 0; font-weight: var(--fw-bold); line-height: 1.5; color: var(--color-text); }
.cd-ch__count { flex-shrink: 0; font-size: 0.8125rem; color: var(--color-text-secondary); }
.cd-ch summary::after { content: ''; flex-shrink: 0; width: 8px; height: 8px; border-right: 2px solid var(--color-text-secondary); border-bottom: 2px solid var(--color-text-secondary); transform: rotate(45deg) translateY(-2px); transition: transform var(--transition-base); }
.cd-ch[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.cd-lessons { margin: 0; padding: 0 var(--sp-5) var(--sp-3); list-style: none; }
.cd-lesson { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px dashed var(--color-border); font-size: 0.9375rem; color: var(--color-text); }
.cd-lesson__icon { flex-shrink: 0; display: inline-flex; width: 18px; height: 18px; color: var(--color-text-secondary); }
.cd-lesson__title { flex: 1; min-width: 0; line-height: 1.6; }
.cd-lesson__title small { display: block; font-size: 0.8125rem; color: var(--color-text-secondary); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cd-lesson__type { flex-shrink: 0; font-size: 0.75rem; font-weight: var(--fw-semibold); color: var(--color-text-secondary); }
.cd-lesson__lock { flex-shrink: 0; width: 16px; height: 16px; color: var(--color-text-secondary); }

.cd-buy { position: sticky; top: calc(var(--navbar-height) + var(--sp-6)); overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-2xl); background: var(--color-surface); box-shadow: var(--shadow-lg); }
.cd-buy__media { aspect-ratio: 16 / 9; background: var(--color-background-alt); }
.cd-buy__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.cd-buy__body { display: grid; gap: var(--sp-4); padding: var(--sp-6); }
.cd-buy__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-3); font-size: 2rem; font-weight: var(--fw-extrabold); line-height: 1.1; color: var(--color-text); font-variant-numeric: tabular-nums; }
.cd-buy__price del { font-size: 1.0625rem; font-weight: var(--fw-medium); color: var(--color-text-secondary); }
.cd-buy__price--free { color: var(--color-success-text); }
.cd-buy__save { width: 100%; font-size: 0.875rem; font-weight: var(--fw-semibold); color: var(--color-success-text); }
.cd-buy .hbtn { width: 100%; }
.cd-buy form { margin: 0; }
.cd-buy button.hbtn { border: 0; cursor: pointer; font-family: inherit; }
.cd-incl { display: grid; gap: var(--sp-2); margin: 0; padding: var(--sp-4) 0 0; border-top: 1px solid var(--color-border); list-style: none; }
.cd-incl__title { margin: 0 0 var(--sp-1); font-size: 0.875rem; font-weight: var(--fw-bold); color: var(--color-text); }
.cd-incl li { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.9375rem; color: var(--color-text-secondary); }
.cd-incl svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--color-accent-text); }
.cd-owner { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.cd-owner .hbtn { min-height: 44px; font-size: 0.875rem; padding: 0 var(--sp-3); }

.cd-unlock { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-top: var(--sp-5); padding: var(--sp-5) var(--sp-6); border-radius: var(--radius-2xl); background: var(--brand-gold-tint); }
.cd-unlock p { margin: 0; font-weight: var(--fw-bold); color: var(--color-text); }
.cd-unlock form { margin: 0; }
.cd-unlock button.hbtn { border: 0; cursor: pointer; font-family: inherit; }
.cd-empty { padding: var(--sp-8); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-2xl); text-align: center; color: var(--color-text-secondary); }

/* ── CHECKOUT ─────────────────────────────────────────────── */
.co-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(1.5rem, 1rem + 2vw, 2.5rem); align-items: start; padding: clamp(2rem, 1.5rem + 2vw, 3rem) 0 clamp(3rem, 2rem + 3vw, 5rem); }
.co-card { border: 1px solid var(--color-border); border-radius: var(--radius-2xl); background: var(--color-surface); box-shadow: var(--shadow-lg); }
.co-card__body { padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); }
.co-intro { margin: 0 0 var(--sp-5); color: var(--color-text-secondary); }
.co-steps { display: grid; gap: 0; margin: 0 0 var(--sp-6); padding: 0; list-style: none; counter-reset: co; }
.co-steps li { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: var(--sp-4); padding-bottom: var(--sp-5); counter-increment: co; }
.co-steps li:last-child { padding-bottom: 0; }
.co-steps li::before { content: counter(co); display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-navy); color: var(--brand-gold-light); font-weight: var(--fw-bold); }
.co-steps li:not(:last-child)::after { content: ''; position: absolute; top: 44px; bottom: 4px; inset-inline-start: 19px; width: 2px; background: var(--color-border); }
.co-steps strong { display: block; padding-top: 7px; font-size: 1rem; color: var(--color-text); }
.co-steps span { grid-column: 2; font-size: 0.9375rem; line-height: 1.7; color: var(--color-text-secondary); }
.co-account { display: grid; gap: 2px; margin: 0 0 var(--sp-5); padding: var(--sp-4) var(--sp-5); border-radius: var(--radius-xl); background: var(--color-background); }
.co-account small { font-size: 0.8125rem; color: var(--color-text-secondary); }
.co-account strong { font-weight: var(--fw-bold); color: var(--color-text); }
.co-account span { font-size: 0.9375rem; color: var(--color-text-secondary); word-break: break-word; }
/* Dark text on WhatsApp green: white on it is about 2:1. */
.co-wa { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: 0 var(--sp-6); border-radius: var(--radius-full); background: var(--color-whatsapp); color: #052e16; font-size: 1.0625rem; font-weight: var(--fw-bold); text-decoration: none; box-shadow: 0 8px 22px -10px rgba(37, 211, 102, 0.7); transition: transform var(--transition-fast), box-shadow var(--transition-base); }
.co-wa:hover { color: #052e16; transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(37, 211, 102, 0.8); }
.co-wa svg { width: 22px; height: 22px; flex-shrink: 0; }
.co-note { margin: var(--sp-3) 0 0; text-align: center; font-size: 0.875rem; color: var(--color-text-secondary); }
.co-back { display: block; width: fit-content; margin: var(--sp-4) auto 0; padding: var(--sp-2) var(--sp-3); font-size: 0.9375rem; color: var(--color-text-secondary); text-decoration: none; }
.co-back:hover { color: var(--color-primary); }
.co-sum { position: sticky; top: calc(var(--navbar-height) + var(--sp-6)); }
.co-sum__course { display: flex; gap: var(--sp-4); padding-bottom: var(--sp-5); border-bottom: 1px solid var(--color-border); }
.co-sum__course img { flex-shrink: 0; width: 112px; height: 63px; border-radius: var(--radius-lg); object-fit: cover; background: var(--color-background-alt); }
.co-sum__course h2 { margin: 0; font-size: 1rem; font-weight: var(--fw-bold); line-height: 1.5; color: var(--color-text); }
.co-sum__course p { margin: var(--sp-1) 0 0; font-size: 0.8125rem; color: var(--color-text-secondary); }
.co-rows { margin: 0; padding: var(--sp-4) 0 0; }
.co-rows div { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; font-size: 0.9688rem; color: var(--color-text-secondary); }
.co-rows dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--color-text); }
.co-rows .co-total { margin-top: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--color-border); color: var(--color-text); font-weight: var(--fw-bold); }
.co-rows .co-total dd { font-size: 1.75rem; font-weight: var(--fw-extrabold); }
.co-save { color: var(--color-success-text) !important; }
.co-trust { display: grid; gap: var(--sp-2); margin: var(--sp-5) 0 0; padding: var(--sp-4) 0 0; border-top: 1px solid var(--color-border); list-style: none; }
.co-trust li { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.875rem; color: var(--color-text-secondary); }
.co-trust svg { width: 17px; height: 17px; color: var(--color-accent-text); }

/* ── TABLET ───────────────────────────────────────────────── */
@media (max-width: 960px) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cd-layout, .co-layout { grid-template-columns: minmax(0, 1fr); }
  .cd-buy, .co-sum { position: static; }
  .cd-side { order: -1; }
  .cd-buy { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .cd-buy__media { aspect-ratio: auto; }
  .co-sum { order: -1; }
}

/* ── PHONE ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .page-hero { padding: var(--sp-8) 0 var(--sp-6); }
  .cl-hero__actions .hbtn { width: 100%; }
  .reel { --reel-w: 148px; --reel-gap: var(--sp-3); margin-top: var(--sp-6); padding-bottom: var(--sp-6); }
  .reel li:nth-child(even) .reel__item { margin-top: var(--sp-3); }
  .cl-toolbar__inner { gap: var(--sp-2); padding-block: var(--sp-2); }
  .csearch { flex-basis: 100%; max-width: none; }
  .ctabs { flex: 1; }
  .ctabs a { flex: 1; justify-content: center; padding: 0 var(--sp-2); font-size: 0.875rem; }
  .csort select { padding-inline: var(--sp-3) 30px; font-size: 0.875rem; }
  .ccount { display: none; }

  /* Catalogue: compact rows, thumbnail on the start side, hairlines between */
  .cl-sec { scroll-margin-top: calc(var(--navbar-height) + 116px); }
  .cl-sec__head { margin-bottom: var(--sp-4); }
  .course-grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .course-card { display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; gap: var(--sp-3); padding: 8px; border-radius: var(--radius-xl); }
  .course-card:hover, .course-card:focus-within { transform: none; box-shadow: none; }
  .course-card__media { border-radius: var(--radius-lg); }
  .course-card__foot { padding-top: var(--sp-1); border-top: 0; }
  .course-card__body { padding: 0 var(--sp-1) 0 0; }
  .course-card__tags { top: 6px; inset-inline-start: 6px; }
  .course-card__tags .ctag:not(:first-child) { display: none; }
  .ctag { padding: 1px 7px; font-size: 0.6875rem; }
  .lesson-chip { bottom: 6px; inset-inline-end: 6px; padding: 1px 6px; font-size: 0.6875rem; }
  .course-card__body { gap: var(--sp-1); }
  .course-card__title { font-size: 0.9688rem; }
  .course-card__desc, .course-card__cert { display: none; }
  .course-price { font-size: 1.0625rem; }
  .course-card__action { min-height: 36px; padding: 0 var(--sp-3); font-size: 0.8125rem; }

  .cd-desc p { font-size: 1rem; }
  .cd-facts { gap: var(--sp-2) var(--sp-4); }
  .cd-facts li { font-size: 0.875rem; }
  /* Price + action first; the facts are already in the hero and the bar repeats the action. */
  .cd-buy { display: block; }
  .cd-buy__media, .cd-incl, .cd-unlock { display: none; }
  .cd-buy__body { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); }
  .cd-buy__price { font-size: 1.625rem; }
  .cd-buy__save { display: none; }
  .cd-owner { grid-column: 1 / -1; }
  .cd-outcomes { grid-template-columns: minmax(0, 1fr); padding: var(--sp-5); }
  .cd-ch summary { padding: var(--sp-3) var(--sp-4); gap: var(--sp-2); }
  .cd-ch__num { width: 28px; height: 28px; }
  .cd-lessons { padding: 0 var(--sp-4) var(--sp-2); }
  .cd-lesson__type { display: none; }
  .cd-unlock { padding: var(--sp-4); }
  .cd-unlock .hbtn { width: 100%; }

  .co-sum__course img { width: 96px; height: 54px; }
}

/* ── PREVIEW VIDEO (optional trailer) ─────────────────────────
   Only rendered when the owner uploaded one; without it every page
   above looks exactly as before. Triggers: a chip on catalogue cards,
   a pill in the course hero, and the cover in the buy card. The player
   grows out of the pressed thumbnail (course-preview.js). */
.pv-play { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.pv-play svg { width: 42%; height: 42%; margin-left: 8%; }  /* play arrows never mirror in RTL */

/* Catalogue chip: sits on the cover, above the card's stretched link */
.pv-chip { position: absolute; z-index: 2; bottom: var(--sp-3); inset-inline-start: var(--sp-3); display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding-block: 4px; padding-inline: 4px 12px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: var(--radius-full); background: rgba(9, 22, 40, 0.62); -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3); color: #fff; font: inherit; font-size: 0.75rem; font-weight: var(--fw-bold); line-height: 1; cursor: pointer; transition: background var(--transition-base), transform 0.35s var(--ease-out-soft), box-shadow var(--transition-base); }
.pv-chip__icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gradient-gold); color: var(--brand-navy-darker); }
.pv-chip__icon svg { width: 11px; height: 11px; margin-left: 1px; }
.pv-chip:hover, .pv-chip:focus-visible { background: rgba(9, 22, 40, 0.86); transform: scale(1.05); box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.6); }
.pv-chip:focus-visible { outline: 2px solid var(--brand-gold-light); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .course-card:hover .pv-chip__icon { animation: pv-pulse 1.6s ease-out infinite; }
}

/* Course hero pill */
.cd-watch { display: inline-flex; align-items: center; gap: var(--sp-3); min-height: 52px; margin-top: var(--sp-6); padding-block: 6px; padding-inline: 6px var(--sp-5); border: 1px solid var(--color-on-dark-border); border-radius: var(--radius-full); background: var(--color-on-dark-surface); color: var(--color-on-dark); font: inherit; font-weight: var(--fw-bold); cursor: pointer; transition: background var(--transition-base), border-color var(--transition-base), transform 0.35s var(--ease-out-soft); }
.cd-watch:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(var(--rgb-gold), 0.6); transform: translateY(-2px); }
.cd-watch:focus-visible { outline: 3px solid var(--brand-gold-light); outline-offset: 3px; }
.cd-watch__icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gradient-gold); color: var(--brand-navy-darker); }
.cd-watch__icon svg { width: 16px; height: 16px; margin-left: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .cd-watch__icon { animation: pv-pulse 2.4s ease-out infinite; }
}
.cd-pv-note { display: inline-block; margin: var(--sp-5) 0 0; padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-lg); background: rgba(var(--rgb-gold), 0.16); color: var(--brand-gold-light); font-size: 0.875rem; font-weight: var(--fw-semibold); }
.cd-pv-note.is-failed { background: rgba(196, 57, 44, 0.2); color: #ffc9c2; }

/* Buy-card cover becomes a play button */
.pv-cover { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 0; cursor: pointer; font: inherit; color: #fff; }
.pv-cover img { transition: transform 0.8s var(--ease-out-soft); }
.pv-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%, rgba(9, 22, 40, 0.1), rgba(9, 22, 40, 0.62)); }
.pv-cover__play { position: absolute; z-index: 1; top: 46%; left: 50%; width: 64px; height: 64px; background: rgba(255, 255, 255, 0.96); color: var(--brand-navy); box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.55); transform: translate(-50%, -50%); transition: transform 0.45s var(--ease-out-soft); }
.pv-cover__label { position: absolute; z-index: 1; inset-inline: 0; bottom: var(--sp-3); font-size: 0.9375rem; font-weight: var(--fw-bold); text-align: center; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.pv-cover:hover img { transform: scale(1.05); }
.pv-cover:hover .pv-cover__play { transform: translate(-50%, -50%) scale(1.1); }
.pv-cover:focus-visible { outline: 3px solid var(--brand-gold-light); outline-offset: -3px; }
@media (prefers-reduced-motion: no-preference) {
  .pv-cover__play { animation: pv-pulse-light 2.4s ease-out infinite; }
}

@keyframes pv-pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--rgb-gold), 0.55); } 80%, 100% { box-shadow: 0 0 0 12px rgba(var(--rgb-gold), 0); } }
@keyframes pv-pulse-light { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5), 0 12px 30px -8px rgba(0, 0, 0, 0.55); } 80%, 100% { box-shadow: 0 0 0 18px rgba(255, 255, 255, 0), 0 12px 30px -8px rgba(0, 0, 0, 0.55); } }

/* The player */
html.pv-lock { overflow: hidden; }
.pv { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: var(--sp-4); border: 0; background: transparent; color: var(--color-on-dark); overflow: auto; }
.pv[open] { display: grid; place-items: center; }
.pv::backdrop { background: rgba(5, 12, 22, 0.8); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2); }
@media (prefers-reduced-motion: no-preference) {
  .pv[open]::backdrop { animation: pv-fade 0.4s ease-out; }
  .pv.is-closing::backdrop { animation: pv-fade-out 0.34s ease-in forwards; }
}
@keyframes pv-fade { from { opacity: 0; } }
@keyframes pv-fade-out { to { opacity: 0; } }

.pv__panel { position: relative; isolation: isolate; width: min(1040px, 100%); padding: clamp(1rem, 0.75rem + 1vw, 1.5rem); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 24px; background: linear-gradient(160deg, #0f2440 0%, #0a1729 60%, #081321 100%); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8); }
/* Ambient light from the cover, like a screen glowing on a dark room */
.pv__glow { position: absolute; z-index: -1; inset: -20%; background-position: center; background-size: cover; filter: blur(70px) saturate(1.6) brightness(0.7); opacity: 0.16; pointer-events: none; }
.pv__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.pv__heading { min-width: 0; }
.pv__eyebrow { display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0 0 4px; color: var(--brand-gold-light); font-size: 0.8125rem; font-weight: var(--fw-bold); letter-spacing: 0.04em; }
.pv__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-gold); }
@media (prefers-reduced-motion: no-preference) {
  .pv[data-state="playing"] .pv__dot { animation: pv-pulse 1.6s ease-out infinite; }
}
.pv__title { margin: 0; color: #fff !important; font-size: clamp(1.0625rem, 0.95rem + 0.6vw, 1.375rem); font-weight: var(--fw-extrabold); line-height: 1.45; overflow-wrap: anywhere; }
.pv__close { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 50%; background: rgba(255, 255, 255, 0.06); color: #fff; cursor: pointer; transition: background var(--transition-fast), transform 0.35s var(--ease-out-soft); }
.pv__close svg { width: 18px; height: 18px; }
.pv__close:hover { background: rgba(255, 255, 255, 0.16); transform: rotate(90deg); }
.pv__close:focus-visible { outline: 2px solid var(--brand-gold-light); outline-offset: 2px; }

.pv__stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06); }
.pv__video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.pv__loader { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity var(--transition-base); }
.pv__loader span { width: 46px; height: 46px; border: 3px solid rgba(255, 255, 255, 0.16); border-top-color: var(--brand-gold); border-radius: 50%; animation: pv-spin 0.8s linear infinite; }
.pv[data-state="loading"] .pv__loader { opacity: 1; }
@keyframes pv-spin { to { transform: rotate(360deg); } }
.pv__msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--sp-4); padding: var(--sp-6); background: rgba(5, 12, 22, 0.85); text-align: center; }
.pv__msg[hidden] { display: none; }
.pv__msg p { margin: 0; max-width: 36ch; color: rgba(255, 255, 255, 0.86); }
.pv__retry { min-height: 44px; padding: 0 var(--sp-5); border: 1px solid rgba(255, 255, 255, 0.24); border-radius: var(--radius-full); background: transparent; color: #fff; font: inherit; font-weight: var(--fw-bold); cursor: pointer; }
.pv__retry:hover { background: rgba(255, 255, 255, 0.1); }
/* Leaves the bottom strip free so the native controls stay usable */
.pv__replay { position: absolute; inset: 0 0 56px; display: grid; place-items: center; padding: 0; border: 0; background: radial-gradient(circle, rgba(5, 12, 22, 0.6), rgba(5, 12, 22, 0.2) 70%); cursor: pointer; }
.pv__replay[hidden] { display: none; }
.pv__replay .pv-play { width: 76px; height: 76px; background: rgba(255, 255, 255, 0.96); color: var(--brand-navy); transition: transform 0.4s var(--ease-out-soft); }
.pv__replay:hover .pv-play { transform: scale(1.08); }
@media (prefers-reduced-motion: no-preference) {
  .pv__replay:not([hidden]) .pv-play { animation: pv-pop 0.5s var(--ease-out-soft) both, pv-pulse-light 2.4s 0.5s ease-out infinite; }
}
@keyframes pv-pop { from { opacity: 0; transform: scale(0.6); } }

.pv__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-3) var(--sp-5); margin-top: var(--sp-4); }
.pv__foot .hbtn { min-width: 200px; border: 0; cursor: pointer; font-family: inherit; }
.pv__price { display: inline-flex; align-items: baseline; gap: var(--sp-2); margin-inline-end: auto; color: #fff; font-size: 1.625rem; font-weight: var(--fw-extrabold); font-variant-numeric: tabular-nums; }
.pv__price del { color: rgba(255, 255, 255, 0.55); font-size: 1rem; font-weight: var(--fw-medium); }
.pv__price--free { color: #8fe0bf; font-size: 1.25rem; }
/* The end of the preview is the moment to act: the button calls for attention */
@media (prefers-reduced-motion: no-preference) {
  .pv[data-state="ended"] .pv__foot .hbtn { animation: pv-pulse 1.8s ease-out infinite; }
}

@media (max-width: 640px) {
  .pv { padding: var(--sp-2); }
  .pv__panel { padding: var(--sp-3); border-radius: 20px; }
  .pv__head { margin-bottom: var(--sp-3); }
  .pv__stage { border-radius: 12px; }
  .pv__foot .hbtn { flex: 1; min-width: 0; }
  .pv__price { font-size: 1.375rem; }
  .pv-chip { bottom: 6px; inset-inline-start: 6px; min-height: 0; padding: 3px; }
  .pv-chip__text { display: none; }
  .pv-chip__icon { width: 22px; height: 22px; }
  .cd-watch { width: 100%; justify-content: center; }
  .cd-buy .pv-cover { display: none; }   /* the hero pill does this job on phones */
}

/* Phones: the cover is a small thumbnail, so the intro video gets a text
   link in the card body instead of the chip on the cover. */
.pv-inline { display: none; }
@media (max-width: 640px) {
  .course-card .pv-chip { display: none; }
  .pv-inline { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; width: fit-content; min-height: 32px; margin: 0; padding: 0; border: 0; background: none; color: var(--color-accent-text); font: inherit; font-size: 0.8125rem; font-weight: var(--fw-bold); cursor: pointer; }
  .pv-inline__icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gradient-gold); color: var(--brand-navy-darker); }
  .pv-inline__icon svg { width: 9px; height: 9px; margin-left: 1px; }
  .pv-inline:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }
}
