/* ===========================================================================
   Course detail — the sales page
   AutomatorsX LMS

   Loaded only by views/site/course-detail.php, under the cx- prefix. The older
   cd-* rules in lms-public.css stay where they are: the learning-path page and
   the lesson preview still use them, and this page no longer does.

   Colours come from the site tokens only. Nothing here hard-codes a hex except
   the scrim over the hero artwork, which has to be black to stay a scrim.
   =========================================================================== */

/* --- Hero ---------------------------------------------------------------- */
/*
 * The one dark band on an otherwise light page. --secondary is the token that
 * is genuinely dark (#0F0F0F); --surface-dark is a light grey on the public
 * site, which is what made an earlier version of this hero render white text
 * on near-white.
 */
.cx-hero {
    position: relative;
    background: var(--secondary);
    color: #fff;
    padding: 44px 0 132px;
    overflow: hidden;
    isolation: isolate;
}

/*
 * The cover art, held to the right and faded out before it reaches the copy.
 *
 * A course cover carries its own title typography, and centred behind the hero
 * that lettering sat right under the H1 — two headlines in the same space. The
 * mask keeps the artwork to the right where the subject usually is, and the
 * left third is effectively flat ink for the text to sit on.
 */
.cx-hero-art {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: right center;
    opacity: .34;
    z-index: -2;
    -webkit-mask-image: linear-gradient(100deg, transparent 26%, rgba(0, 0, 0, .45) 47%, #000 72%);
    mask-image: linear-gradient(100deg, transparent 26%, rgba(0, 0, 0, .45) 47%, #000 72%);
}

.cx-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* A breath of brand warmth behind the artwork. */
        radial-gradient(760px 380px at 82% 6%, rgba(255, 0, 0, .13), transparent 68%),
        radial-gradient(900px 460px at 74% 18%, rgba(255, 255, 255, .07), transparent 72%),
        linear-gradient(102deg, rgba(0, 0, 0, .94) 30%, rgba(0, 0, 0, .58) 72%, rgba(0, 0, 0, .42) 100%),
        /* Settles into the band's own colour instead of stopping dead. */
        linear-gradient(to bottom, transparent 62%, rgba(0, 0, 0, .45) 100%);
    z-index: -1;
}

/* A hairline of brand at the bottom edge, so the band ends deliberately. */
.cx-hero::before {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0; height: 2px;
    background: linear-gradient(90deg, var(--primary), rgba(255, 0, 0, .16) 42%, transparent 72%);
    z-index: 1;
}

.cx-hero-inner { position: relative; }
.cx-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.cx-hero-copy { max-width: 760px; }

.cx-crumbs { display: flex; align-items: center; gap: 9px; font-size: 12.5px;
    color: rgba(255, 255, 255, .6); margin-bottom: 22px; }
.cx-crumbs a { color: rgba(255, 255, 255, .78); }
.cx-crumbs a:hover { color: #fff; text-decoration: underline; }
.cx-crumbs i { font-size: 8px; opacity: .5; }

.cx-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cx-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
    background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .15);
    color: rgba(255, 255, 255, .88); text-transform: uppercase;
    backdrop-filter: blur(6px); }
.cx-tag i { font-size: 10px; }
.cx-tag.is-accent { background: var(--primary); border-color: transparent;
    color: var(--primary-ink, #fff); box-shadow: 0 4px 18px rgba(255, 0, 0, .32); }
.cx-tag.is-free { background: rgba(43, 166, 64, .16); border-color: rgba(43, 166, 64, .4); color: #7EE2A8; }

.cx-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 4.3vw, 3.1rem);
    line-height: 1.06; letter-spacing: -.04em; font-weight: 800; margin-bottom: 15px; color: #fff;
    text-wrap: balance; text-shadow: 0 2px 24px rgba(0, 0, 0, .45); }
.cx-lead { font-size: clamp(1rem, 1.6vw, 1.14rem); line-height: 1.65;
    color: rgba(255, 255, 255, .8); max-width: 62ch; margin-bottom: 24px;
    text-shadow: 0 1px 14px rgba(0, 0, 0, .4); }

/* The instructor chip and the facts share one line — see course-detail.php. */
.cx-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }

