/**
 * Single product.
 *
 * Measurements ported from design-references/TutorAddons Theme.dc.html lines
 * 402–558.
 *
 * The buy box is the one place where EDD's own markup is styled rather than
 * replaced: `edd_get_purchase_link()` draws the variable-pricing radio list, and
 * reimplementing that form would mean reimplementing its nonces and ajax too. The
 * `.ta-buybox .edd_price_options` rules below turn that list into the design's
 * license rows.
 */

/* -------------------------------------------------------------------------
 * Header band
 * ---------------------------------------------------------------------- */

.ta-product__head {
	border-bottom: 1px solid var(--ta-border);
	background: var(--ta-surface-softer);
}

.ta-product__head .ta-container {
	padding-block: 30px 34px;
}

.ta-product__title {
	margin-top: 10px;
	font-size: clamp(30px, 4vw, 48px);
	font-weight: 700;
}

.ta-product__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 14px;
	color: var(--ta-text-muted);
	font-size: 13.5px;
}

/* -------------------------------------------------------------------------
 * Two-column body
 * ---------------------------------------------------------------------- */

.ta-product__body {
	display: grid;
	align-items: start;
	gap: 28px;
	padding-block: 28px 70px;
	grid-template-columns: 1fr 360px;
}

@media (max-width: 1024px) {
	.ta-product__body {
		grid-template-columns: 1fr 320px;
	}
}

@media (max-width: 880px) {
	.ta-product__body {
		grid-template-columns: 1fr;
	}
}

.ta-product__side {
	position: sticky;
	top: 130px;
	display: grid;
	gap: 16px;
}

@media (max-width: 880px) {
	.ta-product__side {
		position: static;
	}
}

/* -------------------------------------------------------------------------
 * Gallery
 * ---------------------------------------------------------------------- */

.ta-gallery__stage {
	aspect-ratio: 16/10;
	border: 1px solid var(--ta-border);
	border-radius: 16px;
	background: var(--ta-placeholder);
	overflow: hidden;
}

.ta-gallery__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ta-gallery__thumbs {
	display: grid;
	gap: 10px;
	margin-top: 12px;
	grid-template-columns: repeat(4, 1fr);
}

.ta-gallery__thumb {
	aspect-ratio: 16/10;
	padding: 0;
	border: 2px solid var(--ta-border);
	border-radius: 9px;
	background: var(--ta-placeholder);
	cursor: pointer;
	overflow: hidden;
}

.ta-gallery__thumb.is-active {
	border-color: var(--ta-brand);
}

.ta-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* -------------------------------------------------------------------------
 * Documentation / preview buttons
 * ---------------------------------------------------------------------- */

.ta-product__links {
	display: grid;
	gap: 12px;
	margin-top: 16px;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.ta-btn--wide {
	padding: 14px;
	border-radius: 11px;
	font-size: 14px;
}

/* -------------------------------------------------------------------------
 * Tabs
 * ---------------------------------------------------------------------- */

.ta-tabs {
	margin-top: 28px;
}

.ta-tabs__bar {
	display: flex;
	gap: 6px;
	border-bottom: 1px solid var(--ta-border);
	overflow-x: auto;
}

.ta-tabs__btn {
	padding: 14px 16px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	color: var(--ta-text-muted);
	cursor: pointer;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 500;
	white-space: nowrap;
}

.ta-tabs__btn.is-active {
	border-bottom-color: var(--ta-brand);
	color: var(--ta-text);
	font-weight: 600;
}

.ta-tabs__panel {
	padding-top: 26px;
}

.ta-tabs__panel[hidden] {
	display: none;
}

.ta-tabs__panel .ta-accordion {
	margin-top: 0;
}

/* -------------------------------------------------------------------------
 * Long-form content inside a tab
 * ---------------------------------------------------------------------- */

.ta-prose {
	color: var(--ta-text-secondary);
	font-size: 15.5px;
	line-height: 1.8;
}

.ta-prose > * + * {
	margin-top: 18px;
}

.ta-prose h2 {
	font-size: 24px;
	font-weight: 600;
}

.ta-prose h3 {
	font-size: 20px;
	font-weight: 600;
}

/* The plugin's Tailwind preflight strips list markers globally, so editor content
 * loses its bullets unless they are put back here. */
.ta-prose ul,
.ta-prose ol {
	padding-left: 22px;
}

.ta-prose ul {
	list-style: disc;
}

.ta-prose ol {
	list-style: decimal;
}

.ta-prose li::marker {
	color: var(--ta-text-meta);
}

.ta-prose li + li {
	margin-top: 8px;
}

.ta-prose img {
	border-radius: var(--ta-radius-card);
}

.ta-prose a {
	color: var(--ta-brand);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ta-prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.ta-prose th,
.ta-prose td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--ta-border-flat);
	text-align: left;
}

.ta-prose th {
	color: var(--ta-text);
	font-weight: 600;
}

.ta-prose pre {
	padding: 18px 20px;
	border-radius: var(--ta-radius-card);
	background: var(--ta-dark);
	color: var(--ta-text-on-dark-strong);
	font-size: 13px;
	line-height: 1.7;
	overflow-x: auto;
}

.ta-prose blockquote {
	margin: 0;
	padding-left: 18px;
	border-left: 3px solid var(--ta-brand);
	color: var(--ta-text-muted);
}

