/*
 * Purchase panel for license-tier products (body.xst-license-product).
 *
 * Styles Cartzilla's own markup (style-v3 single product with radio
 * variations) — no template overrides, so parent theme updates keep
 * working. Loaded only on variable products; see functions.php.
 */

.xst-license-product {
	--xst-accent: #4e54c8;
	--xst-accent-soft: rgba(78, 84, 200, 0.07);
	--xst-accent-ring: rgba(78, 84, 200, 0.18);
	--xst-cta: #fe696a;
	--xst-cta-dark: #f34770;
	--xst-ink: #2b3445;
	--xst-muted: #7d879c;
	--xst-line: #e3e9ef;
	--xst-panel: #f7f8fc;
	--xst-ok: #2eb872;
}

/* ---------- Price range ---------- */

.xst-license-product .summary > .position-relative .price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 1.25rem !important;
	font-size: 1.75rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--xst-ink);
}

.xst-license-product .summary > .position-relative .price::before {
	content: "Choose your license";
	flex-basis: 100%;
	margin-bottom: 0.35rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--xst-muted);
}

.xst-license-product .summary .price small {
	font-size: 0.6em;
}

/* ---------- License tiles ---------- */

.xst-license-product .variations-radio-style {
	display: grid;
	gap: 0.625rem;
	margin-bottom: 1.25rem;
}

.xst-license-product .variations-radio-style .card {
	position: relative;
	border: 1.5px solid var(--xst-line) !important;
	border-radius: 0.875rem !important;
	background: #fff;
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.xst-license-product .variations-radio-style .card:hover {
	border-color: rgba(78, 84, 200, 0.45) !important;
}

.xst-license-product .variations-radio-style .card:has(.custom-control-input:checked) {
	border-color: var(--xst-accent) !important;
	background: var(--xst-accent-soft);
	box-shadow: 0 0 0 4px var(--xst-accent-ring);
}

.xst-license-product .variations-radio-style .card-header {
	padding: 1rem 1.125rem !important;
	background: transparent;
}

/* The whole tile is the click target, not just the small label. */
.xst-license-product .variations-radio-style .custom-control-label {
	position: static;
	font-size: 1rem;
	cursor: pointer;
}

.xst-license-product .variations-radio-style .custom-control-label::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	width: auto;
	height: auto;
	/* Bootstrap draws the checked dot here; the dot is drawn on ::before. */
	background: none !important;
}

.xst-license-product .variations-radio-style .custom-control {
	position: static;
	padding-left: 2rem;
}

.xst-license-product .variations-radio-style .custom-control-label::before {
	/* Centred on the name line, not the tile, so it stays put when the
	   selected tile opens its description. */
	top: 1.75rem;
	left: 1.125rem;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: -0.625rem;
	border: 1.5px solid #c4ccd8;
	background: #fff;
	box-shadow: none !important;
}

.xst-license-product .variations-radio-style .custom-control-input:checked ~ .custom-control-label::before {
	border-color: var(--xst-accent);
	background: var(--xst-accent);
	box-shadow: inset 0 0 0 3.5px #fff !important;
}

.xst-license-product .variations-radio-style .custom-control-input:focus-visible ~ .custom-control-label::before {
	outline: 2px solid var(--xst-accent);
	outline-offset: 2px;
}

.xst-license-product .variations-radio-style .card-header h5 {
	font-size: 1.25rem;
	font-weight: 600 !important;
	color: var(--xst-ink) !important;
}

.xst-license-product .variations-radio-style .card:has(.custom-control-input:checked) .card-header h5 {
	color: var(--xst-accent) !important;
}

.xst-license-product .variations-radio-style .card-body {
	padding: 0 1.125rem 0.875rem 3.125rem !important;
	font-size: 0.8125rem;
	color: var(--xst-muted);
}

.xst-license-product .variations-radio-style .card-body p:last-child {
	margin-bottom: 0;
}

/* The tile already shows the price and description; WooCommerce's
   per-variation block would repeat them under the list. */
.xst-license-product .single_variation .woocommerce-variation-price,
.xst-license-product .single_variation .woocommerce-variation-description {
	display: none;
}

/* ---------- Quantity + Add to cart ---------- */

.xst-license-product .variations_button .form-group {
	gap: 0.625rem;
	margin-bottom: 0;
}

.xst-license-product .variations_button .quantity {
	flex: 0 0 4.5rem;
	margin: 0 !important;
}

.xst-license-product .variations_button .quantity .form-control {
	width: 100%;
	height: 3.25rem;
	border: 1.5px solid var(--xst-line);
	border-radius: 0.75rem;
	font-weight: 600;
	text-align: center;
	color: var(--xst-ink);
}

.xst-license-product .single_add_to_cart_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 3.25rem;
	margin: 0 !important;
	border: 0;
	border-radius: 0.75rem;
	background: linear-gradient(135deg, var(--xst-cta) 0%, var(--xst-cta-dark) 100%);
	box-shadow: 0 10px 24px -10px rgba(243, 71, 112, 0.7);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.xst-license-product .single_add_to_cart_button:hover:not(.disabled) {
	transform: translateY(-1px);
	box-shadow: 0 14px 28px -10px rgba(243, 71, 112, 0.8);
	filter: saturate(1.1);
}

/* Until a license is picked the button is inert; say so instead of
   looking like a faded version of itself. */
.xst-license-product .single_add_to_cart_button.disabled {
	background: #eef1f6;
	box-shadow: none;
	color: #6b7489 !important;
	opacity: 1 !important;
	cursor: not-allowed;
}

/* ---------- What's included ---------- */

