/**
 * Add to cart notices & AJAX toast — theme pro design
 */

/* Hide default WooCommerce inline "View cart" link after AJAX */
a.added_to_cart.wc-forward {
	display: none !important;
}

/* ── Page notices wrapper ── */
.woocommerce-notices-wrapper {
	margin-bottom: 20px;
}

.woocommerce-notices-wrapper:empty {
	display: none;
	margin: 0;
}

/* Reset default WC list styling */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error,
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	border: none;
	background: transparent !important;
	color: inherit !important;
}

.woocommerce .woocommerce-message:has(.wp-store-cart-notice),
.woocommerce .woocommerce-info:has(.wp-store-cart-notice),
.woocommerce .woocommerce-error:has(.wp-store-cart-notice) {
	padding: 0 !important;
	margin-bottom: 20px;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
	display: none !important;
}

.woocommerce-message li,
.woocommerce-info li,
.woocommerce-error li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button,
.woocommerce-message a.button,
.woocommerce-error a.button {
	display: none !important;
}

/* ── Theme notice card ── */
.wp-store-cart-notice {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 18px 20px;
	border-radius: 14px;
	border: 1px solid var(--wp-store-border, #e2e8f0);
	background: #fff;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
	position: relative;
}

.wp-store-cart-notice--success {
	border-color: #a7f3d0;
	background: linear-gradient(135deg, #ecfdf5 0%, #fff 55%);
}

.wp-store-cart-notice--error {
	border-color: #fecaca;
	background: linear-gradient(135deg, #fef2f2 0%, #fff 55%);
}

.wp-store-cart-notice--info {
	border-color: #bfdbfe;
	background: linear-gradient(135deg, #eff6ff 0%, #fff 55%);
}

.wp-store-cart-notice__icon {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.wp-store-cart-notice--success .wp-store-cart-notice__icon {
	background: rgba(13, 148, 136, 0.12);
	color: var(--wp-store-primary, #0d9488);
}

.wp-store-cart-notice--error .wp-store-cart-notice__icon {
	background: rgba(220, 38, 38, 0.1);
	color: #dc2626;
}

.wp-store-cart-notice--info .wp-store-cart-notice__icon {
	background: rgba(37, 99, 235, 0.1);
	color: #2563eb;
}

.wp-store-cart-notice__body {
	flex: 1;
	min-width: 0;
	padding-right: 28px;
}

.wp-store-cart-notice__title {
	display: block;
	font-size: 15px;
	font-weight: 800;
	color: var(--wp-store-navy, #0f172a);
	margin: 0 0 4px;
	line-height: 1.3;
}

.wp-store-cart-notice__text {
	margin: 0 0 14px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--wp-store-text-light, #64748b);
}

.wp-store-cart-notice__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.wp-store-cart-notice__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
	font-family: inherit;
	text-decoration: none !important;
	line-height: 1.2;
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
	white-space: nowrap;
}

.wp-store-cart-notice__btn--primary {
	background: var(--wp-store-primary, #0d9488) !important;
	color: #fff !important;
	border: none;
	box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.wp-store-cart-notice__btn--primary:hover {
	background: var(--wp-store-primary-dark, #0f766e) !important;
	color: #fff !important;
	transform: translateY(-1px);
}

.wp-store-cart-notice__btn--ghost {
	background: #fff !important;
	color: var(--wp-store-navy, #0f172a) !important;
	border: 2px solid var(--wp-store-border, #e2e8f0);
}

.wp-store-cart-notice__btn--ghost:hover {
	border-color: var(--wp-store-primary, #0d9488);
	color: var(--wp-store-primary, #0d9488) !important;
}

.wp-store-cart-notice__btn--text {
	background: transparent !important;
	color: var(--wp-store-text-light, #64748b) !important;
	border: none;
	padding: 10px 8px;
	font-weight: 600;
}

.wp-store-cart-notice__btn--text:hover {
	color: var(--wp-store-primary, #0d9488) !important;
}

.wp-store-cart-notice__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	color: #334155;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 2;
	padding: 0;
	line-height: 1;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.wp-store-cart-notice__close svg {
	display: block;
	stroke: #334155;
}

.wp-store-cart-notice__close:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
	color: #0f172a;
}

.wp-store-cart-notice__close:hover svg {
	stroke: #0f172a;
}

/* ── Floating toast (AJAX add to cart) ── */
.wp-store-cart-toast-root {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: min(420px, calc(100vw - 32px));
	pointer-events: none;
}

.wp-store-cart-toast {
	pointer-events: auto;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 18px;
	border-radius: 16px;
	background: #fff;
	border: 1px solid var(--wp-store-border, #e2e8f0);
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
	animation: wpStoreToastIn 0.35s ease;
}

.wp-store-cart-toast.is-leaving {
	animation: wpStoreToastOut 0.25s ease forwards;
}

.wp-store-cart-toast__icon {
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: rgba(13, 148, 136, 0.12);
	color: var(--wp-store-primary, #0d9488);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.wp-store-cart-toast__body {
	flex: 1;
	min-width: 0;
}

.wp-store-cart-toast__title {
	display: block;
	font-size: 14px;
	font-weight: 800;
	color: var(--wp-store-navy, #0f172a);
	margin-bottom: 2px;
}

.wp-store-cart-toast__text {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--wp-store-text-light, #64748b);
}

.wp-store-cart-toast__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wp-store-cart-toast__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 14px;
	border-radius: 9px;
	font-size: 12px;
	font-weight: 700;
	font-family: inherit;
	text-decoration: none !important;
	line-height: 1.2;
}

.wp-store-cart-toast__btn--primary {
	background: var(--wp-store-primary, #0d9488);
	color: #fff !important;
}

.wp-store-cart-toast__btn--primary:hover {
	background: var(--wp-store-primary-dark, #0f766e);
	color: #fff !important;
}

.wp-store-cart-toast__btn--ghost {
	background: #f8fafc;
	color: var(--wp-store-navy, #0f172a) !important;
	border: 1px solid var(--wp-store-border, #e2e8f0);
}

.wp-store-cart-toast__btn--ghost:hover {
	border-color: var(--wp-store-primary, #0d9488);
	color: var(--wp-store-primary, #0d9488) !important;
}

.wp-store-cart-toast__close {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	color: #334155;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	z-index: 2;
}

.wp-store-cart-toast__close svg {
	display: block;
	stroke: #334155;
}

.wp-store-cart-toast__close:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
	color: #0f172a;
}

.wp-store-cart-toast__close:hover svg {
	stroke: #0f172a;
}

@keyframes wpStoreToastIn {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes wpStoreToastOut {
	to {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
}

/* Product card — added state on button */
.product-card-actions .add_to_cart_button.added,
.product-cta-buttons--card .add_to_cart_button.added {
	background: var(--wp-store-primary-dark, #0f766e) !important;
	position: relative;
}

.product-card-actions .add_to_cart_button.added::after,
.product-cta-buttons--card .add_to_cart_button.added::after {
	content: " ✓";
	font-weight: 800;
}

@media (max-width: 768px) {
	.wp-store-cart-toast-root {
		left: 12px;
		right: 12px;
		bottom: calc(var(--wp-store-mobile-bottom-nav-h, 54px) + 12px);
		max-width: none;
	}

	.wp-store-cart-toast {
		width: 100%;
		padding: 14px;
	}

	.wp-store-cart-toast__actions {
		flex-wrap: wrap;
	}

	.wp-store-cart-toast__btn {
		flex: 1 1 auto;
		justify-content: center;
		min-height: 40px;
	}
}

@media (max-width: 640px) {
	.wp-store-cart-notice {
		flex-direction: column;
		gap: 12px;
	}

	.wp-store-cart-notice__body {
		padding-right: 0;
	}

	.wp-store-cart-notice__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.wp-store-cart-notice__btn {
		width: 100%;
		justify-content: center;
		min-height: 44px;
	}

	.product-cta-buttons .single_add_to_cart_button,
	.product-cta-buttons .btn-add-to-cart,
	.product-cta-buttons .btn-buy-now {
		width: 100%;
		min-height: 48px;
		font-size: 15px;
	}
}
