/**
 * Bembo Mart — Cart notices (required layout)
 * Icons are pure CSS so they show on first paint (no JS delay / interaction gate).
 */

body.bm-styled-cart .woocommerce-notices-wrapper {
	display: flex !important;
	flex-direction: column !important;
	gap: 16px !important;
	margin: 0 0 24px !important;
}

/* Nested empty wrappers (double-wrap bug) must not reserve space */
body.bm-styled-cart .woocommerce-notices-wrapper:empty,
body.bm-styled-cart .woocommerce-notices-wrapper:not(:has(.woocommerce-message, .woocommerce-info, .woocommerce-error)) {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	gap: 0 !important;
	min-height: 0 !important;
}

/*
 * Spacing must work on first paint even when notices are NOT yet inside the
 * wrapper (Points plugin often echoes them as siblings before AJAX refresh).
 */
body.bm-styled-cart.woocommerce-cart .woocommerce-message,
body.bm-styled-cart.woocommerce-cart .woocommerce-info,
body.bm-styled-cart.woocommerce-cart .woocommerce-error,
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message,
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info,
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-error,
body.bm-styled-cart .woocommerce .woocommerce-message,
body.bm-styled-cart .woocommerce .woocommerce-info,
body.bm-styled-cart .woocommerce .woocommerce-error,
body.bm-styled-cart .custom-cart-section .woocommerce-message,
body.bm-styled-cart .custom-cart-section .woocommerce-info,
body.bm-styled-cart .custom-cart-section .woocommerce-error {
	position: relative !important;
	display: block !important;
	box-sizing: border-box !important;
	width: 100% !important;
	margin: 0 0 16px !important;
	padding: 24px 90px 24px 78px !important;
	min-height: 80px !important;
	border: 1px solid rgba(175, 15, 28, 0.12) !important;
	border-top: 0 none !important;
	border-left: 8px solid #AF0F1C !important;
	border-radius: 14px !important;
	box-shadow: 0 8px 24px rgba(25, 34, 41, 0.08) !important;
	font-size: 16px !important;
	font-weight: 500 !important;
	line-height: 1.45 !important;
	color: #192229 !important;
	overflow: visible !important;
	list-style: none !important;
	background: #fff8f5 none no-repeat right 22px center / 52px auto !important;
}

/* Inside flex wrapper, gap owns spacing — zero child margins to avoid double gap */
body.bm-styled-cart .woocommerce-notices-wrapper > .woocommerce-message,
body.bm-styled-cart .woocommerce-notices-wrapper > .woocommerce-info,
body.bm-styled-cart .woocommerce-notices-wrapper > .woocommerce-error {
	margin: 0 !important;
}

/* Kill WooCommerce glyph icon font — left icon slot */
body.bm-styled-cart.woocommerce-cart .woocommerce-message::before,
body.bm-styled-cart.woocommerce-cart .woocommerce-info::before,
body.bm-styled-cart.woocommerce-cart .woocommerce-error::before,
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message::before,
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info::before,
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-error::before,
body.bm-styled-cart .woocommerce .woocommerce-message::before,
body.bm-styled-cart .woocommerce .woocommerce-info::before,
body.bm-styled-cart .woocommerce .woocommerce-error::before {
	font-family: inherit !important;
	font-size: 0 !important;
	font-variant: normal !important;
	text-rendering: auto !important;
	speak: never !important;
	color: transparent !important;
	content: "" !important;
	display: block !important;
	position: absolute !important;
	left: 22px !important;
	right: auto !important;
	top: 50% !important;
	bottom: auto !important;
	transform: translateY(-50%) !important;
	width: 40px !important;
	height: 40px !important;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background: transparent none no-repeat center / 40px 40px !important;
	box-shadow: 0 0 0 8px rgba(241, 86, 44, 0.14) !important;
	z-index: 3 !important;
	line-height: 0 !important;
}

