/* =========================================================
   Single product / course
   ========================================================= */

.tf-page--product {
	overflow-x: clip;
}

.tf-page--product .woocommerce-notices-wrapper {
	width: min(100% - 1.75rem, var(--wrap));
	margin: 1rem auto 0;
}

.tf-page--product .woocommerce-message,
.tf-page--product .woocommerce-info,
.tf-page--product .woocommerce-error {
	position: relative;
	margin: 0 0 0.75rem;
	/* Extra left padding so WooCommerce icon ::before does not merge into text */
	padding: 0.9rem 1.1rem 0.9rem 3.35rem;
	border-radius: 0.75rem;
	border: 1px solid var(--line);
	background: #fff;
	list-style: none !important;
	font-size: 0.95rem;
	line-height: 1.5;
}

.tf-page--product .woocommerce-message::before,
.tf-page--product .woocommerce-info::before,
.tf-page--product .woocommerce-error::before {
	position: absolute;
	top: 50%;
	left: 1.15rem;
	transform: translateY(-50%);
	margin: 0;
	font-size: 1.05rem;
	line-height: 1;
	speak: never;
}

.tf-page--product .woocommerce-message {
	border-color: #bbf7d0;
	background: #f0fdf4;
	color: #166534;
}

.tf-page--product .woocommerce-info {
	border-color: #bfdbfe;
	background: #eff6ff;
	color: #1e40af;
}

.tf-page--product .woocommerce-error {
	border-color: #fecaca;
	background: #fef2f2;
	color: #991b1b;
}

.tf-page--product .woocommerce-message .button,
.tf-page--product .woocommerce-info .button,
.tf-page--product .woocommerce-error .button,
.tf-page--product .woocommerce-message a.button,
.tf-page--product .woocommerce-info a.button,
.tf-page--product .woocommerce-error a.button {
	display: inline;
	margin: 0 0 0 0.45rem;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	font: inherit;
	font-weight: 700;
	font-size: inherit;
	line-height: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	cursor: pointer;
	float: none !important;
}

.tf-page--product .woocommerce-message .button:hover,
.tf-page--product .woocommerce-info .button:hover,
.tf-page--product .woocommerce-error .button:hover,
.tf-page--product .woocommerce-message a.button:hover,
.tf-page--product .woocommerce-info a.button:hover,
.tf-page--product .woocommerce-error a.button:hover {
	background: transparent !important;
	color: inherit !important;
	opacity: 0.82;
	text-decoration: underline;
}

/* Hero split */
.tf-product-hero {
	padding: clamp(1.75rem, 4vw, 2.75rem) 0 clamp(2.5rem, 5vw, 3.5rem);
	background:
		radial-gradient(ellipse 70% 55% at 0% 0%, rgba(143, 21, 40, 0.07), transparent 55%),
		radial-gradient(ellipse 55% 45% at 100% 10%, rgba(36, 84, 48, 0.06), transparent 50%),
		var(--paper);
	border-bottom: 1px solid var(--line);
}

.tf-product-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
	gap: clamp(1.5rem, 4vw, 2.75rem);
	align-items: start;
}

.tf-product-hero__media {
	margin: 0;
	aspect-ratio: 1 / 1;
	border-radius: 1rem;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--line);
	box-shadow: 0 18px 40px rgba(17, 24, 39, 0.06);
}

.tf-product-hero__media .tf-course__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	display: block;
}

.tf-product-hero__badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: var(--grad-brand);
	color: #fff;
	font-size: 4rem;
	font-weight: 800;
}

.tf-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin: 0 0 1rem;
	font-size: 0.88rem;
	color: var(--muted);
}

.tf-crumbs a {
	color: var(--muted);
	text-decoration: none;
}

.tf-crumbs a:hover {
	color: var(--brand);
}

.tf-product-hero__copy .tf-kicker {
	margin-bottom: 0.45rem;
}

.tf-product-hero__copy h1 {
	font-size: clamp(1.85rem, 3.8vw, 2.55rem);
	margin: 0 0 0.85rem;
	letter-spacing: -0.03em;
	line-height: 1.15;
}

.tf-product-hero__copy .tf-lede {
	margin: 0 0 1.25rem;
	max-width: 38rem;
	color: var(--muted);
	font-size: 1.05rem;
	line-height: 1.6;
}

.tf-product-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.65rem 1.25rem;
	margin: 0 0 1.35rem;
}

.tf-product-meta__price {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--coral);
	letter-spacing: -0.02em;
}

.tf-product-meta__price del {
	color: var(--muted);
	font-weight: 500;
	margin-right: 0.35rem;
	font-size: 0.95rem;
}

.tf-product-meta__timeline {
	margin: 0;
	color: var(--muted);
	font-size: 0.95rem;
}

.tf-product-hero__cta {
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

/* Cashfree (and similar) injects an empty widget before the cart form –
   flex gap then indents the Register button. Hide it in this row. */
.tf-product-hero__cta > *:not(form):not(.tf-btn):not(button) {
	display: none !important;
}

/* WooCommerce add-to-cart inside CTA row */
.tf-product-hero__cta form.cart {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
	margin: 0;
	padding: 0;
}

.tf-product-hero__cta .quantity {
	display: none !important; /* single enrolment units */
}

.tf-page--product .tf-product-hero__cta .single_add_to_cart_button,
.tf-page--product .tf-product-hero__cta button.button,
.tf-page--product .tf-product-hero__cta .button.alt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.9rem;
	padding: 0.65rem 1.35rem;
	border: 0 !important;
	border-radius: 0.65rem;
	background: var(--brand) !important;
	color: #fff !important;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	box-shadow: none !important;
}