/* Facts read as one line of instrument readings, divided rather than crowded. */
.cx-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 16px;
    font-size: 13.5px; color: rgba(255, 255, 255, .74); }
.cx-fact { display: inline-flex; align-items: center; gap: 7px; }
.cx-fact + .cx-fact::before { content: ''; width: 3px; height: 3px; border-radius: 50%;
    background: rgba(255, 255, 255, .3); margin-right: 9px; }
.cx-fact strong { color: #fff; }
.cx-fact i { color: var(--primary-light); opacity: .9; font-size: 12px; }
.cx-fact a { color: rgba(255, 255, 255, .74); text-decoration: underline; text-underline-offset: 3px; }
.cx-fact a:hover { color: #fff; }

.cx-stars { display: inline-flex; gap: 2px; color: var(--warning); }
.cx-stars .is-off { opacity: .28; }

.cx-hero-author { display: inline-flex; align-items: center; gap: 11px; flex: none;
    padding: 6px 16px 6px 6px; border-radius: 999px;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(6px);
    transition: background .18s, border-color .18s, transform .18s; }
.cx-hero-author:hover { background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .22); transform: translateY(-1px); }
.cx-hero-author img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
    border: 1px solid rgba(255, 255, 255, .2); }
.cx-hero-author small { display: block; font-size: 10.5px; text-transform: uppercase;
    letter-spacing: .07em; color: rgba(255, 255, 255, .5); }
.cx-hero-author strong { font-size: 13.5px; color: #fff; }

.cx-avatar-letter { display: grid; place-items: center; width: 36px; height: 36px;
    border-radius: 50%; background: var(--primary); color: var(--primary-ink, #fff);
    font-weight: 800; font-size: 15px; flex: none; }
.cx-avatar-letter.is-big { width: 96px; height: 96px; font-size: 34px; }
.cx-avatar-letter.is-small { width: 34px; height: 34px; font-size: 13px; }

.cx-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 26px;
    padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .1); }
.cx-tools-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
    font-weight: 800; color: rgba(255, 255, 255, .45); margin-right: 4px; }
.cx-tool { padding: 6px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13);
    color: rgba(255, 255, 255, .9); transition: background .16s, border-color .16s; }
.cx-tool:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .24); }

/* --- Jump bar ------------------------------------------------------------ */
/*
 * Sticks directly under the site header. It is the page's table of contents
 * once the hero has scrolled away, and carries the price so the offer is never
 * more than a glance away.
 *
 * --cx-nav is the fixed navbar's own height (main.php: 64px, 56px on phones).
 * Everything that sticks or gets scrolled to measures from it, so there is one
 * number to change if the header ever grows.
 */
:root { --cx-nav: 64px; }

/*
 * It slides in only once the hero has scrolled away. Left in the flow it sat
 * across the top of the price card — the card overlaps the hero, and a sticky
 * bar in that same band paints straight over it. Out of flow and off-screen
 * until it is needed, the two never share space.
 */
.cx-jump {
    position: fixed; top: var(--cx-nav); left: 0; right: 0;
    z-index: calc(var(--z-sticky, 200) - 10);
    background: var(--surface-glass, var(--surface-2));
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-115%);
    transition: transform .22s ease;
    visibility: hidden;
}
.cx-jump.is-shown { transform: none; visibility: visible; }
.cx-jump-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.cx-jump-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cx-jump-links::-webkit-scrollbar { display: none; }
.cx-jump-links a { padding: 15px 14px; font-size: 13.5px; font-weight: 600;
    color: var(--text-secondary); white-space: nowrap;
    border-bottom: 2px solid transparent; transition: color .16s, border-color .16s; }
.cx-jump-links a:hover { color: var(--text); }
.cx-jump-links a.is-current { color: var(--primary); border-bottom-color: var(--primary); }

.cx-jump-buy { display: flex; align-items: center; gap: 12px; flex: none; }
.cx-jump-price { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.cx-jump-price s { font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-left: 5px; }

/* --- Layout -------------------------------------------------------------- */
.cx-body { background: var(--bg-body); padding-bottom: 72px; }
.cx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 32px; align-items: start; }
.cx-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; padding-top: 34px; }

