/* =========================================================================
   Ollie Course — M2 · Single course page (WooCommerce single product)

   Pairs with woocommerce/content-single-product.php in this child theme.
   Scope: everything below is prefixed with .ollie-course so nothing here can
   reach the course grid, the shop archive or any other page.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Make position:sticky possible on this page at all.

   The parent theme sets `html, body { overflow-x: hidden }` (main.css L906) to
   swallow the header mega-menu, which sticks out past the viewport. The side
   effect is that <body> becomes a scroll container that never scrolls — <html>
   is what actually scrolls — so every `position: sticky` inside it silently
   behaves like `position: static`. That is why the purchase card used to scroll
   away instead of following the reader.

   `overflow-x: clip` clips exactly the same way but does *not* create a scroll
   container, so sticky works and the mega-menu still cannot widen the page.
   Browsers without `clip` support simply ignore the declaration and keep the
   theme's `hidden` — the card is then non-sticky, which is the old behaviour.
   Scoped to the product page so nothing else on the site changes.
   ------------------------------------------------------------------------- */
body.single-product {
	overflow-x: clip;
	overflow-y: visible;
}

.ollie-course {
	--ollie-accent: #23bdb8;
	--ollie-ink: #182748;
	--ollie-muted: #6f7484;
	--ollie-line: #e5e8f0;
	--ollie-card: #ffffff;
	--ollie-soft: #f5f7fb;
}

/* -------------------------------------------------------------------------
   Layout — content column + purchase sidebar.
   The parent theme sets display:flex on
   .edublink-single-product-main-content-wrapper; grid overrides it.
   ------------------------------------------------------------------------- */
.woocommerce div.product .ollie-course__layout,
.ollie-course__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	align-items: start;
	gap: 48px;
	margin-bottom: 80px;
}

.ollie-course__main {
	min-width: 0;
}

/* -------------------------------------------------------------------------
   Media
   ------------------------------------------------------------------------- */
.ollie-course__media {
	margin-bottom: 32px;
	max-width: 420px;
}

/* WooCommerce floats the gallery via `.woocommerce #content div.product
   div.images` — an ID selector — so the override has to carry #content too. */
.woocommerce #content div.product .ollie-course__media div.images,
.woocommerce-page #content div.product .ollie-course__media div.images,
.woocommerce div.product .ollie-course__media div.images {
	float: none;
	width: 100%;
	max-width: 100%;
	margin: 0;
}

.ollie-course__media img {
	border-radius: 12px;
	max-width: 100%;
	height: auto;
}

/* -------------------------------------------------------------------------
   Fact chips under the page title
   ------------------------------------------------------------------------- */
.ollie-course__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}

.ollie-course__chips li {
	background: var(--ollie-soft);
	border: 1px solid var(--ollie-line);
	border-radius: 999px;
	color: var(--ollie-ink);
	font-size: 14px;
	line-height: 1.2;
	padding: 7px 14px;
}

.ollie-course__chips li:first-child {
	background: var(--ollie-accent);
	border-color: var(--ollie-accent);
	color: #fff;
}

/*
 * The level chip is the same badge as on the course cards: the template gives
 * it `.ollie-level.ollie-level--<slug>` and the look (pill, palette,
 * fit-content width) comes from section 8 of m2-course-grid.css, which is
 * enqueued site-wide. Only what differs inside a chip row is set here — chip
 * padding, so the level lines up with its neighbours, and the :first-child
 * guard: a course whose only chip is the level must still read as a level
 * badge, not as the accent-filled category chip.
 */
.ollie-course__chips li.ollie-level,
.ollie-course__chips li.ollie-level:first-child {
	/* The badge carries `align-self: flex-start` for the card layout; inside the
	   chip row it has to stretch like every other chip, otherwise it sits 3px
	   shorter than its neighbours. */
	align-self: stretch;
	background: var(--ollie-level-bg);
	border-color: var(--ollie-level-line);
	color: var(--ollie-level-ink);
	font-size: 13px;
	font-weight: 600;
	/*
	 * `.ollie-course__chips li` (the generic chip rule above) sets
	 * `line-height: 1.2` at 2-specificity (ul-class + li), which would
	 * otherwise beat `.ollie-level`'s own `line-height: 1` (1-specificity)
	 * and bring back the optical top/bottom mismatch documented in
	 * m2-course-grid.css section 8. Restate it here, at the chip's own
	 * higher specificity, so the badge's tight, evenly-split line box wins.
	 * Centring itself still comes from `align-self: stretch` (this chip
	 * takes the row's full height) plus the base rule's
	 * `align-items: center` (which re-centres the text inside whatever
	 * height that stretch produces) — so this stays correct at any chip
	 * row height.
	 */
	line-height: 1;
	padding: 6px 14px;
}