.tf-page--product .tf-product-hero__cta .single_add_to_cart_button:hover,
.tf-page--product .tf-product-hero__cta button.button:hover,
.tf-page--product .tf-product-hero__cta .button.alt:hover {
	background: var(--brand-deep) !important;
	color: #fff !important;
}

/* Details + related split */
.tf-product-body {
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.7fr);
	gap: clamp(1.75rem, 4vw, 3rem);
	align-items: start;
}

.tf-product-body--related-only {
	grid-template-columns: minmax(0, 1fr);
	max-width: 28rem;
}

.tf-product-about {
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
	text-align: left;
}

.tf-product-related {
	grid-column: 2;
	grid-row: 1;
}

.tf-product-about__head {
	margin-bottom: 1.35rem;
	text-align: left;
}

.tf-product-about__head h2 {
	margin-bottom: 0;
}

.tf-product-content .tf-gt {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem 1rem;
	margin: 0 0 1.35rem;
	padding: 0 0 1rem;
	border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}

.tf-product-content .tf-gt__btn {
	appearance: none;
	border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
	background: var(--paper, #fff);
	color: var(--ink);
	font: inherit;
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	padding: 0.45rem 0.9rem;
	cursor: pointer;
	border-radius: 2px;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.tf-product-content .tf-gt__btn:hover,
.tf-product-content .tf-gt__btn:focus-visible {
	border-color: color-mix(in srgb, var(--ink) 45%, transparent);
	background: color-mix(in srgb, var(--ink) 4%, transparent);
	outline: none;
}

.tf-product-content .tf-gt__btn:disabled {
	opacity: 0.65;
	cursor: wait;
}

.tf-product-content .tf-gt__note {
	font-size: 0.86rem;
	line-height: 1.4;
	color: color-mix(in srgb, var(--ink) 62%, transparent);
}

.tf-product-body > .tf-product-related {
	position: sticky;
	/* Clear sticky .tf-chrome (topbar + nav ≈ 8.4rem) + breathing room */
	top: calc(2.65rem + 5.25rem + 1.5rem);
	min-width: 0;
	align-self: start;
	z-index: 1;
}

.tf-product-related__head {
	margin-bottom: 1rem;
}

.tf-product-related__head h2 {
	margin: 0 0 0.45rem;
	font-size: clamp(1.2rem, 2vw, 1.45rem);
}

.tf-product-related__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.85rem;
}

.tf-product-related__list > li {
	margin: 0;
}

.tf-product-related__list .tf-course {
	grid-template-rows: auto 1fr;
}

.tf-product-related__list .tf-course__media {
	aspect-ratio: 1 / 1;
}

.tf-product-related__list .tf-course__body {
	padding: 0.85rem 0.95rem 1rem;
}

.tf-product-related__list .tf-course__name {
	font-size: 0.98rem;
}

.tf-product-related__list .tf-course__excerpt {
	font-size: 0.84rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tf-product-content {
	color: var(--ink);
	font-size: 1.02rem;
	line-height: 1.7;
	text-align: left;
	padding: clamp(1.15rem, 2.5vw, 1.5rem) clamp(1.15rem, 2.8vw, 1.65rem);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 1rem;
	box-shadow: 0 10px 10px rgba(17, 24, 39, 0.03);
}

.tf-product-content > *:first-child {
	margin-top: 0;
}

.tf-product-content h2,
.tf-product-content h3,
.tf-product-content h4,
.tf-product-content .widget-title {
	margin: 1.75rem 0 0.65rem;
	font-size: 1.2rem;
	letter-spacing: -0.02em;
	line-height: 1.3;
}

.tf-product-content p {
	margin: 0 0 1rem;
	color: var(--muted);
}

.tf-product-content strong {
	color: var(--ink);
	font-weight: 650;
}

.tf-product-content ol,
.tf-product-content ul {
	margin: 0 0 1.15rem;
	padding-left: 1.25rem;
	color: var(--muted);
}

.tf-product-content li {
	margin: 0.35rem 0;
}

.tf-product-content li ul,
.tf-product-content li ol {
	margin: 0.35rem 0 0.5rem;
}

.tf-product-content a {
	color: var(--brand);
}

@media (max-width: 999.98px) {
	.tf-product-body {
		grid-template-columns: 1fr;
	}

	.tf-product-about {
		grid-column: 1;
		grid-row: 1;
	}

	.tf-product-body > .tf-product-related {
		grid-column: 1;
		grid-row: 2;
		position: static;
		padding-top: 1.5rem;
		border-top: 1px solid var(--line);
	}

	.tf-product-related__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 899.98px) {
	.tf-product-hero__grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.tf-product-hero__media {
		max-width: 22rem;
		margin-inline: auto;
	}
}

@media (max-width: 560px) {
	.tf-product-hero__media {
		max-width: none;
	}

	.tf-product-hero__cta form.cart,
	.tf-product-hero__cta {
		width: 100%;
	}

	.tf-product-hero__cta .single_add_to_cart_button,
	.tf-product-hero__cta .tf-btn {
		width: 100%;
	}

	.tf-product-related__list {
		grid-template-columns: 1fr;
	}
}
