/* TVS Floating Promo Tab — Frontend Styles */

.tvs-fc-wrap {
	position: fixed;
	z-index: var(--tvs-fc-z, 99990);
	display: inline-flex;
	align-items: center;
	transform-origin: center center;
	transition: opacity 280ms ease, visibility 280ms ease;
}

.tvs-fc-wrap.is-pending,
.tvs-fc-wrap.is-dismissed {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

/* Layer 2: handles scale + entrance/idle animations independently from button & text rotation */
.tvs-fc-stage {
	position: relative;
	display: inline-flex;
	align-items: center;
	transform: scale(var(--tvs-fc-scale, 1));
	transform-origin: center center;
}

.tvs-fc-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--tvs-fc-min-w, auto);
	max-width: var(--tvs-fc-max-w, 320px);
	padding: var(--tvs-fc-pad-y, 12px) var(--tvs-fc-pad-x, 16px);
	background: var(--tvs-fc-bg, #a31111);
	color: var(--tvs-fc-text, #ffffff) !important;
	border: var(--tvs-fc-border-width, 1px) var(--tvs-fc-border-style, solid) var(--tvs-fc-border-color, #c9a020);
	border-radius: var(--tvs-fc-radius, 0 999px 999px 0);
	box-shadow: var(--tvs-fc-shadow, 0 8px 22px rgba(0, 0, 0, 0.36));
	backdrop-filter: blur(var(--tvs-fc-blur, 0px));
	-webkit-backdrop-filter: blur(var(--tvs-fc-blur, 0px));
	font-family: var(--tvs-fc-font, inherit);
	font-size: var(--tvs-fc-font-size, 14px);
	font-weight: var(--tvs-fc-font-weight, 700);
	text-transform: var(--tvs-fc-transform, uppercase);
	letter-spacing: var(--tvs-fc-letter-spacing, 0.6px);
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
	user-select: none;
	box-sizing: border-box;
	overflow: visible;
	transition:
		background var(--tvs-fc-speed, 300ms) ease,
		color var(--tvs-fc-speed, 300ms) ease,
		border-color var(--tvs-fc-speed, 300ms) ease,
		transform var(--tvs-fc-speed, 300ms) cubic-bezier(0.22, 0.61, 0.36, 1),
		box-shadow var(--tvs-fc-speed, 300ms) ease;
}

.tvs-fc-btn:hover,
.tvs-fc-btn:focus-visible,
.tvs-fc-wrap.is-expanded .tvs-fc-btn {
	background: var(--tvs-fc-hover-bg, #c9a020);
	color: var(--tvs-fc-hover-text, #0d0d0d) !important;
	border-color: var(--tvs-fc-hover-border, #ffffff);
}

.tvs-fc-btn:focus-visible {
	outline: 2px solid var(--tvs-fc-hover-border, #ffffff);
	outline-offset: 2px;
}

/* Hover effects */
.tvs-fc-hover--lift .tvs-fc-btn:hover {
	transform: translateY(-3px);
}

.tvs-fc-hover--scale .tvs-fc-btn:hover {
	transform: scale(1.06);
}

.tvs-fc-hover--glow .tvs-fc-btn:hover {
	box-shadow: 0 0 26px var(--tvs-fc-hover-bg, #c9a020);
}

/* Layer 3: inner flex wrapper handles icon placement & vertical text rotation without flipping box corners */
.tvs-fc-inner {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--tvs-fc-gap, 8px);
}

/* Icon */
.tvs-fc-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	color: var(--tvs-fc-icon, #ffffff);
	transition: color var(--tvs-fc-speed, 300ms) ease;
}

.tvs-fc-btn:hover .tvs-fc-icon,
.tvs-fc-btn:focus-visible .tvs-fc-icon,
.tvs-fc-wrap.is-expanded .tvs-fc-icon {
	color: var(--tvs-fc-hover-icon, #0d0d0d);
}

.tvs-fc-svg,
.tvs-fc-img {
	display: block;
	width: var(--tvs-fc-icon-size, 18px);
	height: var(--tvs-fc-icon-size, 18px);
	object-fit: contain;
}

.tvs-fc-icon-text {
	font-size: var(--tvs-fc-icon-size, 18px);
	line-height: 1;
}

.tvs-fc-icon--right .tvs-fc-inner {
	flex-direction: row-reverse;
}

.tvs-fc-icon--top .tvs-fc-inner {
	flex-direction: column;
}

/* Copy & labels */
.tvs-fc-copy {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	min-width: 0;
}

.tvs-fc-sub {
	font-size: var(--tvs-fc-sub-size, 10px);
	color: var(--tvs-fc-sub-text, #f5e1a4);
	line-height: 1.1;
	margin-bottom: 2px;
	white-space: nowrap;
}

.tvs-fc-btn:hover .tvs-fc-sub {
	color: inherit;
}

.tvs-fc-labels {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
}

.tvs-fc-main,
.tvs-fc-expand {
	display: inline-block;
	white-space: nowrap;
	overflow: hidden;
	transition:
		max-width var(--tvs-fc-speed, 300ms) cubic-bezier(0.22, 0.61, 0.36, 1),
		opacity var(--tvs-fc-speed, 300ms) ease;
}

/* Pull-out mode */
.tvs-fc-mode--pull_out .tvs-fc-expand {
	max-width: 0;
	opacity: 0;
}

.tvs-fc-mode--pull_out .tvs-fc-main {
	max-width: 240px;
	opacity: 1;
}

.tvs-fc-mode--pull_out .tvs-fc-btn:hover .tvs-fc-expand,
.tvs-fc-mode--pull_out .tvs-fc-btn:focus-visible .tvs-fc-expand,
.tvs-fc-mode--pull_out.is-expanded .tvs-fc-expand {
	max-width: 320px;
	opacity: 1;
}

.tvs-fc-mode--pull_out .tvs-fc-btn:hover .tvs-fc-labels.has-swap .tvs-fc-main,
.tvs-fc-mode--pull_out .tvs-fc-btn:focus-visible .tvs-fc-labels.has-swap .tvs-fc-main,
.tvs-fc-mode--pull_out.is-expanded .tvs-fc-labels.has-swap .tvs-fc-main {
	max-width: 0;
	opacity: 0;
}

/* When pull-out has only expanded text and no resting label, collapse gap at rest */
.tvs-fc-mode--pull_out .tvs-fc-btn:not(:hover):not(:focus-visible) .tvs-fc-copy:has(.tvs-fc-expand:only-child) {
	margin-left: calc(var(--tvs-fc-gap, 8px) * -1);
}

.tvs-fc-mode--pull_out.is-expanded .tvs-fc-copy:has(.tvs-fc-expand:only-child) {
	margin-left: 0;
}

/* Vertical text rotation applied cleanly to inner text/icon only */
.tvs-fc-rot---90 .tvs-fc-inner,
.tvs-fc-rot--90 .tvs-fc-inner {
	writing-mode: vertical-rl;
}

.tvs-fc-rot---90 .tvs-fc-inner {
	transform: rotate(180deg);
}

/* Circle FAB mode + floating tooltip */
.tvs-fc-mode--circle_fab .tvs-fc-btn {
	width: calc(var(--tvs-fc-icon-size, 18px) + var(--tvs-fc-pad-y, 12px) * 2);
	height: calc(var(--tvs-fc-icon-size, 18px) + var(--tvs-fc-pad-y, 12px) * 2);
	padding: 0;
	min-width: 0;
}

.tvs-fc-mode--circle_fab .tvs-fc-copy {
	position: absolute;
	top: 50%;
	left: calc(100% + 10px);
	transform: translateY(-50%) translateX(-6px);
	padding: 7px 12px;
	border-radius: 6px;
	background: #141414;
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
	opacity: 0;
	pointer-events: none;
	transition: opacity 200ms ease, transform 200ms ease;
}

.tvs-fc-mode--circle_fab[data-pos-desktop^="right-"] .tvs-fc-copy,
.tvs-fc-mode--circle_fab[data-pos-desktop$="-right"] .tvs-fc-copy {
	left: auto;
	right: calc(100% + 10px);
	transform: translateY(-50%) translateX(6px);
}

.tvs-fc-mode--circle_fab .tvs-fc-labels.has-swap .tvs-fc-main {
	display: none;
}

.tvs-fc-mode--circle_fab .tvs-fc-btn:hover .tvs-fc-copy,
.tvs-fc-mode--circle_fab .tvs-fc-btn:focus-visible .tvs-fc-copy,
.tvs-fc-mode--circle_fab.is-expanded .tvs-fc-copy {
	opacity: 1;
	transform: translateY(-50%) translateX(0);
}

/* Dismiss button */
.tvs-fc-close {
	position: absolute;
	top: -7px;
	right: -7px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 999px;
	background: #111111;
	color: #ffffff;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
	opacity: 0.9;
	transition: opacity 150ms ease, transform 150ms ease;
}

.tvs-fc-close--auto[data-pos-desktop^="right-"] .tvs-fc-close,
.tvs-fc-close--auto[data-pos-desktop$="-right"] .tvs-fc-close,
.tvs-fc-close--top-left .tvs-fc-close {
	top: -7px;
	bottom: auto;
	right: auto;
	left: -7px;
}

.tvs-fc-close--top-right .tvs-fc-close {
	top: -7px;
	bottom: auto;
	left: auto;
	right: -7px;
}

.tvs-fc-close--bottom-right .tvs-fc-close {
	top: auto;
	bottom: -7px;
	left: auto;
	right: -7px;
}

.tvs-fc-close--bottom-left .tvs-fc-close {
	top: auto;
	bottom: -7px;
	right: auto;
	left: -7px;
}

.tvs-fc-close:hover {
	opacity: 1;
	transform: scale(1.1);
}

/* Entrance animations (on .tvs-fc-stage so rotation on .tvs-fc-inner is never overwritten) */
@keyframes tvsFcFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes tvsFcPopIn {
	from { opacity: 0; transform: scale(calc(var(--tvs-fc-scale, 1) * 0.75)); }
	to { opacity: 1; transform: scale(var(--tvs-fc-scale, 1)); }
}

@keyframes tvsFcSlideIn {
	from { opacity: 0; transform: scale(var(--tvs-fc-scale, 1)) translateY(14px); }
	to { opacity: 1; transform: scale(var(--tvs-fc-scale, 1)) translateY(0); }
}

.tvs-fc-enter--fade.is-ready .tvs-fc-stage {
	animation: tvsFcFadeIn 380ms ease both;
}

.tvs-fc-enter--pop.is-ready .tvs-fc-stage {
	animation: tvsFcPopIn 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tvs-fc-enter--slide.is-ready .tvs-fc-stage {
	animation: tvsFcSlideIn 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Idle attention animations */
@keyframes tvsFcPulse {
	0%, 100% { box-shadow: var(--tvs-fc-shadow, 0 8px 22px rgba(0, 0, 0, 0.36)), 0 0 0 0 rgba(201, 160, 32, 0.55); }
	50% { box-shadow: var(--tvs-fc-shadow, 0 8px 22px rgba(0, 0, 0, 0.36)), 0 0 0 10px rgba(201, 160, 32, 0); }
}

@keyframes tvsFcNudge {
	0%, 82%, 100% { transform: scale(var(--tvs-fc-scale, 1)) translateX(0); }
	88% { transform: scale(var(--tvs-fc-scale, 1)) translateX(4px); }
	94% { transform: scale(var(--tvs-fc-scale, 1)) translateX(-2px); }
}

@keyframes tvsFcBounce {
	0%, 80%, 100% { transform: scale(var(--tvs-fc-scale, 1)) translateY(0); }
	86% { transform: scale(var(--tvs-fc-scale, 1)) translateY(-5px); }
	93% { transform: scale(var(--tvs-fc-scale, 1)) translateY(0); }
}

.tvs-fc-idle--pulse.is-ready .tvs-fc-btn:not(:hover) {
	animation: tvsFcPulse 2.4s infinite;
}

.tvs-fc-idle--nudge.is-ready .tvs-fc-stage:not(:hover) {
	animation: tvsFcNudge 4s infinite;
}

.tvs-fc-idle--bounce.is-ready .tvs-fc-stage:not(:hover) {
	animation: tvsFcBounce 3.6s infinite;
}

.tvs-fc-idle--shimmer:not(.tvs-fc-mode--circle_fab) .tvs-fc-btn {
	overflow: hidden;
}

.tvs-fc-idle--shimmer:not(.tvs-fc-mode--circle_fab).is-ready .tvs-fc-btn::after {
	content: "";
	position: absolute;
	top: 0;
	left: -80%;
	width: 55%;
	height: 100%;
	background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.32) 50%, transparent 80%);
	animation: tvsFcShimmer 4s infinite;
	pointer-events: none;
}

@keyframes tvsFcShimmer {
	0%, 65% { left: -80%; }
	100% { left: 140%; }
}

@media (prefers-reduced-motion: reduce) {
	.tvs-fc-stage,
	.tvs-fc-btn,
	.tvs-fc-main,
	.tvs-fc-expand,
	.tvs-fc-wrap {
		transition: none !important;
		animation: none !important;
	}
	.tvs-fc-idle--shimmer .tvs-fc-btn::after {
		display: none;
	}
}