/*
 * The rail is pulled up over the hero, which is why the hero carries that much
 * bottom padding. The card then sticks for the rest of the page, clearing both
 * the site header and the jump bar.
 */
.cx-rail { position: sticky; top: calc(var(--cx-nav) + 66px); margin-top: -116px; }

/*
 * Anchors land below the header and the jump bar rather than under them —
 * without this, clicking "Curriculum" hides the heading it just scrolled to.
 */
#overview, #curriculum, #instructor, #reviews, #faq { scroll-margin-top: calc(var(--cx-nav) + 70px); }

/* --- Cards --------------------------------------------------------------- */
.cx-card { background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 16px; padding: 26px 28px; }
.cx-card-head { display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.cx-card-head h2 { font-family: var(--font-display); font-size: 1.3rem;
    letter-spacing: -.025em; font-weight: 800; margin: 0; }
.cx-card-note { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.cx-card-sub { font-size: 13.5px; color: var(--text-muted); margin: -8px 0 16px; }
.cx-card-sub strong { color: var(--success); }
.cx-card-link { font-size: 13px; font-weight: 700; color: var(--primary);
    display: inline-flex; align-items: center; gap: 7px; }
.cx-card-link i { font-size: 11px; }
/*
 * Full-width cards stacked, not two narrow ones side by side: a three-line
 * "What you need" next to an eleven-line "Who this is for" left a column of
 * dead space taller than the card itself. The lists split into two columns
 * inside each card instead, which is where the width actually helps.
 */
.cx-split { display: flex; flex-direction: column; gap: 22px; }

/* --- Includes strip ------------------------------------------------------ */
/*
 * Separate tiles rather than one gapless strip. The strip was a grid whose
 * background was the border colour showing through 1px gaps — so the row that
 * did not fill left a grey slab where the missing cells were. Tiles just end.
 * Three across keeps the usual six (or five, or four) tidy.
 */
.cx-includes-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    list-style: none; padding: 0; margin: 0; }
.cx-includes-strip li { background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px 14px; text-align: center; }
.cx-includes-strip i { display: block; font-size: 17px; color: var(--primary); margin-bottom: 9px; }
.cx-includes-strip strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.cx-includes-strip span { font-size: 11.5px; color: var(--text-muted); }

/* --- What you'll learn --------------------------------------------------- */
.cx-learn { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 11px 26px; list-style: none; padding: 0; margin: 0; }
.cx-learn li { display: flex; align-items: flex-start; gap: 11px; font-size: 14.2px;
    line-height: 1.6; color: var(--text-secondary); }
.cx-learn i { color: var(--success); margin-top: 5px; font-size: 11px; flex: none; }

/*
 * A checkbox drives the fold rather than a script: the hidden points are in the
 * markup either way, so they stay readable to a crawler and the toggle keeps
 * working if JavaScript does not. Off-screen rather than display:none, so it
 * remains keyboard-reachable.
 */
.cx-fold-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cx-fold-toggle:not(:checked) ~ .cx-foldable .cx-fold-extra { display: none; }

.cx-fold-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
    padding: 9px 16px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 13.5px; font-weight: 700; color: var(--primary);
    background: var(--surface-1); cursor: pointer; transition: border-color .18s, background .18s; }
.cx-fold-btn:hover { border-color: var(--primary); background: var(--primary-surface); }
.cx-fold-btn i { font-size: 10px; }
.cx-fold-toggle:focus-visible ~ .cx-fold-btn { outline: 2px solid var(--primary); outline-offset: 2px; }
.cx-fold-open, .cx-fold-close { display: inline-flex; align-items: center; gap: 8px; }
.cx-fold-close { display: none; }
.cx-fold-toggle:checked ~ .cx-fold-btn .cx-fold-open { display: none; }
.cx-fold-toggle:checked ~ .cx-fold-btn .cx-fold-close { display: inline-flex; }

/* --- Bullets ------------------------------------------------------------- */
/*
 * "What you need" and "Who this is for" reuse the two-column outcome list, so
 * all three fold at the same count and line up with each other. Only the tick
 * changes: green reads as something gained, and these are neither.
 */