.xst-license-benefits {
	display: grid;
	gap: 0.5rem;
	margin: 1.125rem 0 1.25rem;
	padding: 0;
	list-style: none;
	font-size: 0.8125rem;
	color: #4b566b;
}

.xst-license-benefits li {
	position: relative;
	padding-left: 1.625rem;
}

.xst-license-benefits li::before {
	content: "";
	position: absolute;
	top: 0.1rem;
	left: 0;
	width: 1.125rem;
	height: 1.125rem;
	border-radius: 50%;
	background: rgba(46, 184, 114, 0.14);
}

.xst-license-benefits li::after {
	content: "";
	position: absolute;
	top: 0.4rem;
	left: 0.39rem;
	width: 0.35rem;
	height: 0.55rem;
	border: solid var(--xst-ok);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ---------- Sales count ---------- */

.xst-license-product .summary > .bg-secondary.rounded {
	display: inline-flex;
	align-items: center;
	margin-bottom: 1.25rem !important;
	padding: 0.4rem 0.875rem 0.4rem 0.625rem !important;
	border-radius: 999px !important;
	background: var(--xst-panel) !important;
	border: 1px solid var(--xst-line);
}

.xst-license-product .summary > .bg-secondary.rounded i {
	margin: 0 0.4rem 0 0 !important;
	font-size: 1rem !important;
	color: var(--xst-accent) !important;
}

.xst-license-product .summary > .bg-secondary.rounded .h6 {
	font-size: 0.875rem;
}

/* ---------- Product facts ---------- */

.xst-license-product .product-meta-items {
	margin: 0;
	padding: 0.25rem 1.125rem;
	border-radius: 0.875rem;
	background: var(--xst-panel);
}

.xst-license-product .product-meta-items li {
	gap: 1rem;
	margin: 0 !important;
	padding: 0.8rem 0 !important;
	border: 0 !important;
	font-size: 0.8125rem;
}

.xst-license-product .product-meta-items li + li {
	border-top: 1px solid var(--xst-line) !important;
}

.xst-license-product .product-meta-items li.product-attribute:empty {
	display: none !important;
}

.xst-license-product .product-meta-items li > span:first-child {
	flex-shrink: 0;
	font-weight: 600;
	color: var(--xst-ink) !important;
}

.xst-license-product .product-meta-items li > span:last-child {
	text-align: right;
	color: var(--xst-muted);
}

.xst-license-product .product-meta-items a {
	color: var(--xst-muted);
}

.xst-license-product .product-meta-items a:hover {
	color: var(--xst-accent);
}

/* Stock Cartzilla hides the dropdown in radio mode; keep the Clear link
   out of the way too. */
.xst-license-product .variations .reset_variations {
	display: none !important;
}

/* ---------- FAQ tab ---------- */

.xst-faq {
	display: grid;
	gap: 0.75rem;
	max-width: 52rem;
}

.xst-faq-item {
	border: 1.5px solid var(--xst-line);
	border-radius: 0.875rem;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.xst-faq-item[open] {
	border-color: rgba(78, 84, 200, 0.35);
	box-shadow: 0 10px 28px -18px rgba(78, 84, 200, 0.45);
}

.xst-faq-item summary {
	position: relative;
	padding: 1.1rem 3.25rem 1.1rem 1.25rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--xst-ink);
	list-style: none;
	cursor: pointer;
}

.xst-faq-item summary::-webkit-details-marker {
	display: none;
}

/* plus that turns into a minus */
.xst-faq-item summary::before,
.xst-faq-item summary::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 1.25rem;
	width: 0.875rem;
	height: 2px;
	margin-top: -1px;
	border-radius: 2px;
	background: var(--xst-accent);
	transition: transform 0.2s ease;
}

.xst-faq-item summary::after {
	transform: rotate(90deg);
}

.xst-faq-item[open] summary::after {
	transform: rotate(0deg);
}

.xst-faq-item summary:focus-visible {
	outline: 2px solid var(--xst-accent);
	outline-offset: 2px;
	border-radius: 0.875rem;
}

.xst-faq-answer {
	padding: 0 1.25rem 1.1rem;
	font-size: 0.9375rem;
	line-height: 1.65;
	color: #4b566b;
}

.xst-faq-answer p:last-child,
.xst-faq-answer ul:last-child {
	margin-bottom: 0;
}

/* ---------- Changelog tab ---------- */

.xst-changelog {
	position: relative;
	max-width: 52rem;
	padding-left: 1.75rem;
}

.xst-changelog::before {
	content: "";
	position: absolute;
	top: 0.5rem;
	bottom: 0.5rem;
	left: 0.375rem;
	width: 2px;
	background: var(--xst-line);
}

.xst-release {
	position: relative;
	padding-bottom: 1.75rem;
}

.xst-release:last-child {
	padding-bottom: 0;
}

.xst-release::before {
	content: "";
	position: absolute;
	top: 0.45rem;
	left: -1.75rem;
	width: 0.875rem;
	height: 0.875rem;
	border: 2px solid var(--xst-accent);
	border-radius: 50%;
	background: #fff;
}

.xst-release:first-child::before {
	background: var(--xst-accent);
	box-shadow: 0 0 0 4px var(--xst-accent-ring);
}

.xst-release h3 {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin-bottom: 0.625rem;
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--xst-ink);
}

.xst-release-latest {
	padding: 0.15rem 0.6rem;
	border-radius: 999px;
	background: var(--xst-accent-soft);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--xst-accent);
}

.xst-release ul {
	margin: 0;
	padding-left: 1.1rem;
	font-size: 0.9375rem;
	line-height: 1.65;
	color: #4b566b;
}

.xst-release p {
	font-size: 0.9375rem;
	color: #4b566b;
}