/* -------------------------------------------------------------------------
   Star rating under the title.
   It is a <label> for the hidden Reviews radio, so it opens the Reviews tab
   without any JavaScript — hence the pointer cursor.
   ------------------------------------------------------------------------- */
.ollie-course__rating {
	align-items: center;
	cursor: pointer;
	display: inline-flex;
	gap: 10px;
	margin: -6px 0 20px;
}

/* WooCommerce's .star-rating is an inline-block with a fixed em width; the
   parent theme floats it right inside review lists, which would push it out of
   this row. */
.woocommerce .ollie-course__rating .star-rating,
.ollie-course__rating .star-rating {
	float: none;
	margin: 0;
}

.ollie-course__rating-count {
	color: var(--ollie-muted);
	font-size: 14px;
	line-height: 1.2;
}

.ollie-course__rating:hover .ollie-course__rating-count {
	color: var(--ollie-ink);
}

/* -------------------------------------------------------------------------
   Lead paragraph (product short description)
   ------------------------------------------------------------------------- */
.ollie-course__lead {
	color: var(--ollie-ink);
	font-size: 18px;
	line-height: 1.65;
	margin-bottom: 32px;
}

.ollie-course__lead p:last-child {
	margin-bottom: 0;
}

/* Products that have no description yet get a short note instead of a blank
   column. */
.ollie-course__empty {
	background: var(--ollie-soft);
	border: 1px dashed var(--ollie-line);
	border-radius: 12px;
	color: var(--ollie-muted);
	margin: 0;
	padding: 28px;
}

/* -------------------------------------------------------------------------
   Section titles
   ------------------------------------------------------------------------- */
.ollie-course__section-title {
	font-size: 24px;
	line-height: 1.3;
	margin: 0 0 20px;
}

/* -------------------------------------------------------------------------
   Grouped product ("Ollie Starter Pack") — the native children table.
   It stays native WooCommerce markup; only spacing and overflow are handled.
   ------------------------------------------------------------------------- */
.ollie-course__group {
	background: var(--ollie-soft);
	border: 1px solid var(--ollie-line);
	border-radius: 14px;
	margin-bottom: 40px;
	padding: 28px;
}

/* The parent theme makes every single-product form a flex row; a grouped
   product needs the table and the button stacked instead. */
.woocommerce div.product .ollie-course__group form.cart,
.ollie-course__group form.cart {
	display: block;
	margin: 0;
}

.ollie-course__group .woocommerce-grouped-product-list {
	display: table;
	table-layout: fixed;
	width: 100%;
	margin: 0 0 22px;
	border-collapse: collapse;
	background: var(--ollie-card);
	border-radius: 10px;
	overflow: hidden;
}

.ollie-course__group .woocommerce-grouped-product-list td {
	border-bottom: 1px solid var(--ollie-line);
	padding: 14px 16px;
	vertical-align: middle;
}

.ollie-course__group .woocommerce-grouped-product-list tr:last-child td {
	border-bottom: 0;
}

/* WooCommerce sizes the first column with
   `.woocommerce div.product form.cart .group_table td:first-child`
   (4em, centred) and the parent theme gives every .qty a 144px min-width —
   both need a more specific rule here, not !important. */
.woocommerce div.product .ollie-course__group form.cart .group_table td,
.ollie-course__group .woocommerce-grouped-product-list td {
	text-align: left;
	vertical-align: middle;
}

.woocommerce div.product .ollie-course__group form.cart .group_table td:first-child,
.ollie-course__group td.woocommerce-grouped-product-list-item__quantity {
	width: 116px;
	text-align: left;
	white-space: nowrap;
}

.ollie-course__group td.woocommerce-grouped-product-list-item__label {
	width: auto;
}