/* Right decorative icon slot (fixed box — never tiles) */
body.bm-styled-cart.woocommerce-cart .woocommerce-info::after,
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info::after,
body.bm-styled-cart .woocommerce .woocommerce-info::after {
	content: "" !important;
	display: block !important;
	position: absolute !important;
	right: 22px !important;
	left: auto !important;
	top: 50% !important;
	bottom: auto !important;
	transform: translateY(-50%) !important;
	width: 56px !important;
	height: 48px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent none no-repeat center / contain !important;
	box-shadow: none !important;
	z-index: 2 !important;
	pointer-events: none !important;
}

/* Hide leftover JS icon nodes if present (CSS owns icons now) */
body.bm-styled-cart .bm-notice-icon,
body.bm-styled-cart .bm-notice-aside {
	display: none !important;
}

/* ----- Success ----- */
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message,
body.bm-styled-cart .woocommerce .woocommerce-message {
	background: #f3faf4 url("../images/notice-icons/success-cart.svg") no-repeat right 22px center / 52px auto !important;
	border-color: rgba(34, 160, 82, 0.18) !important;
	border-left-color: #1f9d57 !important;
}

body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message::before,
body.bm-styled-cart .woocommerce .woocommerce-message::before {
	background: transparent url("../images/notice-icons/success-check.svg") no-repeat center / 40px 40px !important;
	box-shadow: 0 0 0 8px rgba(34, 160, 82, 0.14) !important;
}

/* Cart count badge on success notices (set data-bm-cart-count on the notice) */
body.bm-styled-cart .woocommerce-message[data-bm-cart-count]:not([data-bm-cart-count="0"])::after {
	content: attr(data-bm-cart-count) !important;
	display: block !important;
	position: absolute !important;
	right: 18px !important;
	top: 18px !important;
	left: auto !important;
	bottom: auto !important;
	width: auto !important;
	min-width: 18px !important;
	height: 18px !important;
	padding: 0 5px !important;
	border-radius: 999px !important;
	background: #22a052 !important;
	color: #fff !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	line-height: 18px !important;
	text-align: center !important;
	transform: none !important;
	box-shadow: none !important;
	z-index: 4 !important;
	display: none !important;
}

body.bm-styled-cart .woocommerce-message:not([data-bm-cart-count])::after,
body.bm-styled-cart .woocommerce-message[data-bm-cart-count="0"]::after {
	content: none !important;
	display: none !important;
}

/* ----- Earn points ----- */
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info:not(.wc_points_redeem_earn_points),
body.bm-styled-cart .woocommerce .woocommerce-info:not(.wc_points_redeem_earn_points) {
	background: #fff8f5 none no-repeat right 22px center / 52px auto !important;
	border-left-color: #AF0F1C !important;
}

body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info:not(.wc_points_redeem_earn_points)::before,
body.bm-styled-cart .woocommerce .woocommerce-info:not(.wc_points_redeem_earn_points)::before {
	background: transparent url("../images/notice-icons/earn-gift.svg") no-repeat center / 40px 40px !important;
}

body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info:not(.wc_points_redeem_earn_points)::after,
body.bm-styled-cart .woocommerce .woocommerce-info:not(.wc_points_redeem_earn_points)::after {
	background: transparent url("../images/notice-icons/earn-coins.svg") no-repeat center / contain !important;
}

/* ----- Redeem points ----- */
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info.wc_points_redeem_earn_points,
body.bm-styled-cart .woocommerce .woocommerce-info.wc_points_redeem_earn_points,
body.bm-styled-cart.woocommerce-cart .woocommerce-info.wc_points_redeem_earn_points {
	display: block !important;
	padding-top: 22px !important;
	padding-bottom: 22px !important;
	background: #fff8f5 none no-repeat right 22px center / 52px auto !important;
	border-left-color: #AF0F1C !important;
}

body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info.wc_points_redeem_earn_points::before,
body.bm-styled-cart .woocommerce .woocommerce-info.wc_points_redeem_earn_points::before {
	background: transparent url("../images/notice-icons/redeem-points.svg") no-repeat center / 40px 40px !important;
}

body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info.wc_points_redeem_earn_points::after,
body.bm-styled-cart .woocommerce .woocommerce-info.wc_points_redeem_earn_points::after {
	background: transparent url("../images/notice-icons/redeem-tag.svg") no-repeat center / contain !important;
}