.cx-needs .cx-learn i, .cx-audience .cx-learn i { color: var(--primary); }

/* --- Curriculum ---------------------------------------------------------- */
.cx-curriculum { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cx-sec { border-bottom: 1px solid var(--border); }
.cx-sec:last-child { border-bottom: 0; }

.cx-sec-head { display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 15px 18px; background: var(--surface-1); cursor: pointer;
    list-style: none; transition: background .16s; }
.cx-sec-head::-webkit-details-marker { display: none; }
.cx-sec-head:hover { background: var(--surface-hover, var(--surface-3)); }
.cx-chev { font-size: 11px; color: var(--text-muted); transition: transform .2s; flex: none; }
.cx-sec[open] .cx-chev { transform: rotate(90deg); }
.cx-sec-title { flex: 1; min-width: 0; }
.cx-sec-title strong { display: block; font-size: 14.5px; line-height: 1.35; }
.cx-sec-title small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cx-sec-meta { display: inline-flex; align-items: center; gap: 8px; flex: none;
    font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.cx-free-pill { font-style: normal; font-size: 11px; font-weight: 700; padding: 3px 8px;
    border-radius: 999px; background: var(--success-bg); color: var(--success); }

.cx-lessons { list-style: none; margin: 0; padding: 4px 0; background: var(--surface-2); }
.cx-les { display: flex; align-items: center; gap: 11px; padding: 10px 18px 10px 41px;
    font-size: 13.8px; color: var(--text-secondary); }
.cx-les + .cx-les { border-top: 1px solid var(--border-light); }
.cx-les-type { font-size: 12px; color: var(--text-muted); flex: none; }
.cx-les-title { flex: 1; min-width: 0; }
.cx-les-preview { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
    font-weight: 700; color: var(--primary); padding: 3px 9px; border-radius: 7px;
    background: var(--primary-surface); flex: none; }
.cx-les-preview:hover { background: var(--primary-glow); }
.cx-les-preview i { font-size: 9px; }
.cx-les-lock { font-size: 11px; color: var(--text-disabled); flex: none; }
.cx-les-dur { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums;
    min-width: 44px; text-align: right; flex: none; }

.cx-ghost-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px;
    border: 1px solid var(--border); border-radius: 9px; background: var(--surface-1);
    font-size: 12.5px; font-weight: 700; color: var(--text-secondary); cursor: pointer;
    transition: border-color .16s, color .16s; }
.cx-ghost-btn:hover { border-color: var(--primary); color: var(--primary); }
.cx-ghost-btn i { font-size: 11px; }

/* --- Prose --------------------------------------------------------------- */
.cx-prose { font-size: 15px; line-height: 1.78; color: var(--text-secondary); }
.cx-prose p { margin-bottom: 15px; }
.cx-prose p:last-child { margin-bottom: 0; }
.cx-prose h3 { font-size: 1.06rem; font-weight: 700; color: var(--text); margin: 22px 0 9px; }
.cx-prose ul, .cx-prose ol { margin: 0 0 15px 20px; }
.cx-prose li { margin-bottom: 7px; }
.cx-prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.cx-prose img { max-width: 100%; height: auto; border-radius: 10px; }

/* --- Instructor ---------------------------------------------------------- */
/* The id column sizes to its button, so "View profile" stays on one line. */
.cx-instructor { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; }
.cx-instructor .cx-btn { white-space: nowrap; }
.cx-instructor-id { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cx-instructor-id img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--surface-2); box-shadow: var(--shadow-md); }
.cx-instructor-body h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.cx-instructor-body h3 a { color: var(--text); }
.cx-instructor-body h3 a:hover { color: var(--primary); }
.cx-instructor-role { font-size: 13px; color: var(--primary); font-weight: 600; margin-bottom: 12px; }
.cx-instructor-bio { font-size: 14.2px; line-height: 1.7; color: var(--text-secondary); }

/* --- Reviews ------------------------------------------------------------- */
.cx-rating { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 26px;
    align-items: center; padding: 20px; border: 1px solid var(--border);
    border-radius: 12px; background: var(--surface-1); margin-bottom: 22px; }