.ollie-course__group .woocommerce-grouped-product-list-item__label a {
	color: var(--ollie-ink);
	font-weight: 600;
}

.woocommerce div.product .ollie-course__group form.cart .group_table td.woocommerce-grouped-product-list-item__price,
.ollie-course__group td.woocommerce-grouped-product-list-item__price {
	width: 110px;
	white-space: nowrap;
	text-align: right;
}

.woocommerce div.product .ollie-course__group .quantity,
.ollie-course__group .quantity {
	margin: 0;
}

.woocommerce div.product .ollie-course__group form.cart .group_table .quantity .qty,
.woocommerce div.product .ollie-course__group form.cart .quantity .qty,
.ollie-course__group .quantity .qty {
	min-width: 0;
	width: 84px;
	max-width: 84px;
	height: 48px;
	margin-right: 0;
	text-align: center;
}

.woocommerce div.product .ollie-course__group form.cart .button {
	width: 100%;
}

/* Never let the table push the page sideways on narrow screens. */
.ollie-course__group form.cart {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* -------------------------------------------------------------------------
   Tabs — Overview / Curriculum / Instructor.
   CSS-only: the radio inputs are visually hidden and drive the panels, so the
   page needs no extra JavaScript file.
   ------------------------------------------------------------------------- */
.ollie-course__tab-radio {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.ollie-course__tab-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	border-bottom: 1px solid var(--ollie-line);
	margin-bottom: 28px;
}

.ollie-course__tab-label {
	border-bottom: 2px solid transparent;
	color: var(--ollie-muted);
	cursor: pointer;
	display: inline-block;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	margin-bottom: -1px;
	padding: 12px 18px;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.ollie-course__tab-label:hover {
	color: var(--ollie-ink);
}

.ollie-course__panel {
	display: none;
}

.ollie-course__tabs--single .ollie-course__panel {
	display: block;
}

#ollie-course-tab-overview:checked ~ .ollie-course__tab-nav .ollie-course__tab-label--overview,
#ollie-course-tab-curriculum:checked ~ .ollie-course__tab-nav .ollie-course__tab-label--curriculum,
#ollie-course-tab-instructor:checked ~ .ollie-course__tab-nav .ollie-course__tab-label--instructor,
#ollie-course-tab-reviews:checked ~ .ollie-course__tab-nav .ollie-course__tab-label--reviews {
	border-bottom-color: var(--ollie-accent);
	color: var(--ollie-ink);
}

#ollie-course-tab-overview:checked ~ .ollie-course__panels .ollie-course__panel--overview,
#ollie-course-tab-curriculum:checked ~ .ollie-course__panels .ollie-course__panel--curriculum,
#ollie-course-tab-instructor:checked ~ .ollie-course__panels .ollie-course__panel--instructor,
#ollie-course-tab-reviews:checked ~ .ollie-course__panels .ollie-course__panel--reviews {
	display: block;
}

/* Keyboard focus has to stay visible even though the input itself is hidden. */
.ollie-course__tab-radio:focus-visible ~ .ollie-course__tab-nav .ollie-course__tab-label {
	outline: 2px solid var(--ollie-accent);
	outline-offset: 2px;
}

.ollie-course__panel h3 {
	font-size: 20px;
	margin: 32px 0 14px;
}

.ollie-course__panel h3:first-child {
	margin-top: 0;
}

.ollie-course__panel p,
.ollie-course__panel li {
	color: var(--ollie-ink);
	line-height: 1.7;
}

.ollie-course__panel ul {
	margin: 0 0 20px;
	padding-left: 22px;
}

.ollie-course__panel ul li {
	margin-bottom: 8px;
}

.ollie-course__instructor-name {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 8px;
}

.ollie-course__instructor-note {
	color: var(--ollie-muted);
}

/* -------------------------------------------------------------------------
   Reviews panel.
   The list, stars and form are the parent theme's own review markup
   (edublink/woocommerce/single-product-reviews.php), so it is already themed;
   these rules only fit it into the tab and calm the shop-page defaults.
   ------------------------------------------------------------------------- */
.ollie-course__panel--reviews .woocommerce-Reviews-title {
	font-size: 20px;
	margin: 0 0 24px;
}