body.bm-styled-cart .woocommerce-notices-wrapper .bm-notice-highlight,
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info strong,
body.bm-styled-cart .woocommerce .woocommerce-info strong {
	color: #F1562C !important;
	font-weight: 700 !important;
	display: inline !important;
}

/* Apply Discount under text, compact width */
body.bm-styled-cart .wc_points_rewards_apply_discount {
	display: block !important;
	width: auto !important;
	max-width: 100% !important;
	margin: 16px 0 0 !important;
	float: none !important;
	clear: both !important;
}

body.bm-styled-cart input.button.wc_points_rewards_apply_discount,
body.bm-styled-cart .button.wc_points_rewards_apply_discount {
	float: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	max-width: max-content !important;
	margin: 0 !important;
	min-width: 0 !important;
	min-height: 42px !important;
	height: auto !important;
	padding: 10px 26px !important;
	border: 0 none !important;
	border-radius: 999px !important;
	background: linear-gradient(90deg, #F1562C 0%, #AF0F1C 100%) !important;
	color: #fff !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	box-shadow: 0 8px 20px rgba(241, 86, 44, 0.28) !important;
	cursor: pointer !important;
	white-space: nowrap !important;
}

/* Error */
body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-error,
body.bm-styled-cart .woocommerce .woocommerce-error {
	background: #fff5f5 none no-repeat center / auto !important;
	border-color: rgba(175, 15, 28, 0.2) !important;
	border-left-color: #AF0F1C !important;
	color: #9f1239 !important;
}

body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-error::before,
body.bm-styled-cart .woocommerce .woocommerce-error::before {
	background: #AF0F1C none no-repeat center / auto !important;
	box-shadow: 0 0 0 8px rgba(175, 15, 28, 0.12) !important;
	content: "!" !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	color: #fff !important;
	font-size: 22px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
}

body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-error::after,
body.bm-styled-cart .woocommerce .woocommerce-error::after {
	content: none !important;
	display: none !important;
}

@media (max-width: 767px) {
	body.bm-styled-cart.woocommerce-cart .woocommerce-message,
	body.bm-styled-cart.woocommerce-cart .woocommerce-info,
	body.bm-styled-cart.woocommerce-cart .woocommerce-error,
	body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message,
	body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info,
	body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-error {
		padding: 18px 64px 18px 64px !important;
		font-size: 14px !important;
		min-height: 0 !important;
	}

	body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message {
		background-size: 40px auto !important;
		background-position: right 12px center !important;
	}

	body.bm-styled-cart.woocommerce-cart .woocommerce-message::before,
	body.bm-styled-cart.woocommerce-cart .woocommerce-info::before,
	body.bm-styled-cart.woocommerce-cart .woocommerce-error::before,
	body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message::before,
	body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info::before,
	body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-error::before {
		left: 16px !important;
		width: 34px !important;
		height: 34px !important;
		background-size: 34px 34px !important;
		box-shadow: 0 0 0 6px rgba(241, 86, 44, 0.12) !important;
	}

	body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message::before,
	body.bm-styled-cart.woocommerce-cart .woocommerce-message::before {
		box-shadow: 0 0 0 6px rgba(34, 160, 82, 0.12) !important;
	}

	body.bm-styled-cart.woocommerce-cart .woocommerce-info::after,
	body.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info::after {
		right: 12px !important;
		width: 44px !important;
		height: 40px !important;
	}
}

/* RTL */
body.rtl.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message,
body.rtl.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info,
body.rtl.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-error {
	padding: 20px 78px 20px 90px !important;
	border-left-width: 1px !important;
	border-right: 8px solid #AF0F1C !important;
}

body.rtl.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message {
	border-right-color: #1f9d57 !important;
	background-position: left 22px center !important;
}

body.rtl.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-message::before,
body.rtl.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info::before,
body.rtl.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-error::before {
	left: auto !important;
	right: 22px !important;
}

body.rtl.bm-styled-cart .woocommerce-notices-wrapper .woocommerce-info::after {
	right: auto !important;
	left: 22px !important;
}

body.rtl.bm-styled-cart .woocommerce-message[data-bm-cart-count]:not([data-bm-cart-count="0"])::after {
	right: auto !important;
	left: 18px !important;
}
