.ts-imei-variant-selector {
	display: grid;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	flex: 0 0 100%;
	gap: 18px;
	margin: 18px 0 20px;
	padding: 18px;
	border: 1px solid #e2e5e9;
	border-radius: 14px;
	background: #fff;
}

form.cart.ts-imei-cart-form {
	flex-wrap: wrap !important;
}

/* Apply the correct row structure on first paint, before frontend.js runs. */
.ts-px-single form.cart:has(> .ts-imei-variant-selector) {
	flex-wrap: wrap !important;
}

form.cart.ts-imei-cart-form .ts-imei-variant-selector {
	width: 100%;
	flex: 0 0 100%;
}

.ts-imei-option-heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 9px;
	font-size: 14px;
	font-weight: 700;
	color: #101418;
}

.ts-imei-current-option {
	font-size: 13px;
	font-weight: 600;
	color: #5f6670;
}

.ts-imei-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ts-imei-option {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 70px;
	min-height: 42px;
	padding: 9px 14px;
	border: 1px solid #c9ced6;
	border-radius: 9px;
	background: #fff;
	box-shadow: none;
	color: #171b20;
	font: inherit;
	font-size: 13px;
	font-weight: 650;
	cursor: pointer;
	user-select: none;
	transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.ts-imei-color-option {
	gap: 8px;
	min-width: 150px;
	flex: 1 1 calc(50% - 8px);
	text-align: left;
}

.ts-imei-color-swatch {
	width: 17px;
	height: 17px;
	flex: 0 0 17px;
	border-radius: 50%;
	background: var(--ts-imei-swatch, #c9cdd2);
	box-shadow: inset 0 0 0 1px rgb(0 0 0 / 18%), 0 0 0 1px rgb(255 255 255 / 80%);
}

.ts-imei-option-text {
	line-height: 1.2;
}

.ts-imei-native-option {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.ts-imei-option:hover:not(.is-unavailable) {
	border-color: #1479e8;
}

.ts-imei-option.is-selected {
	border-color: #0879ef;
	box-shadow: 0 0 0 1px #0879ef;
	color: #075dad;
}

.ts-imei-option.is-unavailable {
	border-color: #e1e3e6;
	background: #f2f3f5;
	color: #a2a7af;
	cursor: not-allowed;
	text-decoration: line-through;
}

.ts-imei-option.is-unavailable .ts-imei-color-swatch {
	filter: grayscale(1);
	opacity: .42;
}

.ts-imei-variant-message {
	margin: -3px 0 0;
	font-size: 12px;
	font-weight: 600;
	color: #69717c;
}

.ts-imei-variant-message.is-ready {
	color: #07883f;
}

.ts-imei-price-stack {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	width: min(100%, 520px);
}

.ts-imei-price-stack > span {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ts-imei-offer-price strong {
	display: block;
	font-size: 1.22em;
	font-weight: 800;
	color: #8a6700;
}

.ts-imei-offer-label {
	display: block;
	margin-bottom: 3px;
	color: #8a6700;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .08em;
	line-height: 1;
	text-transform: uppercase;
}

.ts-imei-card-price strong {
	font-size: 1em;
	font-weight: 750;
	color: #101418;
}

.ts-imei-card-price__label {
	display: block;
	margin-bottom: 2px;
	color: #6e6e73;
	font-size: 11px;
	font-weight: 650;
	line-height: 1.25;
}

.ts-imei-price-stack--single .ts-imei-standard-price {
	display: flex;
	flex-direction: column;
	gap: 2px;
	order: 3;
	margin-top: 2px;
	padding-top: 8px;
	border-top: 1px solid #e1e3e6;
}

.ts-imei-standard-price__label,
.ts-imei-cash-price__label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.25;
}

.ts-imei-standard-price__label {
	color: #505057;
}

.ts-imei-price-stack--single .ts-imei-standard-price strong {
	display: block;
	color: #101418;
	font-size: 1.22em;
	font-weight: 800;
	text-decoration: none;
}

.ts-imei-installment-reference {
	display: block;
	color: #6e6e73;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
}

.ts-imei-price-stack--single .ts-imei-cash-price {
	display: flex;
	flex-direction: column;
	gap: 2px;
	order: 1;
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.ts-imei-cash-price__label {
	color: #8a6700;
}

.ts-imei-price-stack--single .ts-imei-cash-price strong {
	display: block;
	color: #8a6700;
	font-size: 1em;
	font-weight: 800;
	text-decoration: none;
}

.ts-imei-price-stack--single .ts-imei-cash-benefit {
	order: 2;
}

@media (min-width: 601px) {
	/* Keep the offer and its badge together, then separate the regular price. */
	.ts-imei-price-stack--single .ts-imei-cash-price {
		order: 1;
		margin-top: 0;
		padding-top: 0;
		border-top: 0;
	}

	.ts-imei-price-stack--single > .ts-imei-cash-benefit {
		order: 2;
	}

	.ts-imei-price-stack--single .ts-imei-standard-price {
		order: 3;
		margin-top: 2px;
		padding-top: 8px;
		border-top: 1px solid #e1e3e6;
	}
}

.ts-imei-cash-benefit {
	display: grid;
	grid-template-columns: 60px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
	margin-top: 7px;
	padding: 13px 15px;
	border: 1px solid #ead88f;
	border-radius: 12px;
	background: linear-gradient(135deg, #fffdf2 0%, #fff5c5 100%);
	box-shadow: 0 7px 20px rgba(183, 145, 14, .08);
	color: #342b13;
}

/* The generic price-stack child rule is more specific than the base badge
 * rule; keep the single-product offer badge as a three-column grid. */
.ts-imei-price-stack--single > .ts-imei-cash-benefit {
	display: grid;
	grid-template-columns: 108px minmax(0, 1fr) auto;
	align-items: center;
}

.ts-imei-cash-benefit__mark {
	display: inline-flex;
	width: 58px;
	height: 40px;
	align-items: center;
	justify-content: center;
	background: transparent;
	color: #101418;
	line-height: 1;
}

.ts-imei-cash-benefit__logo {
	display: block;
	width: 58px;
	height: auto;
	max-height: 40px;
	object-fit: contain;
}

.ts-imei-cash-benefit__fallback {
	font-size: 11px;
	font-weight: 800;
}

.ts-imei-cash-benefit__copy {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 2px;
}

.ts-imei-cash-benefit b {
	font-size: 13px;
	font-weight: 800;
	line-height: 1.25;
}

.ts-imei-cash-benefit small {
	font-size: 11px;
	font-weight: 500;
	line-height: 1.4;
	color: #65572a;
}

.ts-imei-payment-link {
	appearance: none;
	padding: 0;
	border: 0;
	background: transparent;
	color: #0879ef;
	font-size: 12px;
	font-weight: 650;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
}

.ts-imei-cash-benefit__action {
	align-self: center;
	white-space: nowrap;
}

.ts-imei-savings {
	display: block;
	color: #08793f;
	font-size: 12px;
	font-weight: 750;
	line-height: 1.25;
}

.ts-imei-condition-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: max-content;
	min-height: 28px;
	padding: 5px 11px;
	border: 1px solid #d9dde2;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 750;
	line-height: 1;
	box-shadow: 0 2px 8px rgba(16, 20, 24, .08);
	z-index: 4;
}

.ts-imei-condition-badge[hidden] {
	display: none !important;
}

.ts-imei-condition-badge--new_sealed {
	background: #fff;
	color: #101418;
}

.ts-imei-condition-badge--display {
	background: #149447;
	border-color: #149447;
	color: #fff;
}

.ts-imei-condition-badge--archive {
	position: absolute;
	top: 12px;
	left: 12px;
}

.ts-imei-condition-badge--single {
	margin: 0 0 10px;
}

.woocommerce ul.products li.product .price .ts-imei-price-stack {
	align-items: stretch;
	gap: 7px;
}

.woocommerce ul.products li.product .price .ts-imei-price-stack > span {
	width: 100%;
}

.woocommerce ul.products li.product .price .ts-imei-cash-benefit {
	display: none;
}

.woocommerce ul.products li.product .price .ts-imei-offer-label {
	margin-top: 2px;
	font-size: 9px;
}

.woocommerce ul.products li.product .price .ts-imei-price-stack--catalog {
	align-items: center;
	gap: 4px;
	text-align: center;
}

.ts-imei-price-stack--catalog > span {
	align-items: center;
	gap: 1px;
	width: 100%;
	text-align: center;
}

.ts-imei-price-stack--catalog .ts-imei-catalog-price-label {
	display: block;
	color: #6e6e73;
	font-size: 10px;
	font-weight: 650;
	line-height: 1.25;
}

.ts-imei-price-stack--catalog .ts-imei-catalog-standard-price strong {
	display: block;
	color: #101418;
	font-size: 20px;
	font-weight: 750;
	line-height: 1.2;
	text-decoration: none;
}

.ts-imei-price-stack--catalog .ts-imei-catalog-offer-price {
	margin-top: 3px;
	padding-top: 5px;
	border-top: 1px solid #e1e3e6;
}

.ts-imei-price-stack--catalog .ts-imei-catalog-offer-price .ts-imei-catalog-price-label,
.ts-imei-price-stack--catalog .ts-imei-catalog-offer-price strong {
	color: #8a6700;
}

.ts-imei-price-stack--catalog .ts-imei-catalog-offer-price strong {
	display: block;
	font-size: 16px;
	font-weight: 750;
	line-height: 1.2;
	text-decoration: none;
}

/* Live public gallery for the selected physical storage/color combination. */
.woocommerce-product-gallery.ts-imei-gallery-live-active > .woocommerce-product-gallery__trigger,
.woocommerce-product-gallery.ts-imei-gallery-live-active > .woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery.ts-imei-gallery-live-active > .flex-viewport,
.woocommerce-product-gallery.ts-imei-gallery-live-active > .flex-control-nav,
.woocommerce-product-gallery.ts-imei-gallery-live-active > .flex-direction-nav {
	display: none !important;
}

.ts-imei-live-gallery {
	display: grid;
	gap: 14px;
	width: 100%;
	min-height: 460px;
	padding: 18px;
	box-sizing: border-box;
	border-radius: 18px;
	background: #f6f6f8;
}

.ts-imei-live-gallery__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 400px;
}

.ts-imei-live-gallery__stage img {
	display: block;
	width: 100%;
	height: 400px;
	object-fit: contain;
}

.ts-imei-live-gallery__arrow {
	position: absolute;
	top: 50%;
	width: 44px;
	height: 44px;
	padding: 0;
	transform: translateY(-50%);
	border: 0;
	border-radius: 999px;
	background: rgba(226, 227, 230, .94);
	color: #4d5157;
	font-size: 36px;
	line-height: 40px;
	cursor: pointer;
}

.ts-imei-live-gallery__arrow--prev { left: 12px; }
.ts-imei-live-gallery__arrow--next { right: 12px; }

.ts-imei-live-gallery__dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.ts-imei-live-gallery__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #aeb2b8;
	cursor: pointer;
}

.ts-imei-live-gallery__dot.is-active {
	background: #20242a;
}

.ts-imei-live-gallery__empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 424px;
	padding: 30px;
	box-sizing: border-box;
	color: #69717c;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
}

@media (max-width: 600px) {
	.ts-imei-price-stack--single > .ts-imei-cash-benefit {
		grid-template-columns: 82px minmax(0, 1fr);
	}

	.ts-imei-price-stack--single > .ts-imei-cash-benefit .ts-imei-cash-benefit__action {
		grid-column: 2;
		margin-top: 6px;
	}

	.ts-imei-variant-selector {
		padding: 15px;
	}

	.ts-imei-option {
		flex: 1 1 calc(33.333% - 8px);
	}

	.ts-imei-color-option {
		flex-basis: calc(50% - 8px);
	}

	.ts-imei-live-gallery {
		min-height: 340px;
		padding: 12px;
	}

	.ts-imei-live-gallery__stage,
	.ts-imei-live-gallery__empty {
		min-height: 290px;
	}

	.ts-imei-live-gallery__stage img {
		height: 290px;
	}
}