/* -------------------------------------------------------------------------
 * Buy box
 * ---------------------------------------------------------------------- */

.ta-buybox {
	border: 1px solid var(--ta-border);
	border-radius: 16px;
	background: var(--ta-surface);
	box-shadow: var(--ta-shadow-box);
	overflow: hidden;
}

.ta-buybox__tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
}

.ta-buybox__tab {
	padding: 16px 10px;
	border: 0;
	border-bottom: 2px solid var(--ta-border);
	background: var(--ta-surface-softer);
	color: var(--ta-text-muted);
	cursor: pointer;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ta-buybox__tab.is-active {
	border-bottom-color: var(--ta-brand);
	background: var(--ta-surface);
	color: var(--ta-text);
}

.ta-buybox__panel {
	padding: 18px;
}

.ta-buybox__panel[hidden] {
	display: none;
}

.ta-buybox__note {
	margin-top: 10px;
	color: var(--ta-text-meta);
	font-size: 12px;
	text-align: center;
}

/* -- Licence rows -------------------------------------------------------- */

/* Markup comes from ta_purchase_variable_pricing() in inc/compat.php, which takes
 * over EDD's `edd_purchase_link_top` hook. The real input is visually hidden and
 * the label draws its own dot, so the row is entirely stylable while the input
 * still receives clicks, focus and keyboard arrows through the label. */
.ta-licenses {
	display: grid;
	gap: 10px;
}

.ta-license__input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.ta-license__label {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border: 1.5px solid var(--ta-border);
	border-radius: 11px;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ta-license__label::before {
	width: 17px;
	height: 17px;
	flex: none;
	border: 2px solid var(--ta-border-idle);
	border-radius: 50%;
	background: var(--ta-surface);
	content: '';
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ta-license__label:hover {
	border-color: var(--ta-brand-tint);
}

.ta-license__input:checked + .ta-license__label {
	border-color: var(--ta-brand);
	background: #f9fcff;
}

/* Inset shadow draws the filled dot without a second element. */
.ta-license__input:checked + .ta-license__label::before {
	border-color: var(--ta-brand);
	box-shadow: inset 0 0 0 3px var(--ta-surface), inset 0 0 0 10px var(--ta-brand);
}

.ta-license__input:focus-visible + .ta-license__label {
	outline: 2px solid var(--ta-brand);
	outline-offset: 2px;
}

.ta-license__text {
	flex: 1;
}

.ta-license__title {
	display: block;
	color: var(--ta-text);
	font-size: 14.5px;
	font-weight: 600;
}

.ta-license__sub {
	display: block;
	margin-top: 3px;
	color: var(--ta-text-meta);
	font-size: 12.5px;
}

.ta-license__price {
	color: var(--ta-text);
	font-family: var(--ta-font-heading);
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

.ta-buybox .edd_purchase_submit_wrapper {
	margin-top: 16px;
}

.ta-btn--buy {
	padding: 16px;
	border-radius: 11px;
	box-shadow: var(--ta-shadow-cta);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/* -------------------------------------------------------------------------
 * Meta table
 * ---------------------------------------------------------------------- */

.ta-metatable {
	padding-block: 4px;
	border: 1px solid var(--ta-border);
	border-radius: 16px;
	background: var(--ta-surface);
}

.ta-metatable__row {
	display: grid;
	gap: 12px;
	padding: 13px 18px;
	border-bottom: 1px solid var(--ta-surface-softer);
	font-size: 13.5px;
	grid-template-columns: 110px 1fr;
}

.ta-metatable__row:last-child {
	border-bottom: 0;
}

.ta-metatable__key {
	font-weight: 600;
}

.ta-metatable__val {
	color: var(--ta-text-muted);
}

.ta-metatable__val p {
	margin: 0;
}

/* -------------------------------------------------------------------------
 * Compatibility badges
 * ---------------------------------------------------------------------- */

.ta-compat {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	color: var(--ta-text-muted);
	font-size: 13px;
}

.ta-compat__badge {
	padding: 4px 9px;
	border-radius: 6px;
	background: var(--ta-brand-tint);
	color: var(--ta-brand-hover);
	font-size: 11.5px;
	font-weight: 600;
}

/* -------------------------------------------------------------------------
 * Related products
 * ---------------------------------------------------------------------- */

.ta-related {
	border-top: 1px solid var(--ta-border);
	background: var(--ta-surface-soft);
}

.ta-related .ta-container {
	padding-block: 48px 64px;
}

.ta-related__title {
	font-size: 26px;
	font-weight: 700;
}

.ta-related__grid {
	display: grid;
	gap: 18px;
	margin-top: 24px;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.ta-related__card {
	display: block;
	border: 1px solid var(--ta-border);
	border-radius: var(--ta-radius-card);
	background: var(--ta-surface);
	overflow: hidden;
}

.ta-related__media {
	display: grid;
	aspect-ratio: 16/10;
	place-items: center;
	background: var(--ta-placeholder);
}

.ta-related__body {
	display: block;
	padding: 16px;
}

.ta-related__name {
	display: block;
	font-family: var(--ta-font-heading);
	font-size: 16px;
	font-weight: 600;
}

.ta-related__card:hover .ta-related__name {
	color: var(--ta-brand);
}

.ta-related__price {
	display: block;
	margin-top: 7px;
	color: var(--ta-brand);
	font-size: 14px;
	font-weight: 600;
}
