.tffp-selector {
	--tffp-accent: #111111;
	--tffp-columns: 4;
	box-sizing: border-box;
	width: 100%;
}

.tffp-selector *,
.tffp-selector *::before,
.tffp-selector *::after {
	box-sizing: border-box;
}

.tffp-title {
	margin: 0 0 24px;
	font-size: clamp(26px, 4vw, 42px);
	line-height: 1.1;
	text-align: center;
}

.tffp-title.is-styled {
	width: 100%;
	margin-bottom: clamp(18px, 3vw, 28px);
	padding: clamp(15px, 2.4vw, 23px) clamp(17px, 4vw, 38px);
	color: var(--tffp-title-color, #fff);
	background: var(--tffp-title-background, #111);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 16px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
	font-size: clamp(24px, 3.6vw, 40px);
	letter-spacing: -0.015em;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

.tffp-grid {
	display: grid;
	grid-template-columns: repeat(var(--tffp-columns), minmax(0, 1fr));
	gap: 16px;
}

.tffp-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 16px;
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tffp-card:focus-within,
.tffp-card:hover {
	border-color: rgba(0, 0, 0, 0.28);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
	transform: translateY(-2px);
}

.tffp-card.is-focus-pulse {
	border-color: var(--tffp-accent);
	box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.10), 0 10px 30px rgba(0, 0, 0, 0.08);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--tffp-accent) 18%, transparent), 0 10px 30px rgba(0, 0, 0, 0.08);
	animation: tffp-focus-pulse 0.8s ease both;
}

.tffp-product-link {
	color: inherit !important;
	text-decoration: none !important;
	cursor: pointer;
}

.tffp-image {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: #f5f5f5;
	overflow: hidden;
}

