/**
 * Kompakt tips-knapp + popup-panel för alternativa produkter.
 */

.lyfco-alt-tip {
	position: relative;
	margin-top: 0.75rem;
	box-sizing: border-box;
	max-width: 100%;
}

.lyfco-alt-tip__bar {
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

.lyfco-alt-tip__trigger {
	margin: 0;
	padding: 0.28rem 0.65rem;
	font-size: 0.8125rem;
	line-height: 1.35;
	font-weight: 500;
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: 999px;
	background: #fff;
	color: var(--theme-text-color, #333);
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.lyfco-alt-tip__trigger:hover {
	background: #f5f5f5;
	border-color: rgba(0, 0, 0, 0.22);
}

.lyfco-alt-tip__backdrop {
	position: fixed;
	inset: 0;
	z-index: 500010;
	background: rgba(0, 0, 0, 0.45);
	animation: lyfco-alt-tip-fade-in 0.18s ease;
}

.lyfco-alt-tip__panel {
	position: fixed;
	z-index: 500020;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(22.5rem, calc(100vw - 1.75rem));
	max-height: min(85vh, 28rem);
	overflow: auto;
	padding: 0;
	margin: 0;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
	box-sizing: border-box;
	animation: lyfco-alt-tip-pop-in 0.2s ease;
}

@keyframes lyfco-alt-tip-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes lyfco-alt-tip-pop-in {
	from {
		opacity: 0;
		transform: translate(-50%, -48%) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}
}

.lyfco-alt-tip__panel-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.85rem 0.85rem 0;
	box-sizing: border-box;
}

.lyfco-alt-tip__panel-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--theme-text-color, #1a1a1a);
	padding-right: 0.25rem;
}

.lyfco-alt-tip__close {
	flex-shrink: 0;
	margin: -0.15rem -0.15rem 0 0;
	padding: 0.15rem 0.45rem;
	border: none;
	background: transparent;
	font-size: 1.35rem;
	line-height: 1;
	color: #666;
	cursor: pointer;
	border-radius: 4px;
}

.lyfco-alt-tip__close:hover {
	background: rgba(0, 0, 0, 0.06);
	color: #111;
}

.lyfco-alt-tip__form {
	position: relative;
	margin: 0;
	padding: 0 0.85rem 0.85rem;
	box-sizing: border-box;
}

.lyfco-alt-tip__hint {
	margin: 0 0 0.65rem;
	font-size: 0.78rem;
	line-height: 1.45;
	color: var(--theme-text-color, #555);
	opacity: 0.92;
}

.lyfco-alt-tip__field {
	margin: 0 0 0.65rem;
}

.lyfco-alt-tip__label {
	display: block;
	margin-bottom: 0.28rem;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--theme-text-color, #333);
}

.lyfco-alt-tip__req {
	color: #c00;
	font-weight: 700;
}

.lyfco-alt-tip__textarea,
.lyfco-alt-tip__input {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.45rem 0.55rem;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 6px;
	font-size: 0.875rem;
	line-height: 1.4;
	font-family: inherit;
	background: #fff;
}

.lyfco-alt-tip__textarea:focus,
.lyfco-alt-tip__input:focus {
	outline: 2px solid var(--theme-palette-color-4, #007cba);
	outline-offset: 1px;
	border-color: transparent;
}

.lyfco-alt-tip__textarea {
	resize: vertical;
	min-height: 4rem;
}

.lyfco-alt-tip__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.lyfco-alt-tip__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.45rem;
	margin: 0.35rem 0 0;
}

.lyfco-alt-tip__actions .button {
	margin: 0;
	padding: 0.38rem 0.75rem;
	font-size: 0.8125rem;
	cursor: pointer;
}

.lyfco-alt-tip__cancel.button {
	background: transparent;
	border: 1px solid rgba(0, 0, 0, 0.18);
	color: inherit;
}

.lyfco-alt-tip__feedback {
	margin-top: 0.55rem;
	padding: 0.45rem 0.55rem;
	border-radius: 6px;
	font-size: 0.78rem;
	line-height: 1.45;
}

.lyfco-alt-tip__feedback.is-success {
	background: #e8f5e9;
	border: 1px solid #c8e6c9;
	color: #1b5e20;
}

.lyfco-alt-tip__feedback.is-error {
	background: #ffebee;
	border: 1px solid #ffcdd2;
	color: #b71c1c;
}

.lyfco-alt-tip.is-sending {
	opacity: 0.85;
	pointer-events: none;
}

body.lyfco-alt-tip-modal-open {
	overflow: hidden;
}

@media (prefers-color-scheme: dark) {
	.lyfco-alt-tip__trigger {
		background: rgba(255, 255, 255, 0.06);
		border-color: rgba(255, 255, 255, 0.18);
		color: inherit;
	}

	.lyfco-alt-tip__trigger:hover {
		background: rgba(255, 255, 255, 0.1);
	}

	.lyfco-alt-tip__panel {
		background: #1e1e1e;
		border-color: rgba(255, 255, 255, 0.14);
		box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
	}

	.lyfco-alt-tip__textarea,
	.lyfco-alt-tip__input {
		background: rgba(0, 0, 0, 0.35);
		border-color: rgba(255, 255, 255, 0.14);
		color: inherit;
	}

	.lyfco-alt-tip__cancel.button {
		border-color: rgba(255, 255, 255, 0.22);
	}

	.lyfco-alt-tip__close:hover {
		background: rgba(255, 255, 255, 0.08);
		color: #eee;
	}

	.lyfco-alt-tip__feedback.is-success {
		background: rgba(46, 125, 50, 0.25);
		border-color: rgba(129, 199, 132, 0.45);
		color: #c8e6c9;
	}

	.lyfco-alt-tip__feedback.is-error {
		background: rgba(183, 28, 28, 0.25);
		border-color: rgba(239, 154, 154, 0.4);
		color: #ffcdd2;
	}
}
