/**
 * Florima — add-to-cart toast + WooCommerce notices.
 * File: wp-content/themes/florima/assets/css/cart-notice.css
 *
 * Подключается глобально. Оформляет:
 *   1. тост «Добавлено в корзину»;
 *   2. штатные уведомления WooCommerce (message / error / info),
 *      которые по умолчанию выглядят как серо-цветные полосы.
 */

/* =========================================================================
   1. Toast
   ========================================================================= */

.florima-toast {
	position: fixed;
	z-index: 1200;
	right: 20px;
	bottom: 20px;
	width: min(380px, calc(100vw - 32px));
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 240ms cubic-bezier(0.32, 0.72, 0.35, 1),
		transform 240ms cubic-bezier(0.32, 0.72, 0.35, 1);
	font-family: "Wix Madefor Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

.florima-toast[hidden] {
	display: none;
}

.florima-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.florima-toast__inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 12px;
	padding: 14px 14px 14px 16px;
	background: #ffffff;
	border: 1px solid #eee7eb;
	border-radius: 16px;
	box-shadow: 0 18px 55px rgba(70, 45, 57, 0.16);
}

.florima-toast__icon {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 11px;
	background: #eaf5ee;
	color: #4d8464;
}

.florima-toast__body {
	min-width: 0;
}

.florima-toast__title {
	margin: 0;
	color: #2f252a;
	font-size: 14px;
	font-weight: 650;
	line-height: 1.3;
}

