/*
 * BuenTheme — cart-feedback.css
 * Toast de «producto añadido al carrito». Se encola con el JS de feedback,
 * no con woocommerce.css, para que el aviso lleve estilo también fuera de la tienda.
 */

/* Toast de feedback al añadir (no sustituye store-notices) */
.buentheme-cart-toast {
	position: fixed;
	z-index: 100050;
	max-width: min(360px, calc(100vw - 1.5rem));
	pointer-events: none;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	box-sizing: border-box;
}
.buentheme-cart-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}
.buentheme-cart-toast--top-right {
	top: max(1rem, env(safe-area-inset-top, 0px));
	right: max(1rem, env(safe-area-inset-right, 0px));
}
.buentheme-cart-toast--top-center {
	top: max(1rem, env(safe-area-inset-top, 0px));
	left: 50%;
	transform: translate(-50%, 8px);
}
.buentheme-cart-toast--top-center.is-visible {
	transform: translate(-50%, 0);
}
.buentheme-cart-toast--bottom-right {
	bottom: max(1rem, env(safe-area-inset-bottom, 0px));
	right: max(1rem, env(safe-area-inset-right, 0px));
}
.buentheme-cart-toast--bottom-center {
	bottom: max(1rem, env(safe-area-inset-bottom, 0px));
	left: 50%;
	transform: translate(-50%, 8px);
}
.buentheme-cart-toast--bottom-center.is-visible {
	transform: translate(-50%, 0);
}
/* Móvil: barra inferior casi full-width (JS añade .buentheme-cart-toast--mobile) */
.buentheme-cart-toast.buentheme-cart-toast--mobile {
	left: 0.75rem;
	right: 0.75rem;
	bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
	top: auto;
	max-width: none;
	width: auto;
	transform: translateY(12px);
}
.buentheme-cart-toast.buentheme-cart-toast--mobile.is-visible {
	transform: translateY(0);
}
/* Por si el media query CSS se aplica sin clase JS (CSS de respaldo) */
@media (max-width: 599px) {
	.buentheme-cart-toast.buentheme-cart-toast--bottom-center,
	.buentheme-cart-toast.buentheme-cart-toast--top-right,
	.buentheme-cart-toast.buentheme-cart-toast--top-center,
	.buentheme-cart-toast.buentheme-cart-toast--bottom-right {
		left: 0.75rem;
		right: 0.75rem;
		top: auto;
		bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
		max-width: none;
		width: auto;
		transform: translateY(12px);
	}
	.buentheme-cart-toast.buentheme-cart-toast--bottom-center.is-visible,
	.buentheme-cart-toast.buentheme-cart-toast--top-right.is-visible,
	.buentheme-cart-toast.buentheme-cart-toast--top-center.is-visible,
	.buentheme-cart-toast.buentheme-cart-toast--bottom-right.is-visible {
		transform: translateY(0);
	}
	.buentheme-cart-toast__inner {
		padding: 0.95rem 1rem;
		border-radius: 14px;
		align-items: center;
		/* Zona táctil cómoda */
		min-height: 52px;
	}
	.buentheme-cart-toast__msg {
		font-size: 0.95rem;
	}
	.buentheme-cart-toast__link {
		font-size: 0.9rem;
		padding: 0.15rem 0;
		/* Área de toque mayor */
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}
	.buentheme-cart-toast__close {
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		font-size: 1.4rem;
	}
}
.buentheme-cart-toast__inner {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	padding: 0.85rem 0.9rem;
	border-radius: 12px;
	background: var(--wp--preset--color--bg-2, #fff);
	color: var(--wp--preset--color--fg-1, #0f172a);
	border: 1px solid var(--wp--preset--color--bg-3, rgba(15, 23, 42, 0.1));
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.16);
}
.buentheme-cart-toast__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	flex: 0 0 auto;
	color: #fff;
	background: var(--wp--preset--color--accent-1, #16a34a);
}
.buentheme-cart-toast__body {
	flex: 1 1 auto;
	min-width: 0;
}
.buentheme-cart-toast__msg {
	margin: 0;
	font-size: 0.925rem;
	font-weight: 600;
	line-height: 1.35;
}
.buentheme-cart-toast__link {
	display: inline-block;
	margin-top: 0.25rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--wp--preset--color--accent-1, #3b82f6);
	text-decoration: none;
}
.buentheme-cart-toast__link:hover {
	text-decoration: underline;
}
.buentheme-cart-toast__close {
	appearance: none;
	border: 0;
	background: transparent;
	color: inherit;
	opacity: 0.55;
	cursor: pointer;
	font-size: 1.25rem;
	line-height: 1;
	padding: 0 0.15rem;
	flex: 0 0 auto;
}
.buentheme-cart-toast__close:hover {
	opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
	.buentheme-cart-toast {
		transition: none;
	}
}
