/**
 * Floating CTA — Frontend Styles
 *
 * Uses CSS custom properties for easy pro override.
 * All dimensions are relative-friendly for theme compatibility.
 */

/* ----------------------------------------------------------------
   Base bar
   ---------------------------------------------------------------- */
.fcta-bar {
	--fcta-bg: #ffffff;
	--fcta-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
	--fcta-btn-bg: #F3961D;
	--fcta-btn-hover: #d97f0a;
	--fcta-btn-text: #ffffff;
	--fcta-btn-radius: 6px;
	--fcta-title-color: #1a1a1a;
	--fcta-price-color: #16a34a;
	--fcta-old-price-color: #991b1b;
	--fcta-subtitle-color: #6b7280;
	--fcta-star-filled: #f59e0b;
	--fcta-star-empty: #d1d5db;
	--fcta-dismiss-color: #9ca3af;

	position: fixed;
	left: 0;
	right: 0;
	z-index: 999999;
	background-color: var(--fcta-bg);
	box-shadow: var(--fcta-shadow);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	line-height: 1.4;
	box-sizing: border-box;
}

.fcta-bar--bottom {
	bottom: 0;
}

.fcta-bar--top {
	top: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Hidden state for dismiss */
.fcta-bar[hidden] {
	display: none !important;
}

/* ----------------------------------------------------------------
   Inner layout
   ---------------------------------------------------------------- */
.fcta-bar-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 10px 20px;
}

/* ----------------------------------------------------------------
   Columns
   ---------------------------------------------------------------- */
.fcta-col {
	display: flex;
	align-items: center;
}

.fcta-col--product {
	flex: 1 1 auto;
	min-width: 0;
	gap: 10px;
}

.fcta-col--price {
	flex: 0 0 auto;
}

.fcta-col--cta {
	flex: 0 0 auto;
}

/* No price: product and CTA split evenly */
.fcta-bar--no-price .fcta-col--product,
.fcta-bar--no-price .fcta-col--cta {
	flex: 1 1 auto;
}

.fcta-bar--no-price .fcta-col--cta {
	justify-content: flex-end;
}

/* ----------------------------------------------------------------
   Product image
   ---------------------------------------------------------------- */
.fcta-product-image {
	flex: 0 0 auto;
}

.fcta-product-image img {
	display: block;
	width: 45px;
	height: 45px;
	object-fit: cover;
	border-radius: 4px;
}

/* ----------------------------------------------------------------
   Product info (title + stars)
   ---------------------------------------------------------------- */
.fcta-product-info {
	min-width: 0;
}

.fcta-product-title {
	display: block;
	font-size: 15px;
	font-weight: 600;
	color: var(--fcta-title-color);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ----------------------------------------------------------------
   Star rating
   ---------------------------------------------------------------- */
.fcta-star-rating {
	display: inline-flex;
	font-size: 16px;
	line-height: 1;
	letter-spacing: -1px;
	margin-top: 2px;
}

.fcta-stars {
	background: linear-gradient(
		90deg,
		var(--fcta-star-filled) var(--fcta-star-percent),
		var(--fcta-star-empty) var(--fcta-star-percent)
	);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	font-family: Times, "Times New Roman", serif;
}

/* ----------------------------------------------------------------
   Price
   ---------------------------------------------------------------- */
.fcta-price-box {
	text-align: center;
	white-space: nowrap;
}

.fcta-price-current {
	display: block;
	font-size: 18px;
	font-weight: 600;
	color: var(--fcta-price-color);
}

.fcta-price-old {
	display: inline-block;
	font-size: 13px;
	color: var(--fcta-old-price-color);
	text-decoration: line-through;
	margin-left: 4px;
	vertical-align: middle;
}

.fcta-price-symbol {
	font-weight: 400;
}

.fcta-price-subtitle {
	display: block;
	font-size: 11px;
	color: var(--fcta-subtitle-color);
	margin-top: 1px;
}

/* ----------------------------------------------------------------
   CTA Button
   ---------------------------------------------------------------- */
.fcta-button {
	display: inline-block;
	padding: 10px 24px;
	background-color: var(--fcta-btn-bg);
	color: var(--fcta-btn-text);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	border-radius: var(--fcta-btn-radius);
	transition: background-color 0.15s ease, transform 0.1s ease;
	white-space: nowrap;
	line-height: 1.4;
	border: none;
	cursor: pointer;
}

.fcta-button:hover {
	background-color: var(--fcta-btn-hover);
	color: var(--fcta-btn-text);
	text-decoration: none;
}

.fcta-button:active {
	transform: scale(0.98);
}

.fcta-button:focus-visible {
	outline: 2px solid var(--fcta-btn-bg);
	outline-offset: 2px;
}

/* ----------------------------------------------------------------
   Dismiss button
   ---------------------------------------------------------------- */
.fcta-dismiss {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	margin-left: 4px;
	background: none;
	border: none;
	color: var(--fcta-dismiss-color);
	cursor: pointer;
	transition: color 0.15s ease;
}

.fcta-dismiss:hover {
	color: var(--fcta-title-color);
}

.fcta-dismiss:focus-visible {
	outline: 2px solid var(--fcta-btn-bg);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ----------------------------------------------------------------
   Mobile responsive
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
	.fcta-bar-inner {
		gap: 12px;
		padding: 10px 16px;
	}

	/* Hide price column on mobile */
	.fcta-col--price {
		display: none;
	}

	/* Hide product image on mobile */
	.fcta-product-image {
		display: none;
	}

	.fcta-product-title {
		font-size: 13px;
		text-align: left;
	}

	.fcta-star-rating {
		font-size: 14px;
	}

	.fcta-button {
		font-size: 13px;
		padding: 10px 16px;
	}

	.fcta-col--product {
		flex: 1 1 auto;
	}

	.fcta-col--cta {
		flex: 0 0 auto;
	}
}

@media (max-width: 400px) {
	.fcta-bar-inner {
		gap: 8px;
		padding: 8px 12px;
	}

	.fcta-button {
		padding: 10px 14px;
		font-size: 12px;
	}

	.fcta-product-title {
		font-size: 12px;
	}
}