.ollie-course__panel--reviews .commentlist {
	list-style: none;
	margin: 0 0 40px;
	padding: 0;
}

.ollie-course__panel--reviews .commentlist > li {
	border-bottom: 1px solid var(--ollie-line);
	margin: 0;
	padding: 0 0 24px;
}

.ollie-course__panel--reviews .commentlist > li + li {
	padding-top: 24px;
}

.ollie-course__panel--reviews .commentlist > li:last-child {
	border-bottom: 0;
}

.ollie-course__panel--reviews .name-comment {
	font-size: 17px;
	margin: 0 0 2px;
}

.ollie-course__panel--reviews .date {
	color: var(--ollie-muted);
	font-size: 14px;
}

.ollie-course__panel--reviews .comment-text {
	color: var(--ollie-ink);
	line-height: 1.7;
}

/* The review form: keep it inside the tab and stop the theme's shop-wide
   full-bleed form styling from stretching the panel. */
.ollie-course__panel--reviews #review_form_wrapper {
	background: var(--ollie-soft);
	border: 1px solid var(--ollie-line);
	border-radius: 14px;
	padding: 28px;
}

.ollie-course__panel--reviews #reply-title {
	font-size: 20px;
	margin: 0 0 20px;
}

.ollie-course__panel--reviews .edublink-woo-comment-form input[type="text"],
.ollie-course__panel--reviews .edublink-woo-comment-form input[type="email"],
.ollie-course__panel--reviews .edublink-woo-comment-form textarea,
.ollie-course__panel--reviews .edublink-woo-comment-form select {
	max-width: 100%;
	width: 100%;
}

/* The theme leaves the field labels inline, which eats half the width of an
   already narrow input inside the tab. Put them on their own line. */
.ollie-course__panel--reviews .comment-form-author label,
.ollie-course__panel--reviews .comment-form-email label,
.ollie-course__panel--reviews .space-comment > label {
	display: block;
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 6px;
}

.ollie-course__panel--reviews .eb-custom-rating-form {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.ollie-course__panel--reviews .comment-form-cookies-consent {
	align-items: baseline;
	display: flex;
	gap: 8px;
}

.ollie-course__panel--reviews .comment-form-cookies-consent label {
	color: var(--ollie-muted);
	font-size: 14px;
	line-height: 1.5;
}

/* -------------------------------------------------------------------------
   Purchase card ("Course Includes")
   ------------------------------------------------------------------------- */
/*
 * The sticky card can only travel inside its own containing block, and the grid
 * `align-items: start` collapsed the column to exactly the card's height — so
 * `position: sticky` had nothing to stick to and the card simply scrolled away.
 * Stretching the column to the row height gives it the travel it needs.
 */
.ollie-course__aside {
	align-self: stretch;
	min-width: 0;
}

.ollie-course__card {
	background: var(--ollie-card);
	border: 1px solid var(--ollie-line);
	border-radius: 14px;
	box-shadow: 0 14px 40px rgba(24, 39, 72, 0.08);
	padding: 28px;
	position: sticky;
	top: 110px;
}

.ollie-course__price {
	color: var(--ollie-ink);
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 20px;
}

.ollie-course__price .woocommerce-Price-amount,
.ollie-course__price .amount,
.ollie-course__price ins {
	color: var(--ollie-ink);
	text-decoration: none;
}

.ollie-course__price del {
	color: var(--ollie-muted);
	font-size: 22px;
	font-weight: 500;
	margin-right: 8px;
}

.woocommerce div.product .ollie-course__price p.price,
.ollie-course__price p.price {
	color: var(--ollie-ink);
	font-size: 32px;
	font-weight: 700;
	margin: 0;
}

.ollie-course__price-free {
	color: var(--ollie-accent);
}

.ollie-course__price-tba {
	color: var(--ollie-muted);
	font-size: 20px;
	font-weight: 600;
}

.ollie-course__cart form.cart {
	margin-bottom: 24px;
}

.woocommerce div.product .ollie-course__cart form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.woocommerce div.product .ollie-course__cart form.cart .button {
	flex: 1 1 auto;
	min-width: 150px;
}

.ollie-course__aside-note {
	color: var(--ollie-muted);
	font-size: 15px;
	line-height: 1.6;
	margin-bottom: 24px;
}

.ollie-course__card-title {
	border-top: 1px solid var(--ollie-line);
	font-size: 18px;
	margin: 0;
	padding-top: 22px;
}

.ollie-course__includes {
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
}

.ollie-course__includes li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	border-bottom: 1px solid var(--ollie-line);
	padding: 11px 0;
}