.tffp-product-badge {
	position: absolute;
	z-index: 2;
	top: 12px;
	left: 12px;
	display: inline-flex;
	width: auto;
	max-width: calc(100% - 24px);
	min-height: 30px;
	padding: 7px 14px;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	color: var(--tffp-badge-color, #fff);
	font-size: 11px;
	font-weight: 900;
	line-height: 1;
	letter-spacing: 0.035em;
	text-align: center;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
	background: var(--tffp-badge-background, #d92d20);
	border-radius: 999px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
	pointer-events: none;
}

.tffp-image img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.tffp-image:hover img,
.tffp-image:focus-visible img {
	transform: scale(1.02);
}

.tffp-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	padding: 16px;
	text-align: center;
}

.tffp-product-name {
	width: 100%;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tffp-product-name > .tffp-product-link {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tffp-product-rating {
	display: inline-flex;
	min-width: 0;
	align-items: center;
	justify-content: center;
	gap: 5px;
	margin-bottom: 6px;
	font-size: 12px;
	line-height: 1;
}

.tffp-rating-stars {
	position: relative;
	display: inline-block;
	direction: ltr;
	letter-spacing: 1px;
	white-space: nowrap;
}

.tffp-rating-stars-base {
	color: #d7d7d7;
}

.tffp-rating-stars-fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	color: #f5a623;
	white-space: nowrap;
}

.tffp-rating-count {
	color: rgba(0, 0, 0, 0.64);
	font-weight: 700;
}

.tffp-product-name a:focus-visible,
.tffp-image:focus-visible {
	outline: 3px solid var(--tffp-accent);
	outline-offset: 3px;
}

.tffp-product-price {
	margin-top: 7px;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
	opacity: 1;
}

.tffp-product-price .woocommerce-Price-amount {
	font-weight: inherit;
}

.tffp-product-price del {
	font-weight: 600;
	opacity: 0.56;
}

.tffp-product-price ins {
	font-weight: 900;
	text-decoration: none;
}

.tffp-gallery-previews {
	display: flex;
	width: 100%;
	min-width: 0;
	align-items: center;
	justify-content: center;
	gap: 5px;
	margin-top: 9px;
	pointer-events: none;
	user-select: none;
}

.tffp-gallery-preview {
	display: inline-flex;
	width: 31px;
	height: 31px;
	min-width: 31px;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #f4f4f4;
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: 5px;
}

.tffp-gallery-preview img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.tffp-variation-fields {
	display: grid;
	width: 100%;
	gap: 9px;
	margin-top: 14px;
	text-align: left;
}

.tffp-variation-field {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.tffp-variation-field label {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.25;
}

.tffp-variation-select {
	width: 100%;
	min-width: 0;
	min-height: 42px;
	margin: 0;
	padding: 8px 32px 8px 10px;
	color: inherit;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	background-color: #fff;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 9px;
}

.tffp-variation-select:focus-visible {
	outline: 3px solid var(--tffp-accent);
	outline-offset: 2px;
}

.tffp-variation-select option:disabled {
	color: rgba(0, 0, 0, 0.35);
}

.tffp-variation-status {
	width: 100%;
	min-height: 18px;
	margin-top: 7px;
	font-size: 12px;
	line-height: 1.35;
	text-align: left;
	opacity: 0.68;
}

.tffp-variation-status.is-error {
	color: #b42318;
	opacity: 1;
}

.tffp-quantity {
	display: grid;
	grid-template-columns: 42px minmax(36px, auto) 42px;
	align-items: center;
	justify-content: center;
	margin-top: auto;
	padding-top: 16px;
}

.tffp-qty-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	color: #fff;
	font: inherit;
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
	background: var(--tffp-accent);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.15s ease;
}

.tffp-qty-button:not(:disabled):hover {
	transform: scale(1.05);
}

.tffp-qty-button:focus-visible,
.tffp-checkout-button:focus-visible,
.tffp-modal-close:focus-visible {
	outline: 3px solid var(--tffp-accent);
	outline-offset: 3px;
}

.tffp-qty-button:disabled {
	cursor: not-allowed;
	opacity: 0.25;
}

.tffp-product-quantity {
	min-width: 42px;
	font-size: 20px;
	font-weight: 800;
	text-align: center;
}

.tffp-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-top: 24px;
	padding: 20px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: 16px;
	box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.tffp-summary-copy {
	flex: 1;
	min-width: 0;
}

.tffp-selected-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 7px 16px;
	font-size: 17px;
}

.tffp-selected-totals {
	display: inline-flex;
	align-items: baseline;
	gap: 9px;
	white-space: nowrap;
}

.tffp-payable-total {
	font-size: 19px;
	font-weight: 900;
}

.tffp-baseline-total {
	color: #8a8a8a;
	font-size: 15px;
	font-weight: 600;
	text-decoration-thickness: 1.5px;
}

.tffp-payable-total .amount,
.tffp-baseline-total .amount {
	color: inherit;
	font: inherit;
}

.tffp-selected-denominator[hidden] {
	display: none !important;
}

.tffp-fixed-price {
	margin-top: 4px;
	font-size: 24px;
	font-weight: 800;
	line-height: 1.2;
}

.tffp-offer-description {
	max-width: 58ch;
	margin-top: 5px;
	color: #606060;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
}

.tffp-gift-benefits {
	--tffp-gift-border: #c6c6c6;
	display: grid;
	grid-template-columns: repeat(var(--tffp-gift-count, 3), minmax(0, 1fr));
	gap: 6px;
	width: min(100%, 520px);
	margin: 14px 0 5px;
}

.tffp-gift-benefit {
	position: relative;
	display: flex;
	min-width: 0;
	min-height: 86px;
	padding: 14px 5px 7px;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	overflow: visible;
	text-align: center;
	background: #fff;
	border: 1.5px dashed var(--tffp-gift-border);
	border-radius: 10px;
	transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.tffp-gift-benefit__badge {
	position: absolute;
	z-index: 2;
	top: -8px;
	left: 50%;
	max-width: calc(100% - 10px);
	padding: 2px 7px;
	overflow: hidden;
	color: var(--tffp-accent);
	font-size: 9px;
	font-weight: 900;
	line-height: 1.25;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
	background: var(--tffp-gift-border);
	border-radius: 6px;
	transform: translateX(-50%);
}

.tffp-gift-benefit__badge-locked {
	display: none;
}

.tffp-gift-benefit__visual {
	display: flex;
	min-height: 40px;
	align-items: center;
	justify-content: center;
	color: #7c7c7c;
	opacity: 0.3;
	filter: grayscale(1);
	transition: opacity 0.2s ease, filter 0.2s ease;
}

.tffp-gift-benefit__visual img,
.tffp-gift-benefit__fallback-icon {
	display: block;
	width: 40px;
	height: 40px;
	margin: 0;
	object-fit: contain;
}

.tffp-gift-benefit__title {
	display: -webkit-box;
	min-height: 25px;
	margin-top: 3px;
	overflow: hidden;
	color: #555;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.15;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.tffp-gift-benefit__state {
	position: absolute;
	z-index: 3;
	top: 7px;
	right: 6px;
	width: 16px;
	height: 16px;
	color: #777;
	background: #eef0f1;
	border-radius: 50%;
}

.tffp-gift-benefit.is-locked .tffp-gift-benefit__state::before {
	position: absolute;
	top: 7px;
	left: 5px;
	width: 6px;
	height: 5px;
	border: 1.5px solid currentColor;
	border-radius: 1px;
	box-sizing: border-box;
	content: "";
}

.tffp-gift-benefit.is-locked .tffp-gift-benefit__state::after {
	position: absolute;
	top: 3px;
	left: 6px;
	width: 4px;
	height: 5px;
	border: 1.5px solid currentColor;
	border-bottom: 0;
	border-radius: 5px 5px 0 0;
	box-sizing: border-box;
	content: "";
}

.tffp-gift-benefit.is-locked .tffp-gift-benefit__badge-unlocked {
	display: none;
}

.tffp-gift-benefit.is-locked .tffp-gift-benefit__badge-locked {
	display: inline;
}

.tffp-gift-benefit.is-locked .tffp-gift-benefit__badge {
	color: #666;
	background: #e7e9eb;
}

.tffp-gift-benefit.is-unlocked {
	background: #fff;
	border-color: var(--tffp-accent);
	border-style: solid;
	box-shadow: 0 2px 9px rgba(0, 0, 0, 0.07);
}

.tffp-gift-benefit.is-unlocked .tffp-gift-benefit__visual {
	opacity: 1;
	filter: none;
}

.tffp-gift-benefit.is-unlocked .tffp-gift-benefit__title {
	color: #3f3f3f;
}

.tffp-gift-benefit.is-unlocked .tffp-gift-benefit__state {
	color: #fff;
	background: var(--tffp-accent);
}

.tffp-gift-benefit.is-unlocked .tffp-gift-benefit__state::before {
	position: absolute;
	top: 3px;
	left: 5px;
	width: 4px;
	height: 8px;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	content: "";
	transform: rotate(45deg);
}

.tffp-progress {
	height: 7px;
	margin-top: 12px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 999px;
}

.tffp-progress > span {
	display: block;
	height: 100%;
	background: var(--tffp-accent);
	border-radius: inherit;
	transition: width 0.25s ease;
}

.tffp-status {
	min-height: 20px;
	margin-top: 7px;
	font-size: 13px;
	opacity: 0.72;
}

.tffp-status.is-error {
	color: #b42318;
	opacity: 1;
}

.tffp-selector.is-cart-sync-error .tffp-summary {
	border-color: #d92d20;
}

.tffp-checkout-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	margin: 0;
	padding: 14px 28px;
	color: #fff !important;
	font: inherit;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	background: var(--tffp-accent);
	border: 0;
	border-radius: 999px;
	appearance: none;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.tffp-checkout-button:not(.is-disabled):hover {
	color: #fff !important;
	transform: translateY(-1px);
}

.tffp-checkout-button.is-disabled {
	cursor: not-allowed;
	opacity: 0.3;
}

.tffp-selector.is-loading {
	cursor: progress;
}

/* Quantity requests are serialized internally without a visible loading state. */
.tffp-selector.is-silent-loading {
	cursor: inherit;
}

.tffp-selector.is-silent-loading .tffp-request-locked:disabled {
	cursor: pointer;
	opacity: 1;
}

body.tffp-modal-open {
	overflow: hidden;
}

.tffp-modal[hidden] {
	display: none !important;
}

.tffp-modal {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 24px;
}

.tffp-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	cursor: pointer;
}

.tffp-modal-dialog {
	position: relative;
	z-index: 1;
	width: min(1180px, calc(100vw - 48px));
	height: min(900px, calc(100vh - 48px));
	overflow: hidden;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
}

.tffp-modal-close {
	position: absolute;
	z-index: 3;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0 0 3px;
	color: #fff;
	font: inherit;
	font-size: 32px;
	font-weight: 400;
	line-height: 1;
	background: rgba(0, 0, 0, 0.82);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.tffp-modal-frame-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	background: #fff;
}

.tffp-modal-frame-wrap.is-loading::before {
	position: absolute;
	z-index: 1;
	top: 50%;
	left: 50%;
	width: 38px;
	height: 38px;
	margin: -19px 0 0 -19px;
	content: "";
	border: 4px solid rgba(0, 0, 0, 0.14);
	border-top-color: var(--tffp-accent);
	border-radius: 50%;
	animation: tffp-spin 0.8s linear infinite;
}

.tffp-modal-frame {
	display: block;
	width: 100%;
	height: 100%;
	background: #fff;
	border: 0;
}

@keyframes tffp-focus-pulse {
	0%, 100% {
		transform: translateY(0);
	}
	45% {
		transform: translateY(-3px);
	}
}

@keyframes tffp-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 980px) {
	.tffp-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.tffp-title.is-styled {
		margin-bottom: 16px;
		padding: 13px 14px;
		border-radius: 13px;
		box-shadow: 0 7px 20px rgba(0, 0, 0, 0.11);
		font-size: clamp(22px, 7vw, 30px);
		line-height: 1.14;
	}

	.tffp-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.tffp-card {
		border-radius: 12px;
	}

	.tffp-card-body {
		padding: 12px 8px;
	}

	.tffp-product-name {
		font-size: 14px;
	}

	.tffp-product-badge {
		top: 8px;
		left: 8px;
		max-width: calc(100% - 16px);
		min-height: 26px;
		padding: 5px 9px;
		font-size: 9px;
		box-shadow: 0 3px 9px rgba(0, 0, 0, 0.14);
	}

	.tffp-product-rating {
		gap: 3px;
		margin-bottom: 5px;
		font-size: 10px;
	}

	.tffp-rating-stars {
		letter-spacing: 0;
	}

	.tffp-gallery-previews {
		gap: 4px;
		margin-top: 7px;
	}

	.tffp-gallery-preview {
		width: 26px;
		height: 26px;
		min-width: 26px;
		border-radius: 4px;
	}

	.tffp-variation-select {
		min-height: 40px;
		font-size: 13px;
	}

	.tffp-quantity {
		grid-template-columns: 38px 34px 38px;
	}

	.tffp-qty-button {
		width: 38px;
		height: 38px;
	}

	.tffp-summary {
		position: sticky;
		z-index: 20;
		bottom: 8px;
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		padding: 16px;
		border-radius: 14px;
	}

	.tffp-offer-description {
		margin-top: 4px;
		font-size: 13px;
		line-height: 1.35;
	}

	.tffp-gift-benefits {
		width: 100%;
		gap: 5px;
		margin-top: 12px;
	}

	.tffp-gift-benefit {
		min-height: 78px;
		padding: 13px 3px 6px;
		border-radius: 9px;
	}

	.tffp-gift-benefit__badge {
		top: -7px;
		padding: 2px 5px;
		font-size: 8px;
	}

	.tffp-gift-benefit__visual {
		min-height: 34px;
	}

	.tffp-gift-benefit__visual img,
	.tffp-gift-benefit__fallback-icon {
		width: 34px;
		height: 34px;
	}

	.tffp-gift-benefit__title {
		min-height: 22px;
		margin-top: 2px;
		font-size: 9.5px;
		line-height: 1.15;
	}

	.tffp-gift-benefit__state {
		top: 6px;
		right: 4px;
		transform: scale(0.86);
	}

	.tffp-checkout-button {
		width: 100%;
	}

	.tffp-modal {
		padding: 0;
	}

	.tffp-modal-dialog {
		width: 100vw;
		height: 100dvh;
		max-height: 100vh;
		border-radius: 0;
	}

	.tffp-modal-close {
		top: 10px;
		right: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tffp-card,
	.tffp-image img,
	.tffp-qty-button,
	.tffp-checkout-button,
	.tffp-progress > span,
	.tffp-gift-benefit,
	.tffp-gift-benefit__visual {
		transition: none;
	}

	.tffp-card.is-focus-pulse {
		animation: none;
	}

	.tffp-modal-frame-wrap.is-loading::before {
		animation-duration: 1.8s;
	}
}
