.lex-tp-form {
	--lex-tp-blue: #1f79ad;
	--lex-tp-red: #d93831;
	--lex-tp-green: #2e7d32;
	--lex-tp-text: #1f2937;
	--lex-tp-muted: #475569;
	--lex-tp-border: #e5e7eb;
	--lex-tp-radius: 14px;
	--lex-tp-height: 56px;
}

form.cart.lex-tp-form {
	display: grid !important;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) !important;
	align-items: end !important;
	column-gap: 24px !important;
	row-gap: 12px !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	flex-wrap: initial !important;
}

form.cart.lex-tp-form::before,
form.cart.lex-tp-form::after {
	display: none !important;
}

form.cart.lex-tp-form > * {
	grid-column: 1 / -1;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0 !important;
	float: none !important;
}

form.cart.lex-tp-form > .quantity,
form.cart.lex-tp-form > .lex-tp-qty {
	grid-column: 1;
	width: 100% !important;
}

form.cart.lex-tp-form > .single_add_to_cart_button {
	grid-column: 2;
}

form.cart.lex-tp-form > .quantity.hidden,
form.cart.lex-tp-form > input[type="hidden"] {
	display: none !important;
}

form.cart.lex-tp-form > .lex-tp {
	margin-bottom: 20px !important;
}

form.cart.lex-tp-form > .lex-tp-after {
	margin-top: 12px !important;
}

/* Tier table */
.lex-tp-table-wrap {
	overflow: hidden;
	border: 1px solid var(--lex-tp-border);
	border-radius: var(--lex-tp-radius);
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.lex-tp .lex-tp-table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	table-layout: fixed;
	background: transparent;
	color: var(--lex-tp-text);
	font-size: 1em;
	line-height: 1.35;
}

.lex-tp .lex-tp-table th,
.lex-tp .lex-tp-table td {
	padding: 18px 12px;
	border: 0;
	border-right: 1px solid var(--lex-tp-border);
	border-bottom: 1px solid var(--lex-tp-border);
	background: transparent;
	color: inherit;
	text-align: center;
	vertical-align: middle;
}

.lex-tp .lex-tp-table th:last-child,
.lex-tp .lex-tp-table td:last-child {
	border-right: 0;
}

.lex-tp .lex-tp-table tbody tr:last-child td {
	border-bottom: 0;
}

.lex-tp .lex-tp-table th {
	font-size: 0.95em;
	font-weight: 700;
}

.lex-tp .lex-tp-table td {
	font-size: 1.05em;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.lex-tp .lex-tp-table tbody tr:hover > td,
.lex-tp .lex-tp-table tbody tr:nth-child(odd) > td {
	background: transparent;
}

.lex-tp .lex-tp-table .lex-tp-off {
	color: var(--lex-tp-red);
}

.lex-tp .lex-tp-table .lex-tp-offert {
	text-transform: uppercase;
}

.lex-tp .lex-tp-table tbody tr.is-active > td {
	background: var(--lex-tp-blue);
	border-right-color: rgba(255, 255, 255, 0.25);
	color: #fff;
	font-weight: 700;
}

.lex-tp .lex-tp-table .lex-tp-second {
	display: block;
	margin-top: 4px;
	font-size: 0.8em;
	font-weight: 500;
	opacity: 0.85;
}

.lex-tp .lex-tp-table tbody tr.is-active .lex-tp-off {
	color: #ffd6d6;
}

.lex-tp .lex-tp-table tbody tr.is-active .woocommerce-Price-amount {
	color: inherit;
}

/* Quantity field */
.lex-tp-form .lex-tp-label {
	display: block;
	margin: 0 !important;
	color: var(--lex-tp-muted);
	font-size: 1.05em;
	font-weight: 600;
}

.lex-tp-form .lex-tp-qty {
	display: flex !important;
	align-items: center;
	height: var(--lex-tp-height);
	padding: 0 !important;
	border: 1px solid var(--lex-tp-border) !important;
	border-radius: 12px;
	background: #fff;
	box-sizing: border-box;
	overflow: hidden;
}

.lex-tp-form .lex-tp-qty:focus-within {
	border-color: var(--lex-tp-blue) !important;
	box-shadow: 0 0 0 3px rgba(31, 121, 173, 0.15);
}

.lex-tp-form .lex-tp-qty input[type="number"] {
	flex: 1 1 auto;
	width: 100% !important;
	min-width: 0 !important;
	height: 100% !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 0 0 20px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--lex-tp-text);
	font-size: 18px !important;
	text-align: left !important;
	-moz-appearance: textfield;
	appearance: textfield;
}

.lex-tp-form .lex-tp-qty input::-webkit-outer-spin-button,
.lex-tp-form .lex-tp-qty input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.lex-tp-form .lex-tp-qty input:focus {
	outline: none;
}

.lex-tp-form .lex-tp-qty .plus,
.lex-tp-form .lex-tp-qty .minus {
	display: none !important;
}