.cx-rating-score { text-align: center; }
.cx-rating-score strong { display: block; font-family: var(--font-display);
    font-size: 2.6rem; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.cx-rating-score span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.cx-rating-bars { display: flex; flex-direction: column; gap: 7px; }
.cx-bar-row { display: grid; grid-template-columns: 42px 1fr 38px; align-items: center; gap: 10px; }
.cx-bar-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.cx-bar-label i { font-size: 9px; color: var(--warning); }
.cx-bar { display: block; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.cx-bar span { display: block; height: 100%; background: var(--warning); }
.cx-bar-pct { font-size: 12px; color: var(--text-muted); text-align: right;
    font-variant-numeric: tabular-nums; }

.cx-reviews { display: flex; flex-direction: column; gap: 16px; }
.cx-review { padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface-2); }
.cx-review-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.cx-review-head strong { display: block; font-size: 13.5px; }
.cx-review-date { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-muted); }
.cx-review h4 { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.cx-review p { font-size: 14px; line-height: 1.7; color: var(--text-secondary); margin: 0; }
.cx-review-reply { margin-top: 12px; padding: 12px 15px; border-radius: 10px;
    background: var(--surface-1); border-left: 3px solid var(--primary);
    font-size: 13.2px; line-height: 1.65; color: var(--text-secondary); }
.cx-review-reply strong { display: block; font-size: 12px; color: var(--text); margin-bottom: 4px; }

.cx-empty { display: flex; align-items: center; gap: 10px; padding: 22px;
    border: 1px dashed var(--border); border-radius: 12px;
    font-size: 14px; color: var(--text-muted); }
.cx-empty i { font-size: 17px; color: var(--text-disabled); }

.cx-review-form { padding: 20px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface-1); margin-bottom: 22px; }
.cx-review-form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cx-review-form input[type="text"], .cx-review-form textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 9px;
    font-family: inherit; font-size: 14px; background: var(--surface-2); color: var(--text);
    margin-bottom: 12px; }
.cx-review-form input[type="text"]:focus, .cx-review-form textarea:focus {
    outline: none; border-color: var(--primary); }
.cx-review-form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cx-review-note { font-size: 12px; color: var(--text-muted); }

.cx-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
    border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.cx-pill.is-pending { background: var(--warning-bg); color: var(--warning); }
.cx-pill.is-live { background: var(--success-bg); color: var(--success); }

/* Five radios in reverse order, so ~ can light every star up to the hovered one. */
.cx-stars-input { display: inline-flex; flex-direction: row-reverse;
    justify-content: flex-end; gap: 4px; margin-bottom: 14px; }
.cx-stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cx-stars-input label { font-size: 21px; color: var(--text-disabled); cursor: pointer; transition: color .12s; }
.cx-stars-input label:hover,
.cx-stars-input label:hover ~ label,
.cx-stars-input input:checked ~ label { color: var(--warning); }
.cx-stars-input input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; }

/* --- FAQ ----------------------------------------------------------------- */
.cx-faq { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cx-faq-item { border-bottom: 1px solid var(--border); }
.cx-faq-item:last-child { border-bottom: 0; }
.cx-faq-item summary { display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 15px 18px; cursor: pointer; list-style: none;
    font-size: 14.2px; font-weight: 600; background: var(--surface-2); transition: background .16s; }
.cx-faq-item summary::-webkit-details-marker { display: none; }
.cx-faq-item summary:hover { background: var(--surface-1); }
.cx-faq-item summary i { font-size: 12px; color: var(--text-muted); transition: transform .2s; flex: none; }
.cx-faq-item[open] summary i { transform: rotate(45deg); }
.cx-faq-item p { padding: 0 18px 16px; margin: 0; font-size: 14px;
    line-height: 1.7; color: var(--text-secondary); background: var(--surface-2); }

/* --- Buy box ------------------------------------------------------------- */
.cx-buybox { background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); }
.cx-buybox-media { aspect-ratio: 16 / 9; background: var(--secondary); position: relative; }
.cx-buybox-media img, .cx-buybox-media iframe, .cx-buybox-media video {
    width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.cx-buybox-placeholder { position: absolute; inset: 0; display: grid; place-items: center;
    font-size: 30px; color: rgba(255, 255, 255, .25); }
.cx-buybox-body { padding: 22px; }

.cx-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.cx-price strong { font-family: var(--font-display); font-size: 2rem; font-weight: 800;
    letter-spacing: -.03em; line-height: 1; }
.cx-price strong.is-free { color: var(--success); }
.cx-price s { font-size: 15px; color: var(--text-muted); }
.cx-save { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800;
    background: var(--success-bg); color: var(--success); }

.cx-owned { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700;
    color: var(--success); margin-bottom: 14px; }
.cx-buy-note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 10px; }

