/* Cart badge + AJAX toast (global) */
.header-icon--cart {
	position: relative;
}

.header-cart-count {
	position: absolute;
	top: -0.4rem;
	right: -0.6rem;
	min-width: 1.6rem;
	height: 1.6rem;
	padding: 0 0.4rem;
	border-radius: 999px;
	background: #c8102e;
	color: #fff;
	font-size: 1rem;
	line-height: 1.6rem;
	text-align: center;
	opacity: 0;
	pointer-events: none;
	transform: scale(0.8);
	transition: 0.2s ease;
}

.header-cart-count.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: scale(1);
}

.sdn-toast {
	position: fixed;
	left: 50%;
	bottom: 2.4rem;
	z-index: 10050;
	max-width: min(42rem, calc(100vw - 3.2rem));
	padding: 1.2rem 1.6rem;
	border: 1px solid #131313;
	background: #131313;
	color: #fff;
	font-size: 1.4rem;
	line-height: 1.4;
	text-align: center;
	transform: translate(-50%, 1.2rem);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.sdn-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
	pointer-events: auto;
}

.sdn-toast--error {
	background: #fff;
	color: #131313;
	border-color: #c8102e;
}

/* WooCommerce notices — soft alert (global) */
.woocommerce-notices-wrapper {
	box-sizing: border-box;
	width: 100%;
	max-width: 172.8rem;
	margin-left: auto;
	margin-right: auto;
	padding-left: 4.8rem;
	padding-right: 4.8rem;
}

.woocommerce-notices-wrapper:empty,
.woocommerce-NoticeGroup:empty {
	display: none;
}

.woocommerce-notices-wrapper > *:not(:last-child),
.woocommerce-NoticeGroup > *:not(:last-child) {
	margin-bottom: 1.2rem;
}

.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
	list-style: none;
	margin: 0 0 1.6rem;
	padding: 1.4rem 1.6rem;
	border: 1px solid transparent;
	border-left-width: 0.4rem;
	border-radius: 0;
	font-size: 1.4rem;
	line-height: 1.5;
	color: #131313;
	background: #f5f5f2;
}

.woocommerce-error li,
.woocommerce-message li,
.woocommerce-info li {
	margin: 0;
	padding: 0;
}

.woocommerce-error li + li,
.woocommerce-message li + li,
.woocommerce-info li + li {
	margin-top: 0.6rem;
}

.woocommerce-error a,
.woocommerce-message a,
.woocommerce-info a {
	font-weight: 600;
	text-decoration: underline;
	color: inherit;
}

.woocommerce-message {
	border-color: #b7e0cc;
	border-left-color: #009262;
	background: #e8f6ef;
	color: #0f5c3d;
}

.woocommerce-message a {
	color: #009262;
}

.woocommerce-error {
	border-color: #f0c4c1;
	border-left-color: #c5342d;
	background: #fceceb;
	color: #8f241f;
}

.woocommerce-error a {
	color: #c5342d;
}

.woocommerce-info {
	border-color: #e0e0dc;
	border-left-color: #73736f;
	background: #f5f5f2;
	color: #3d3d3a;
}

.woocommerce-info a {
	color: #131313;
}

@media (max-width: 1024px) {
	.woocommerce-notices-wrapper {
		padding-left: 2.4rem;
		padding-right: 2.4rem;
	}
}

@media (max-width: 767px) {
	.woocommerce-notices-wrapper {
		padding-left: 1.6rem;
		padding-right: 1.6rem;
	}
}

.product-card.is-loading {
	opacity: 0.72;
	/* Không dùng pointer-events:none — sẽ fire mouseleave giả, mất is-hover,
	   ảnh về packshot + media height nhảy trong lúc ATC. Chặn double-click ở JS. */
}

/* Header logos */
.header-logo-img {
	position: relative;
}

.header-logo-img .header-logo-light {
	display: none;
}

.header-logo-img .header-logo-dark,
.header-logo-img .header-logo-light {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Transparent header over hero banner */
body.has-hero-overlay .header:not(.is-fixed) .header-main {
	background-color: transparent;
}

body.has-hero-overlay .header:not(.is-fixed) .menu-link,
body.has-hero-overlay .header:not(.is-fixed) .menu-index {
	color: #fff;
}

body.has-hero-overlay .header:not(.is-fixed) .menu-item.current-menu-item .menu-link {
	color: #c5342d;
}

body.has-hero-overlay .header:not(.is-fixed) .menu-item.current-menu-item .menu-index {
	color: #fff;
}

body.has-hero-overlay .header:not(.is-fixed) .header-logo-dark {
	display: none;
}

body.has-hero-overlay .header:not(.is-fixed) .header-logo-light {
	display: block;
}

body.has-hero-overlay .header:not(.is-fixed) .header-icon img,
body.has-hero-overlay .header:not(.is-fixed) .search > img {
	filter: brightness(0) invert(1);
}

body.has-hero-overlay .header:not(.is-fixed) .menu-icon span {
	background-color: #fff;
}

body.has-hero-overlay .header.is-fixed .header-main {
	background-color: #f5f5f2;
}

body.has-hero-overlay .header.is-fixed .header-logo-light {
	display: none;
}

body.has-hero-overlay .header.is-fixed .header-logo-dark {
	display: block;
}

@media screen and (max-width: 1200px) {
	body.has-hero-overlay .header:not(.is-fixed) .header-nav {
		/* mobile drawer keeps readable dark text on its own panel */
	}

	body.has-hero-overlay .header:not(.is-fixed) .header-nav .menu-link,
	body.has-hero-overlay .header:not(.is-fixed) .header-nav .menu-index {
		color: #131313;
	}
}