.florima-toast__name {
	margin: 2px 0 0;
	color: #857980;
	font-size: 12.5px;
	line-height: 1.35;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.florima-toast__name[hidden] {
	display: none;
}

.florima-toast__cart {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 15px;
	border-radius: 10px;
	background: #cf4784;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 170ms ease;
}

.florima-toast__cart:hover,
.florima-toast__cart:focus-visible {
	background: #b93670;
	color: #fff;
}

.florima-toast__close {
	appearance: none;
	-webkit-appearance: none;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: #aaa0a5;
	cursor: pointer;
	transition: background-color 170ms ease, color 170ms ease;
}

.florima-toast__close:hover,
.florima-toast__close:focus-visible {
	background: #fff3f7;
	color: #b93670;
}

.florima-toast a:focus-visible,
.florima-toast button:focus-visible {
	outline: 2px solid rgba(207, 71, 132, 0.55);
	outline-offset: 2px;
}

/* Мобильный: панель снизу, с запасом над sticky-баром страницы товара. */
@media (max-width: 767px) {
	.florima-toast {
		right: 12px;
		left: 12px;
		bottom: 12px;
		width: auto;
	}

	.florima-pdp.has-sticky-bar ~ .florima-toast,
	body:has(.florima-pdp.has-sticky-bar) .florima-toast {
		bottom: calc(84px + env(safe-area-inset-bottom, 0px));
	}

	.florima-toast__inner {
		gap: 10px;
		padding: 12px;
		border-radius: 14px;
	}

	.florima-toast__cart {
		padding-inline: 12px;
		font-size: 12.5px;
	}
}

@media (max-width: 420px) {
	.florima-toast__inner {
		grid-template-columns: auto minmax(0, 1fr) auto;
		row-gap: 10px;
	}

	.florima-toast__cart {
		grid-column: 1 / -1;
		justify-content: center;
		min-height: 44px;
	}
}

/* =========================================================================
   2. WooCommerce notices
   ========================================================================= */

.woocommerce-notices-wrapper {
	width: min(calc(100% - 32px), 1240px);
	margin-inline: auto;
}

.woocommerce-notices-wrapper:empty {
	display: none;
}

.woocommerce-message,
.woocommerce-error,
.woocommerce-info,
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-error,
.woocommerce .woocommerce-info,
.woocommerce-page .woocommerce-message,
.woocommerce-page .woocommerce-error,
.woocommerce-page .woocommerce-info {
	position: relative;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin: 0 0 16px;
	padding: 15px 18px 15px 48px;
	border: 1px solid #eee7eb;
	border-top: 1px solid #eee7eb;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 6px 20px rgba(70, 45, 57, 0.05);
	color: #463a40;
	font-family: "Wix Madefor Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 14.5px;
	line-height: 1.5;
	list-style: none;
}

/* Иконка вместо дефолтного ::before WooCommerce. */
.woocommerce-message::before,
.woocommerce-error::before,
.woocommerce-info::before,
.woocommerce .woocommerce-message::before,
.woocommerce .woocommerce-error::before,
.woocommerce .woocommerce-info::before,
.woocommerce-page .woocommerce-message::before,
.woocommerce-page .woocommerce-error::before,
.woocommerce-page .woocommerce-info::before {
	content: "";
	position: absolute;
	top: 16px;
	left: 17px;
	width: 20px;
	height: 20px;
	margin: 0;
	padding: 0;
	background-color: currentColor;
	background-image: none;
	font-family: inherit;
	animation: none;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

/* Success */
.woocommerce-message,
.woocommerce .woocommerce-message,
.woocommerce-page .woocommerce-message {
	background: #f4faf6;
	border-color: #d8ecdf;
	color: #33684a;
}

.woocommerce-message::before,
.woocommerce .woocommerce-message::before,
.woocommerce-page .woocommerce-message::before {
	color: #4d8464;
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='m8.5 12.5 2.5 2.5 4.5-5'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='m8.5 12.5 2.5 2.5 4.5-5'/></svg>");
}

/* Error */
.woocommerce-error,
.woocommerce .woocommerce-error,
.woocommerce-page .woocommerce-error {
	background: #fdf5f8;
	border-color: #f2d4e1;
	color: #8f2f57;
}

.woocommerce-error::before,
.woocommerce .woocommerce-error::before,
.woocommerce-page .woocommerce-error::before {
	color: #b93670;
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 8v5M12 16.2v.1'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 8v5M12 16.2v.1'/></svg>");
}

/* Info */
.woocommerce-info,
.woocommerce .woocommerce-info,
.woocommerce-page .woocommerce-info {
	background: #fff7fa;
	border-color: #eee7eb;
	color: #62575d;
}

.woocommerce-info::before,
.woocommerce .woocommerce-info::before,
.woocommerce-page .woocommerce-info::before {
	color: #bf3d76;
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 11v5M12 7.8v.1'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 11v5M12 7.8v.1'/></svg>");
}

/* Ссылки внутри уведомлений */
.woocommerce-message a:not(.button),
.woocommerce-error a:not(.button),
.woocommerce-info a:not(.button) {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Кнопка внутри уведомления («Zobacz koszyk») */
.woocommerce-message .button,
.woocommerce-error .button,
.woocommerce-info .button,
.woocommerce .woocommerce-message .button,
.woocommerce .woocommerce-error .button,
.woocommerce .woocommerce-info .button {
	order: 2;
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	min-height: 42px;
	padding: 10px 18px;
	border: 1px solid #cf4784;
	border-radius: 10px;
	background: #cf4784;
	background-image: none;
	color: #fff;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1;
	text-shadow: none;
	box-shadow: none;
	transition: background-color 170ms ease, border-color 170ms ease;
}

.woocommerce-message .button:hover,
.woocommerce-error .button:hover,
.woocommerce-info .button:hover,
.woocommerce .woocommerce-message .button:hover,
.woocommerce .woocommerce-error .button:hover,
.woocommerce .woocommerce-info .button:hover {
	background: #b93670;
	border-color: #b93670;
	color: #fff;
}

/* Список ошибок валидации */
.woocommerce-error li {
	list-style: none;
	margin: 0;
}

.woocommerce-error li + li {
	margin-top: 6px;
}

@media (max-width: 600px) {
	.woocommerce-message,
	.woocommerce-error,
	.woocommerce-info,
	.woocommerce .woocommerce-message,
	.woocommerce .woocommerce-error,
	.woocommerce .woocommerce-info {
		padding: 14px 14px 14px 44px;
		font-size: 14px;
	}

	.woocommerce-message .button,
	.woocommerce-error .button,
	.woocommerce-info .button,
	.woocommerce .woocommerce-message .button,
	.woocommerce .woocommerce-error .button,
	.woocommerce .woocommerce-info .button {
		width: 100%;
		margin-left: 0;
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.florima-toast,
	.florima-toast__cart,
	.florima-toast__close {
		transition: none;
	}
}