.cx-includes { list-style: none; padding: 18px 0 0; margin: 18px 0 0;
    border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 11px; }
.cx-includes li { display: flex; align-items: flex-start; gap: 11px; font-size: 13.2px;
    color: var(--text-secondary); line-height: 1.5; }
.cx-includes i { color: var(--primary); font-size: 12px; margin-top: 3px; width: 15px; flex: none; }

.cx-buybox-preview { display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 16px; padding: 10px; border-radius: 10px; border: 1px dashed var(--border);
    font-size: 13px; font-weight: 700; color: var(--primary); }
.cx-buybox-preview:hover { background: var(--primary-surface); border-style: solid; }

/* --- Buttons ------------------------------------------------------------- */
.cx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 13px 22px; border-radius: 11px; border: 1px solid transparent;
    font-family: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
    transition: background .18s, transform .18s, box-shadow .18s, border-color .18s; }
.cx-btn-primary { background: var(--primary); color: var(--primary-ink, #fff); box-shadow: var(--shadow-md); }
.cx-btn-primary:hover { background: var(--primary-hover); color: var(--primary-ink, #fff);
    transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.cx-btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.cx-btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.cx-btn-block { width: 100%; }
.cx-btn-sm { padding: 9px 16px; font-size: 13px; border-radius: 9px; }

/* --- Related ------------------------------------------------------------- */
.cx-related { margin-top: 26px; }

/* --- Phone buy bar ------------------------------------------------------- */
.cx-mobile-buy { display: none; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1080px) {
    .cx-layout { grid-template-columns: minmax(0, 1fr); }
    /* Rail first on a narrow screen: the price and the trailer are what a
       visitor came for, and the card is no longer beside the copy. */
    .cx-rail { position: static; margin-top: -108px; order: -1; }
    .cx-main { padding-top: 22px; }
    /* min(), not a flat 520px: on a 390px phone a fixed 520 made the card wider
       than the viewport, which dragged the whole page sideways and clipped the
       headline, the tool chips and the tiles. */
    .cx-buybox { max-width: min(520px, 100%); margin: 0 auto; }
}

@media (max-width: 860px) {
    .cx-hero { padding: 34px 0 128px; }
    .cx-jump-buy { display: none; }
    .cx-instructor { grid-template-columns: 1fr; gap: 16px; }
    .cx-instructor-id { flex-direction: row; align-items: center; justify-content: flex-start; }
    .cx-rating { grid-template-columns: 1fr; gap: 18px; }
    .cx-card { padding: 22px 18px; }
}

@media (max-width: 768px) {
    /* main.php drops the navbar to 56px here. */
    :root { --cx-nav: 56px; }
}

@media (max-width: 640px) {
    .cx-hero { padding: 26px 0 116px; }
    .cx-facts { gap: 8px 16px; font-size: 12.5px; }
    .cx-les { padding-left: 18px; }
    .cx-includes-strip { grid-template-columns: 1fr 1fr; }

    /* The rail card has scrolled away by now, so the offer follows the reader. */
    .cx-mobile-buy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        display: flex; align-items: center; justify-content: space-between; gap: 14px;
        padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
        background: var(--surface-2); border-top: 1px solid var(--border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, .09); }
    .cx-mobile-price strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; }
    .cx-mobile-price s { font-size: 12.5px; color: var(--text-muted); margin-left: 6px; }
    .cx-body { padding-bottom: 96px; }
}

@media (prefers-reduced-motion: reduce) {
    .cx-btn, .cx-chev, .cx-faq-item summary i { transition: none; }
    .cx-btn-primary:hover { transform: none; }
}
