/**
 * ELC Smart Product Recommender — Front-end styles
 * Glassmorphism popup card, bottom-left floating, non-intrusive.
 * All selectors are scoped under #elc-sr-popup-root to avoid theme collisions.
 */

/* -----------------------------------------------------------
   Root container — invisible until a card is injected by JS
   ----------------------------------------------------------- */
#elc-sr-popup-root {
	position: fixed;
	bottom: 0;
	left: 0;
	z-index: 999999; /* Stay above typical theme headers/modals */
	pointer-events: none; /* Root itself never blocks clicks; card re-enables it */
}

/* -----------------------------------------------------------
   Card shell — compact, glassmorphic, ~2:1 proportion
   ----------------------------------------------------------- */
.elc-sr-card {
	pointer-events: auto;
	position: fixed;
	left: 20px;
	bottom: 20px;
	width: 300px;
	max-width: calc(100vw - 40px);
	padding: 14px;
	border-radius: 16px;

	/* Glassmorphism */
	background: rgba(255, 255, 255, 0.55);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, 0.35);
	box-shadow: 0 8px 32px rgba(31, 38, 135, 0.18);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1c1c1e;

	opacity: 0;
	transform: translateX(-120%);
	transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}

.elc-sr-card.elc-sr-visible {
	opacity: 1;
	transform: translateX(0);
}

/* Dark-mode friendliness for themes with dark backgrounds nearby */
@media (prefers-color-scheme: dark) {
	.elc-sr-card {
		background: rgba(30, 30, 34, 0.55);
		border: 1px solid rgba(255, 255, 255, 0.12);
		color: #f5f5f7;
	}
}

/* -----------------------------------------------------------
   Close (X) icon
   ----------------------------------------------------------- */
.elc-sr-close {
	position: absolute;
	top: 8px;
	right: 10px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: inherit;
	opacity: 0.55;
	transition: opacity 0.2s ease;
	padding: 4px;
}
.elc-sr-close:hover {
	opacity: 1;
}

/* -----------------------------------------------------------
   Body layout: thumbnail + info
   ----------------------------------------------------------- */
.elc-sr-body {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.elc-sr-thumb {
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	border-radius: 10px;
	object-fit: cover;
	background: rgba(255, 255, 255, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.4);
}

.elc-sr-info {
	flex: 1;
	min-width: 0;
}

.elc-sr-eyebrow {
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.65;
	margin: 0 0 2px;
}

.elc-sr-title {
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 4px;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.elc-sr-price {
	font-size: 13px;
	font-weight: 700;
	margin: 0;
}
.elc-sr-price .woocommerce-Price-amount {
	font-weight: 700;
}

/* -----------------------------------------------------------
   Actions row
   ----------------------------------------------------------- */
.elc-sr-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 12px;
	gap: 8px;
}

.elc-sr-cta {
	flex: 1;
	text-align: center;
	padding: 8px 10px;
	border-radius: 10px;
	background: #1c1c1e;
	color: #fff;
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	transition: transform 0.15s ease, opacity 0.15s ease;
}
.elc-sr-cta:hover {
	opacity: 0.88;
	transform: translateY(-1px);
	color: #fff;
}

.elc-sr-feedback {
	display: flex;
	gap: 4px;
}

.elc-sr-feedback button {
	background: rgba(255, 255, 255, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 8px;
	width: 30px;
	height: 30px;
	font-size: 14px;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease;
}
.elc-sr-feedback button:hover {
	background: rgba(255, 255, 255, 0.8);
	transform: scale(1.08);
}
.elc-sr-feedback button.elc-sr-active {
	background: #1c1c1e;
	color: #fff;
}

/* -----------------------------------------------------------
   Re-trigger / revised prompt variant
   ----------------------------------------------------------- */
.elc-sr-card.elc-sr-retrigger .elc-sr-eyebrow {
	color: #b8860b;
	opacity: 0.9;
}

/* -----------------------------------------------------------
   Reason selector (shown after thumbs-down)
   ----------------------------------------------------------- */
.elc-sr-reason {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.elc-sr-reason p {
	font-size: 11.5px;
	margin: 0 0 6px;
	opacity: 0.75;
}

.elc-sr-reason-options {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.elc-sr-reason-options button {
	font-size: 11px;
	padding: 5px 9px;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: rgba(255, 255, 255, 0.5);
	cursor: pointer;
	transition: background 0.15s ease;
}
.elc-sr-reason-options button:hover {
	background: rgba(255, 255, 255, 0.9);
}

/* -----------------------------------------------------------
   "Thank you" micro-confirmation state
   ----------------------------------------------------------- */
.elc-sr-thanks {
	font-size: 12px;
	text-align: center;
	padding: 6px 0 2px;
	opacity: 0.8;
}

/* -----------------------------------------------------------
   Mobile responsiveness
   ----------------------------------------------------------- */
@media (max-width: 480px) {
	.elc-sr-card {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
	}
}