.lex-tp-form .lex-tp-chevrons {
	display: flex;
	flex-direction: column;
	justify-content: center;
	flex: 0 0 auto;
	padding-right: 10px;
}

.lex-tp-form .lex-tp-chevrons .lex-tp-step {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 32px !important;
	height: 20px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 4px !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--lex-tp-muted) !important;
	line-height: 1 !important;
	cursor: pointer;
}

.lex-tp-form .lex-tp-chevrons .lex-tp-step:hover,
.lex-tp-form .lex-tp-chevrons .lex-tp-step:focus-visible {
	background: rgba(31, 121, 173, 0.1) !important;
	color: var(--lex-tp-blue) !important;
}

.lex-tp-form .lex-tp-chevrons svg {
	display: block;
	pointer-events: none;
}

/* Book version */
.lex-tp-form .lex-tp-select {
	position: relative;
	margin-bottom: 8px !important;
}

.lex-tp-form .lex-tp-select::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 20px;
	width: 8px;
	height: 8px;
	margin-top: -6px;
	border-right: 2px solid var(--lex-tp-muted);
	border-bottom: 2px solid var(--lex-tp-muted);
	transform: rotate(45deg);
	pointer-events: none;
}

.lex-tp-form .lex-tp-select select {
	display: block;
	width: 100% !important;
	height: var(--lex-tp-height) !important;
	margin: 0 !important;
	padding: 0 48px 0 20px !important;
	border: 1px solid var(--lex-tp-border) !important;
	border-radius: 12px !important;
	background: #fff !important;
	box-shadow: none !important;
	color: var(--lex-tp-text);
	font-size: 16px !important;
	line-height: 1.2;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.lex-tp-form .lex-tp-select select:focus {
	outline: none;
	border-color: var(--lex-tp-blue) !important;
	box-shadow: 0 0 0 3px rgba(31, 121, 173, 0.15) !important;
}

/* Add to cart button */
form.cart.lex-tp-form .single_add_to_cart_button {
	display: inline-flex !important;
	flex-direction: row !important;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	width: 100% !important;
	min-height: var(--lex-tp-height);
	padding: 0 20px !important;
	border-radius: 12px !important;
	font-size: 1.1em;
	font-weight: 600;
	white-space: nowrap;
}

/* Notes and breakdown */
.lex-tp-after {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.lex-tp-notice {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0 !important;
	color: var(--lex-tp-muted);
	font-size: 1em;
	line-height: 1.5;
}

.lex-tp-notice svg {
	flex: 0 0 auto;
	margin-top: 1px;
}

.lex-tp-notice--legal {
	padding-top: 18px;
	border-top: 1px solid var(--lex-tp-border);
}

.lex-tp-notice--legal svg {
	color: #1e293b;
}

.lex-tp-summary:empty {
	display: none;
}

.lex-tp-summary {
	padding: 16px 20px;
	border: 1px solid var(--lex-tp-border);
	border-radius: 12px;
	background: #fff;
	color: var(--lex-tp-text);
	font-size: 0.95em;
}

.lex-tp-line {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1em;
	margin: 0 0 8px;
}

.lex-tp-line:last-child {
	margin-bottom: 0;
}

.lex-tp-line strong {
	white-space: nowrap;
}

.lex-tp-line--total {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed #d1d5db;
	font-size: 1.1em;
	font-weight: 700;
}

.lex-tp-note {
	margin: 0 0 8px;
	font-size: 0.9em;
	color: var(--lex-tp-muted);
}

.lex-tp-note--extra {
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: rgba(31, 121, 173, 0.08);
	color: var(--lex-tp-text);
}

.lex-tp-ship-note {
	margin: 4px 0 0;
	color: #475569;
}

.lex-tp-free {
	font-weight: 700;
	color: var(--lex-tp-green);
	text-transform: uppercase;
}

@media (max-width: 767px) {
	form.cart.lex-tp-form {
		column-gap: 14px !important;
	}

	.lex-tp .lex-tp-table th,
	.lex-tp .lex-tp-table td {
		padding: 14px 8px;
	}

	.lex-tp .lex-tp-table th {
		font-size: 0.85em;
	}

	.lex-tp .lex-tp-table td {
		font-size: 0.95em;
	}
}

@media (max-width: 480px) {
	form.cart.lex-tp-form {
		grid-template-columns: minmax(0, 1fr) !important;
	}

	form.cart.lex-tp-form > .quantity,
	form.cart.lex-tp-form > .lex-tp-qty,
	form.cart.lex-tp-form > .single_add_to_cart_button {
		grid-column: 1 / -1;
	}

	.lex-tp .lex-tp-table th,
	.lex-tp .lex-tp-table td {
		padding: 12px 6px;
	}

	.lex-tp .lex-tp-table th {
		font-size: 0.78em;
	}

	.lex-tp .lex-tp-table td {
		font-size: 0.88em;
	}

	.lex-tp-notice {
		gap: 10px;
		font-size: 0.92em;
	}

	.lex-tp-summary {
		padding: 14px 16px;
	}
}