.ollie-course__includes li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.ollie-course__includes-key {
	color: var(--ollie-muted);
	font-size: 15px;
}

.ollie-course__includes-value {
	color: var(--ollie-ink);
	font-weight: 600;
	text-align: right;
}

/* -------------------------------------------------------------------------
   "Courses You May Like"

   The cards inside are the shared loop template (content-product.php) and its
   stylesheet (m2-course-grid.css); nothing here reaches into the card itself —
   only the section wrapper, the heading and the row that holds them.
   ------------------------------------------------------------------------- */
.ollie-related {
	border-top: 1px solid var(--ollie-line);
	padding-top: 56px;
	margin-bottom: 20px;
}

/* 28px/700 is what demo.edublink.co uses for "Courses You May Like" and for
   every other section heading on the course-details page. */
.ollie-related__title {
	font-size: 28px;
	font-weight: 700;
	line-height: 1.43;
	margin: 0 0 32px;
}

/* .edublink-row carries -15px side margins so its columns' padding lines up
   with the page gutter. Inside the single-product column there is no such
   gutter, so pull the negative margin back to zero and let the cards' own
   padding do the spacing. */
.ollie-related .products.edublink-archive-products,
.ollie-related .products {
	margin-left: -15px;
	margin-right: -15px;
	max-width: none;
	width: auto;
}

/* Three across, whatever the parent theme's column classes say — this block is
   always three cards wide on desktop. */
.ollie-related .products > * {
	flex: 0 0 33.3333%;
	max-width: 33.3333%;
}

@media (max-width: 991px) {
	.ollie-related .products > * {
		flex: 0 0 50%;
		max-width: 50%;
	}
}

@media (max-width: 575px) {
	.ollie-related .products > * {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

/* -------------------------------------------------------------------------
   Tablet / mobile
   ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.woocommerce div.product .ollie-course__layout,
	.ollie-course__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}

	.ollie-course__main {
		order: 2;
	}

	.ollie-course__aside {
		order: 1;
	}

	.ollie-course__card {
		position: static;
	}
}

@media (max-width: 767px) {
	.ollie-course__layout {
		margin-bottom: 50px;
	}

	.ollie-course__card,
	.ollie-course__group {
		padding: 20px;
	}

	.ollie-course__lead {
		font-size: 17px;
	}

	.ollie-course__tab-nav {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.ollie-course__tab-label {
		padding: 12px 14px;
		white-space: nowrap;
	}

	/* Narrow screens: give the course name as much room as possible. */
	.ollie-course__group .woocommerce-grouped-product-list {
		table-layout: auto;
	}

	.woocommerce div.product .ollie-course__group form.cart .group_table td,
	.ollie-course__group .woocommerce-grouped-product-list td {
		padding: 10px 8px;
	}

	.woocommerce div.product .ollie-course__group form.cart .group_table td:first-child,
	.ollie-course__group td.woocommerce-grouped-product-list-item__quantity {
		width: 76px;
	}

	.woocommerce div.product .ollie-course__group form.cart .group_table .quantity .qty,
	.ollie-course__group .quantity .qty {
		width: 60px;
		max-width: 60px;
		height: 44px;
		padding-left: 4px;
		padding-right: 4px;
	}

	.woocommerce div.product .ollie-course__group form.cart .group_table td.woocommerce-grouped-product-list-item__price,
	.ollie-course__group td.woocommerce-grouped-product-list-item__price {
		width: 76px;
	}

	.ollie-course__group .woocommerce-grouped-product-list-item__label a {
		font-size: 15px;
	}

	.ollie-course__includes li {
		font-size: 15px;
	}

	.ollie-related {
		padding-top: 40px;
	}

	.ollie-related__title {
		font-size: 24px;
		margin-bottom: 24px;
	}

	.ollie-course__panel--reviews #review_form_wrapper {
		padding: 20px;
	}
}
