/* ==========================================================================
   Nghĩa Nhân Agri – header, menu dọc danh mục, off-canvas, mini-cart, footer
   Breakpoint mobile: < 850px (theo F01)

   Base styles loaded on every page: also the product card and lists, the promo strip,
   breadcrumbs, live search, the login lightbox and the floating contact buttons.
   Page-specific styles: home.css, shop.css, product.css, checkout.css, account.css,
   contact.css (enqueued per page in functions.php).
   ========================================================================== */

:root {
	--nna-primary: var(--theme-palette-color-1, #2e7d32);
	--nna-primary-dark: var(--theme-palette-color-2, #1b5e20);
	--nna-accent: #f57c00;
	--nna-text: var(--theme-palette-color-4, #1f2d1f);
	--nna-muted: var(--theme-palette-color-3, #5b6b5b);
	--nna-border: var(--theme-palette-color-5, #e3e9e3);
	--nna-soft: var(--theme-palette-color-6, #f3f7f2);
	--nna-white: #fff;
	--nna-radius: 8px;
	/* Hover state for the header pills (cart, hotline): a shade darker than primary-dark. */
	--nna-pill-hover: color-mix(in srgb, var(--nna-primary-dark) 80%, #000);
	--nna-shadow: 0 8px 24px rgba(16, 40, 16, .12);
	--nna-header-top: var(--wp-admin--admin-bar--height, 0px);
	/* Status colours: errors / sale prices, success messages, brand buttons. */
	--nna-danger: #d32f2f;
	--nna-danger-strong: #c62828;
	--nna-danger-soft: #fdecea;
	--nna-success-soft: #e8f5e9;
	--nna-zalo: #0068ff;
	--nna-call: #e53935;
}

.nna-icon { display: block; flex: none; }

html.nna-no-scroll { overflow: hidden; }

/* ---------- Header ---------- */

.nna-header {
	position: sticky;
	top: var(--nna-header-top);
	z-index: 100;
	background: var(--nna-white);
	transition: box-shadow .2s;
}

.nna-header.is-scrolled { box-shadow: 0 2px 12px rgba(0, 0, 0, .08); }

/* Admin bar trên màn hình nhỏ không dính nên header bám sát mép trên. */
@media (max-width: 600px) {
	.nna-header { --nna-header-top: 0px; }
}

.nna-header__main-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 84px;
}

.nna-logo { flex: none; }
.nna-logo__link {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
}
.nna-logo img { display: block; max-height: 72px; width: auto; }
.nna-logo__text {
	font-size: 22px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--nna-primary);
	letter-spacing: -.01em;
	white-space: nowrap;
}

.nna-header__search { flex: 1; max-width: 560px; }

.nna-search { position: relative; display: flex; }
.nna-search__input {
	--theme-form-field-height: 44px;
	width: 100%;
	height: 44px;
	padding: 0 52px 0 16px !important;
	border: 2px solid var(--nna-primary) !important;
	border-radius: 999px !important;
	background: var(--nna-white);
	font-size: 15px;
}
.nna-search__submit {
	position: absolute;
	top: 4px;
	right: 4px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	min-height: 0; /* parent theme sets min-height: 40px on buttons */
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nna-primary);
	color: var(--nna-white);
	cursor: pointer;
}
.nna-search__submit:hover { background: var(--nna-primary-dark); }

.nna-header__actions {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-left: auto;
}

.nna-hotline {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--nna-text);
	text-decoration: none;
}
.nna-hotline__icon {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--nna-primary);
	color: var(--nna-white);
}
.nna-hotline:hover .nna-hotline__icon { background: var(--nna-primary-dark); }
.nna-hotline__text { display: flex; flex-direction: column; line-height: 1.2; }
.nna-hotline__text small { font-size: 12px; color: var(--nna-muted); }
.nna-hotline__text strong { font-size: 16px; color: var(--nna-accent); white-space: nowrap; }

/* Header hotline = highlighted pill like the cart toggle: icon circle + white text. */
.nna-header__actions .nna-hotline {
	padding: 3px 18px 3px 3px;
	border-radius: 999px;
	background: var(--nna-primary-dark);
	color: var(--nna-white);
	transition: background-color .2s;
}
.nna-header__actions .nna-hotline:hover { background: var(--nna-pill-hover); }
.nna-header__actions .nna-hotline__icon,
.nna-header__actions .nna-hotline:hover .nna-hotline__icon { background: var(--nna-primary); }
.nna-header__actions .nna-hotline__text small { color: rgba(255, 255, 255, .85); }
.nna-header__actions .nna-hotline__text strong { color: var(--nna-white); }

.nna-account,
.nna-cart__icon,
.nna-burger {
	position: relative;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--nna-text);
	cursor: pointer;
}
.nna-account:hover,
.nna-burger:hover { color: var(--nna-primary); background: var(--nna-soft); }
/* Header action icons: solid brand-color circle (palette color 1 in Customizer). */
.nna-account,
.nna-cart__icon { color: var(--nna-white); background: var(--nna-primary); }
.nna-account:hover,
.nna-cart__toggle:hover .nna-cart__icon { color: var(--nna-white); background: var(--nna-primary-dark); }

/* Cart toggle = highlighted pill: brand-color container, icon circle + white label. */
.nna-cart__toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 3px 3px 3px 18px;
	border-radius: 999px;
	background: var(--nna-primary-dark);
	color: var(--nna-white);
	text-decoration: none;
	transition: background-color .2s;
}
.nna-cart__toggle:hover,
.nna-cart.is-open .nna-cart__toggle { color: var(--nna-white); background: var(--nna-pill-hover); }
/* Icon circle keeps the same color as the other header icons (e.g. account). */
.nna-cart__toggle .nna-cart__icon,
.nna-cart__toggle:hover .nna-cart__icon { background: var(--nna-primary); }
.nna-cart__label { font-size: 15px; font-weight: 600; white-space: nowrap; color: inherit; }

/* ---------- Mini-cart ---------- */

.nna-cart { position: relative; }

.nna-cart__count {
	position: absolute;
	top: 0;
	right: -2px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--nna-accent);
	color: var(--nna-white);
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

.nna-cart.is-bump .nna-cart__icon { animation: nna-bump .6s ease; }
@keyframes nna-bump {
	30% { transform: scale(1.2); }
	60% { transform: scale(.95); }
}

.nna-cart__dropdown {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	/* Stay above the menu row below, whose positioned items paint later. */
	z-index: 120;
	width: 340px;
	max-width: calc(100vw - 24px);
	padding: 16px;
	border-radius: var(--nna-radius);
	background: var(--nna-white);
	box-shadow: var(--nna-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .15s, transform .15s, visibility .15s;
}
/* Cầu nối vô hình để rê chuột từ icon xuống dropdown không bị đóng. */
.nna-cart__dropdown::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -12px;
	height: 12px;
}
.nna-cart.is-open .nna-cart__dropdown {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.nna-cart__title {
	margin: 0 0 8px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--nna-border);
	font-weight: 700;
}

.nna-cart__dropdown .woocommerce-mini-cart { max-height: 320px; overflow-y: auto; margin: 0; }
.nna-cart__dropdown .woocommerce-mini-cart__empty-message { margin: 12px 0; color: var(--nna-muted); text-align: center; }
.nna-cart__dropdown .woocommerce-mini-cart__total { margin: 12px 0; display: flex; justify-content: space-between; }
.nna-cart__dropdown .woocommerce-mini-cart__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.nna-cart__dropdown .woocommerce-mini-cart__buttons .button { margin: 0; justify-content: center; text-align: center; }
.nna-cart__dropdown .woocommerce-mini-cart__buttons .checkout { background: var(--nna-accent); }

/* ---------- Hàng menu ---------- */

.nna-header__nav {
	background: var(--nna-primary);
	color: var(--nna-white);
}
.nna-header__nav-inner {
	display: flex;
	align-items: stretch;
	gap: 24px;
	min-height: 48px;
}

.nna-catmenu { position: relative; flex: none; width: 260px; }
.nna-catmenu__toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	height: 100%;
	padding: 0 16px;
	border: 0;
	border-radius: 0;
	background: var(--nna-primary-dark);
	color: var(--nna-white);
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
}
.nna-catmenu__toggle::after {
	content: "";
	width: 8px;
	height: 8px;
	margin: -4px 2px 0 auto;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform .2s;
}
.nna-catmenu.is-open .nna-catmenu__toggle::after { transform: rotate(-135deg); margin-top: 4px; }

.nna-catmenu__panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 10;
	width: 100%;
	background: var(--nna-white);
	border: 1px solid var(--nna-border);
	border-top: 0;
	box-shadow: var(--nna-shadow);
}

.nna-catlist { margin: 0; padding: 0; list-style: none; }
.nna-catlist li { margin: 0; }
/* Each row: round icon · bold name · product count pill (F02). */
.nna-catlist a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px;
	color: var(--nna-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color .15s, color .15s, box-shadow .15s;
}
.nna-catlist--dropdown > li + li,
.nna-catlist--hero > li + li { border-top: 1px solid var(--nna-border); }
.nna-catlist__icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--nna-success-soft);
	color: var(--nna-primary);
	transition: background-color .15s, color .15s;
}
.nna-catlist__name { flex: 1; min-width: 0; }
.nna-catlist__count {
	flex: none;
	min-width: 26px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--nna-soft);
	color: var(--nna-muted);
	font-size: 12px;
	font-weight: 700;
	text-align: center;
	transition: background-color .15s, color .15s;
}

/* Hover: pale row, green bar on the left, icon and count turn solid green. */
.nna-catlist a:hover { color: var(--nna-primary); background: var(--nna-soft); box-shadow: inset 3px 0 0 var(--nna-primary); }
.nna-catlist a:hover .nna-catlist__icon,
.nna-catlist a:hover .nna-catlist__count { background: var(--nna-primary); color: var(--nna-white); }

/* Category being viewed: the whole row solid green. */
.nna-catlist .current-menu-item > a { background: var(--nna-primary); color: var(--nna-white); box-shadow: none; }
.nna-catlist .current-menu-item > a .nna-catlist__icon { background: var(--nna-white); color: var(--nna-primary); }
.nna-catlist .current-menu-item > a .nna-catlist__count { background: rgba(255, 255, 255, .2); color: var(--nna-white); }

.nna-mainnav { display: flex; }
.nna-menu {
	display: flex;
	align-items: stretch;
	margin: 0;
	padding: 0;
	list-style: none;
}
.nna-menu > li { position: relative; margin: 0; display: flex; }
.nna-menu > li > a {
	display: flex;
	align-items: center;
	padding: 0 16px;
	color: var(--nna-white);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.nna-menu > li > a:hover,
.nna-menu > .current-menu-item > a,
.nna-menu > .current-menu-ancestor > a,
.nna-menu > .current_page_parent > a { background: rgba(255, 255, 255, .14); }

/* Menu con (nếu admin thêm) */
.nna-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 10;
	min-width: 220px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: var(--nna-white);
	box-shadow: var(--nna-shadow);
	border-radius: 0 0 var(--nna-radius) var(--nna-radius);
	opacity: 0;
	visibility: hidden;
}
.nna-menu > li:hover > .sub-menu,
.nna-menu > li:focus-within > .sub-menu { opacity: 1; visibility: visible; }
.nna-menu .sub-menu a { display: block; padding: 8px 16px; color: var(--nna-text); text-decoration: none; }
.nna-menu .sub-menu a:hover { color: var(--nna-primary); background: var(--nna-soft); }

/* ---------- Off-canvas ---------- */

.nna-burger { display: none; }

.nna-offcanvas { position: fixed; inset: 0; z-index: 100000; }
.nna-offcanvas[hidden] { display: none; }
.nna-offcanvas__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	transition: opacity .25s;
}
.nna-offcanvas__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: min(340px, 86vw);
	overflow-y: auto;
	padding: 16px;
	background: var(--nna-white);
	transform: translateX(-100%);
	transition: transform .25s ease;
}
.nna-offcanvas.is-open .nna-offcanvas__backdrop { opacity: 1; }
.nna-offcanvas.is-open .nna-offcanvas__panel { transform: none; }

.nna-offcanvas__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.nna-logo--small img { max-height: 48px; }
.nna-logo--small .nna-logo__text { font-size: 18px; }
.nna-offcanvas__close {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nna-soft);
	color: var(--nna-text);
	cursor: pointer;
}
.nna-offcanvas .nna-search { margin-bottom: 12px; }

.nna-menu--vertical { display: block; margin: 0 -16px; }
.nna-menu--vertical > li { display: block; border-bottom: 1px solid var(--nna-border); }
.nna-menu--vertical > li > a { padding: 13px 16px; color: var(--nna-text); }
.nna-menu--vertical > li > a:hover,
.nna-menu--vertical > .current-menu-item > a { background: var(--nna-soft); color: var(--nna-primary); }
.nna-menu--vertical .sub-menu { position: static; opacity: 1; visibility: visible; box-shadow: none; padding: 0 0 8px 16px; }

.nna-offcanvas__title {
	margin: 20px 0 4px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--nna-muted);
}
.nna-offcanvas .nna-catlist { margin: 0 -16px; }
.nna-offcanvas .nna-catlist a { padding: 10px 16px; }

.nna-hotline--block {
	margin-top: 20px;
	padding: 12px;
	border-radius: var(--nna-radius);
	background: var(--nna-soft);
}

/* ---------- Header mobile (< 850px) ---------- */

@media (max-width: 849.98px) {
	.nna-header__main-inner {
		display: grid;
		/* The logo takes all the room between burger and actions, so its name can wrap instead of overlapping. */
		grid-template-columns: auto minmax(0, 1fr) auto;
		gap: 8px;
		min-height: 64px;
	}
	.nna-burger { display: grid; justify-self: start; }
	.nna-logo { justify-self: center; min-width: 0; }
	.nna-logo__link { gap: 8px; }
	.nna-logo img { max-height: 48px; }
	.nna-logo__text { font-size: 17px; white-space: normal; }
	.nna-header__actions { justify-self: end; gap: 4px; }

	.nna-header__search,
	.nna-header__nav,
	.nna-header__actions .nna-hotline,
	.nna-header__actions .nna-account,
	.nna-cart__label { display: none; }
	.nna-cart__toggle { padding: 0; }

	.nna-cart__dropdown { position: fixed; top: calc(var(--nna-header-top) + 64px); right: 12px; }
}

/* Laptop nhỏ: thu gọn hotline để đủ chỗ cho ô tìm kiếm */
@media (min-width: 850px) and (max-width: 1099.98px) {
	.nna-header__main-inner { gap: 16px; }
	.nna-hotline__text,
	.nna-cart__label { display: none; }
	.nna-cart__toggle { padding: 0; }
	.nna-header__actions .nna-hotline { padding: 0; }
	.nna-catmenu { width: 220px; }
	.nna-menu > li > a { padding: 0 10px; font-size: 14px; }
}

/* ---------- Footer ---------- */

.nna-footer { background: #17301a; color: rgba(255, 255, 255, .78); font-size: 15px; }
.nna-footer a { color: inherit; text-decoration: none; }
.nna-footer a:hover { color: var(--nna-white); text-decoration: underline; }

.nna-commit { background: var(--nna-primary); color: var(--nna-white); }
.nna-commit__list {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin: 0 auto;
	padding-top: 22px;
	padding-bottom: 22px;
	list-style: none;
}
.nna-commit__item { display: flex; align-items: center; gap: 12px; margin: 0; }
.nna-commit__icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 52px;
	height: 52px;
	border: 2px solid rgba(255, 255, 255, .6);
	border-radius: 50%;
}
.nna-commit__text { display: flex; flex-direction: column; line-height: 1.3; }
.nna-commit__text strong { font-size: 16px; text-transform: uppercase; }

.nna-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
	gap: 32px;
	padding-top: 48px;
	padding-bottom: 40px;
}
.nna-footer__title {
	margin: 0 0 16px;
	color: var(--nna-white);
	font-size: 17px;
	font-weight: 700;
	text-transform: uppercase;
}
/* Same logo + name as the header; the white logo is cut into a round badge on the dark footer. */
.nna-logo--footer { margin-bottom: 16px; }
.nna-logo--footer img {
	width: 64px;
	height: 64px;
	max-height: none;
	object-fit: cover;
	border-radius: 50%;
	background: var(--nna-white);
}
.nna-logo--footer .nna-logo__text { color: var(--nna-white); }
.nna-footer .nna-logo__link:hover { text-decoration: none; }

.nna-contact,
.nna-footer__menu { margin: 0; padding: 0; list-style: none; }
.nna-contact li { display: flex; gap: 10px; margin: 0 0 10px; }
.nna-contact .nna-icon { margin-top: 3px; color: var(--nna-accent); }
.nna-footer__menu li { margin: 0 0 10px; }

.nna-fanpage { max-width: 340px; overflow: hidden; border-radius: var(--nna-radius); }
.nna-fanpage iframe { display: block; width: 100%; }

/* TikTok / YouTube buttons under the Fanpage box, with a tooltip on hover. */
.nna-social {
	display: flex;
	gap: 12px;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
}
.nna-social li { margin: 0; }
.nna-social__btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	color: var(--nna-white);
	transition: transform .2s;
}
.nna-social__btn:hover,
.nna-social__btn:focus-visible { color: var(--nna-white); transform: translateY(-2px); }
.nna-social__btn--facebook { background: #1877f2; }
.nna-social__btn--tiktok { background: #111; }
.nna-social__btn--youtube { background: #c4302b; }
.nna-social__btn::before,
.nna-social__btn::after {
	position: absolute;
	bottom: 100%;
	left: 50%;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translate(-50%, 4px);
	transition: opacity .2s, transform .2s, visibility .2s;
}
.nna-social__btn::before {
	content: attr(data-tooltip);
	margin-bottom: 10px;
	padding: 8px 14px;
	border-radius: 6px;
	background: #000;
	color: var(--nna-white);
	font-size: 14px;
	line-height: 1.3;
	white-space: nowrap;
}
.nna-social__btn::after {
	content: "";
	margin-bottom: 2px;
	border: 8px solid transparent;
	border-bottom: 0;
	border-top-color: #000;
}
.nna-social__btn:hover::before,
.nna-social__btn:hover::after,
.nna-social__btn:focus-visible::before,
.nna-social__btn:focus-visible::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
/* The first button sits at the column's left edge, so its tooltip grows rightwards to stay on screen. */
.nna-social li:first-child .nna-social__btn::before { left: 0; transform: translate(0, 4px); }
.nna-social li:first-child .nna-social__btn:hover::before,
.nna-social li:first-child .nna-social__btn:focus-visible::before { transform: translate(0, 0); }

.nna-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .12); }
.nna-footer__bottom p { margin: 0 auto; padding-top: 16px; padding-bottom: 16px; font-size: 14px; text-align: center; }

@media (max-width: 1023.98px) {
	.nna-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 849.98px) {
	.nna-commit__list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 599.98px) {
	.nna-commit__list { gap: 14px 10px; padding-top: 16px; padding-bottom: 16px; }
	.nna-commit__icon { width: 40px; height: 40px; }
	.nna-commit__icon .nna-icon { width: 22px; height: 22px; }
	.nna-commit__text { font-size: 13px; }
	.nna-commit__text strong { font-size: 13px; }
	.nna-footer__grid { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
}

/* ---------- Product card (F03, used site-wide) ---------- */

.nna-card {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--nna-border);
	border-radius: var(--nna-radius);
	background: var(--nna-white);
	list-style: none;
	transition: box-shadow .2s, border-color .2s;
}
.nna-card:hover { border-color: var(--nna-primary); box-shadow: 0 4px 14px rgba(16, 40, 16, .1); }

.nna-card__media { position: relative; aspect-ratio: 1; background: var(--nna-white); }
.nna-card__media > a { position: absolute; inset: 0; }
.nna-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 8px;
	object-fit: contain;
	background: var(--nna-white);
}
.nna-card--out .nna-card__img { opacity: .6; }

/* 2nd image on hover: mouse devices only. display:none keeps the lazy image from loading on mobile. */
.nna-card__img--hover { display: none; }
@media (hover: hover) and (min-width: 850px) {
	.nna-card__img--hover { display: block; opacity: 0; transition: opacity .3s; }
	.nna-card:hover .nna-card__img--hover { opacity: 1; }
}

.nna-card__badges {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	pointer-events: none;
}
.nna-badge {
	padding: 3px 8px;
	border-radius: 4px;
	color: var(--nna-white);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
}
.nna-badge--sale { background: var(--nna-danger); }
.nna-badge--out { background: #616161; }

.nna-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 10px 12px 12px;
}

.nna-card__title {
	margin: 0;
	min-height: 2.8em;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}
.nna-card__title a {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	color: var(--nna-text);
	text-decoration: none;
}
.nna-card__title a:hover { color: var(--nna-primary); }

.nna-card__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: flex-start;
	gap: 0 8px;
	margin-top: auto;
	color: var(--nna-danger);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}
.nna-card__price del { order: 2; color: var(--nna-muted); font-size: 14px; font-weight: 400; opacity: 1; }
.nna-card__price ins { order: 1; text-decoration: none; }

.nna-card .nna-card__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	min-height: 40px;
	margin: 0;
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 14px;
	text-align: center;
}
.nna-card .nna-card__btn.loading { opacity: .6; pointer-events: none; }
.nna-card .nna-card__btn.added::after { content: "✓"; }
/* WooCommerce inserts a "View cart" link after adding; the header cart icon already bumps to signal it. */
.nna-card .added_to_cart { display: none; }
.nna-card--out .nna-card__btn { background: var(--nna-soft); color: var(--nna-muted); }

/* ---------- Card lists: grid / carousel ---------- */

.nna-products {
	--nna-cols: 5;
	--nna-gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.nna-products--grid {
	display: grid;
	grid-template-columns: repeat(var(--nna-cols), minmax(0, 1fr));
	gap: var(--nna-gap);
}
.nna-products--carousel {
	display: grid;
	grid-auto-columns: calc((100% - (var(--nna-cols) - 1) * var(--nna-gap)) / var(--nna-cols));
	grid-auto-flow: column;
	gap: var(--nna-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.nna-products--carousel::-webkit-scrollbar,
.nna-slider__track::-webkit-scrollbar { display: none; }
.nna-products--carousel > li { scroll-snap-align: start; }

@media (max-width: 1099.98px) {
	.nna-products { --nna-cols: 4; }
}
@media (max-width: 849.98px) {
	.nna-products { --nna-cols: 3; --nna-gap: 12px; }
}
@media (max-width: 599.98px) {
	.nna-products { --nna-cols: 2; --nna-gap: 10px; }
	/* Peek at the next card so visitors know they can swipe. */
	.nna-products--carousel { grid-auto-columns: 44%; }
	.nna-card__body { padding: 8px 10px 10px; }
	.nna-card__price { font-size: 16px; }
}

.nna-carousel { position: relative; }

.nna-carousel__nav,
.nna-slider__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--nna-border);
	border-radius: 50%;
	background: var(--nna-white);
	color: var(--nna-text);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity .2s, color .2s, background-color .2s;
}
.nna-carousel__nav:hover,
.nna-slider__nav:hover { background: var(--nna-primary); color: var(--nna-white); }
.nna-carousel__nav { top: 38%; }
.nna-carousel__nav--prev,
.nna-slider__nav--prev { left: -14px; }
.nna-carousel__nav--next,
.nna-slider__nav--next { right: -14px; }
.nna-carousel__nav--prev .nna-icon,
.nna-slider__nav--prev .nna-icon { transform: rotate(180deg); }
.nna-carousel__nav:disabled { opacity: 0; pointer-events: none; }
.nna-carousel.is-static .nna-carousel__nav { display: none; }

/* Touch / small screens: swipe, no buttons needed. */
@media (hover: none), (max-width: 849.98px) {
	.nna-carousel__nav { display: none; }
}

/* ---------- Product / post blocks (front page, related products) ---------- */

.nna-section { margin-bottom: 40px; }

/* Promo sign-up strip (every page, above the footer): title on the left, phone form on the right; stacks on mobile. */
.nna-promo-wrap { padding-bottom: 48px; }
.nna-promo {
	position: relative;
	isolation: isolate;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 24px 48px;
	padding: 32px 48px;
	overflow: hidden;
	border-radius: var(--nna-radius);
	background: var(--nna-primary) center / cover no-repeat;
	color: var(--nna-white);
}
/* Darken the photo so white text stays readable whatever image the admin picks. */
.nna-promo.has-image::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(90deg, rgba(0, 0, 0, .65), rgba(0, 0, 0, .35));
}
.nna-promo__title {
	margin: 0;
	color: var(--nna-white);
	font-size: clamp(24px, 3vw, 36px);
	font-weight: 800;
	line-height: 1.15;
	text-transform: uppercase;
	letter-spacing: .01em;
}
.nna-promo__subtitle {
	margin: 4px 0 0;
	color: #ffd23f;
	font-size: clamp(20px, 2.4vw, 28px);
	font-style: italic;
	font-weight: 800;
	line-height: 1.2;
}
.nna-promo__form { position: relative; margin: 0; }
.nna-promo__row { display: flex; gap: 16px; }
/* Scoped under .nna-promo to beat Blocksy's input[type=tel] form styles. */
.nna-promo .nna-promo__input {
	--theme-form-field-height: 52px;
	--theme-form-field-background-initial-color: var(--nna-white);
	--theme-form-field-background-focus-color: var(--nna-white);
	flex: 1;
	min-width: 0;
	height: 52px;
	padding: 0 16px;
	border: 2px solid transparent;
	border-radius: 4px;
	background: var(--nna-white);
	color: var(--nna-text);
	font-size: 16px;
}
.nna-promo .nna-promo__input::placeholder { color: var(--nna-muted); opacity: 1; }
.nna-promo .nna-promo__input:focus { border-color: var(--nna-accent); outline: none; }
.nna-promo .nna-promo__input[aria-invalid="true"] { border-color: var(--nna-danger-strong); }
.nna-promo__submit {
	flex: none;
	min-width: 140px;
	height: 52px;
	padding: 0 24px;
	border: 0;
	border-radius: 4px;
	background: var(--nna-accent);
	color: var(--nna-white);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}
.nna-promo__submit:hover { filter: brightness(.92); }
.nna-promo__form.is-loading .nna-promo__submit { opacity: .7; cursor: progress; }
.nna-promo__msg {
	margin: 10px 0 0;
	padding: 8px 12px;
	border-radius: 4px;
	background: var(--nna-danger-soft);
	color: #b71c1c;
	font-size: 14px;
}
.nna-promo__msg.is-ok { background: var(--nna-success-soft); color: #1b5e20; }

@media (max-width: 849.98px) {
	.nna-promo-wrap { padding-bottom: 32px; }
	.nna-promo { grid-template-columns: 1fr; padding: 24px 20px; text-align: center; }
	.nna-promo__row { flex-direction: column; gap: 10px; }
	.nna-promo__submit { width: 100%; }
}

.nna-section__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
	border-bottom: 2px solid var(--nna-border);
}
.nna-section__title {
	margin: 0 0 -2px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--nna-primary);
	color: var(--nna-primary-dark);
	font-size: 20px;
	line-height: 1.3;
	text-transform: uppercase;
}
.nna-section__more {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding-bottom: 10px;
	color: var(--nna-primary);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.nna-section__more:hover { color: var(--nna-primary-dark); text-decoration: underline; }

@media (max-width: 599.98px) {
	.nna-section { margin-bottom: 28px; }
	.nna-section__title { font-size: 17px; }
	.nna-section__more { font-size: 14px; }
}

/* ---------- Breadcrumb (product listing, single product) ---------- */

.nna-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	margin-bottom: 12px;
	color: var(--nna-muted);
	font-size: 14px;
}
.nna-breadcrumb a { color: var(--nna-muted); text-decoration: none; }
.nna-breadcrumb a:hover { color: var(--nna-primary); }
.nna-breadcrumb__sep { opacity: .6; }

/* ---------- Search: live suggestions, mobile toggle, empty results (F07) ---------- */

.nna-live {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 110;
	min-width: 320px;
	max-height: min(480px, calc(100vh - 140px));
	overflow-y: auto;
	padding: 6px;
	border: 1px solid var(--nna-border);
	border-radius: var(--nna-radius);
	background: var(--nna-white);
	box-shadow: var(--nna-shadow);
}
.nna-live[hidden] { display: none; }

.nna-search.is-loading .nna-search__submit { opacity: .75; }

.nna-live__list { margin: 0; padding: 0; list-style: none; }

.nna-live__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 8px;
	border-radius: 6px;
	color: var(--nna-text);
	text-decoration: none;
}
.nna-live__item:hover,
.nna-live__item.is-active { background: var(--nna-soft); }

.nna-live__thumb {
	flex: none;
	width: 48px;
	height: 48px;
	border: 1px solid var(--nna-border);
	border-radius: 6px;
	background: var(--nna-white);
	object-fit: contain;
}
.nna-live__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nna-live__name {
	display: -webkit-box;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.35;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.nna-live__price { color: var(--nna-accent); font-size: 14px; font-weight: 700; }
.nna-live__price del { margin-left: 6px; color: var(--nna-muted); font-size: 13px; font-weight: 400; }
.nna-live__price ins { text-decoration: none; }
.nna-live__stock { color: var(--nna-muted); font-size: 12px; }

.nna-live__all {
	display: block;
	margin-top: 4px;
	padding: 10px 8px;
	border-top: 1px solid var(--nna-border);
	color: var(--nna-primary);
	font-size: 14px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}
.nna-live__all:hover,
.nna-live__all.is-active { background: var(--nna-soft); border-radius: 0 0 6px 6px; }

.nna-live__empty { margin: 8px 8px 4px; color: var(--nna-muted); font-size: 14px; }
.nna-live .nna-popcats { padding: 4px 8px 8px; text-align: left; }

/* Popular categories: live search with no match and the empty results page. */
.nna-popcats { margin-top: 20px; }
.nna-popcats__title { margin: 0 0 8px; color: var(--nna-text); font-size: 14px; font-weight: 700; }
.nna-popcats__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.nna-shop__empty .nna-popcats__list { justify-content: center; }
.nna-popcats__link {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid var(--nna-border);
	border-radius: 999px;
	background: var(--nna-white);
	color: var(--nna-text);
	font-size: 14px;
	text-decoration: none;
}
.nna-popcats__link:hover { border-color: var(--nna-primary); color: var(--nna-primary); }

.nna-shop__empty-tip { margin: 0 0 4px; color: var(--nna-muted); }

/* Off-canvas: suggestions push the menu down instead of overlapping it. */
.nna-offcanvas .nna-search { flex-wrap: wrap; }
.nna-offcanvas .nna-live { position: static; flex-basis: 100%; min-width: 0; margin-top: 6px; box-shadow: none; }

.nna-search-toggle {
	display: none;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nna-primary);
	color: var(--nna-white);
	cursor: pointer;
}
.nna-search-toggle:hover,
.nna-search-toggle[aria-expanded="true"] { color: var(--nna-white); background: var(--nna-primary-dark); }

@media (max-width: 849.98px) {
	.nna-search-toggle { display: grid; }

	/* The magnifier opens the header search box as a full-width second row. */
	.nna-header.is-search-open .nna-header__search {
		display: block;
		grid-column: 1 / -1;
		grid-row: 2;
		max-width: none;
		padding-bottom: 10px;
	}
	.nna-live { min-width: 0; max-height: calc(100vh - 150px); }
}

/* ---------- Customer accounts (F08) ---------- */

/* Login / register / lost password: lightbox and /my-account/ */
.nna-auth-modal {
	width: min(440px, calc(100% - 32px));
	max-height: calc(100dvh - 32px);
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: var(--nna-white);
	color: var(--nna-text);
	box-shadow: var(--nna-shadow);
	overflow: auto;
	overscroll-behavior: contain;
}
.nna-auth-modal::backdrop { background: rgba(16, 32, 16, .55); }
.nna-auth-modal[open] { animation: nna-auth-in .2s ease-out; }
@keyframes nna-auth-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .nna-auth-modal[open] { animation: none; } }

.nna-auth-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--nna-muted);
	cursor: pointer;
}
.nna-auth-modal__close:hover { background: var(--nna-soft); color: var(--nna-text); }

.nna-auth { padding: 28px 28px 24px; }
.nna-auth--page {
	max-width: 460px;
	margin: 0 auto;
	border: 1px solid var(--nna-border);
	border-radius: 12px;
	background: var(--nna-white);
}
.nna-auth__title { margin: 0 40px 16px 0; font-size: 22px; font-weight: 700; color: var(--nna-text); }
.nna-auth__subtitle { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.nna-auth__intro { margin: 0 0 16px; color: var(--nna-muted); font-size: 14px; }

.nna-auth__tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--nna-border);
}
.nna-auth__tab {
	margin-bottom: -1px;
	padding: 10px 8px;
	border: 0;
	border-bottom: 3px solid transparent;
	background: none;
	color: var(--nna-muted);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}
.nna-auth__tab:hover { color: var(--nna-text); }
.nna-auth__tab[aria-selected="true"] { border-bottom-color: var(--nna-primary); color: var(--nna-primary-dark); }
/* "Quên mật khẩu" has its own heading and a link back to login. */
.nna-auth[data-view="lost"] .nna-auth__tabs { display: none; }

.nna-auth__form { display: grid; gap: 14px; }
.nna-auth__form[hidden] { display: none; }
.nna-auth__form > p { margin: 0; }
.nna-auth__field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.nna-auth__field input { width: 100%; min-height: 46px; font-size: 16px; } /* 16px: no zoom on iOS */
.nna-auth__field input[aria-invalid="true"] { border-color: var(--nna-danger-strong); }
.nna-auth__hint { display: block; margin-top: 6px; color: var(--nna-muted); font-size: 13px; }

.nna-auth__password { position: relative; display: block; }
.nna-auth__password input { padding-right: 48px; }
.nna-auth__reveal {
	position: absolute;
	top: 0;
	right: 0;
	display: grid;
	place-items: center;
	width: 46px;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: var(--nna-muted);
	cursor: pointer;
}
.nna-auth__reveal[aria-pressed="true"] { color: var(--nna-primary); }

.nna-auth__row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; font-size: 14px; }
.nna-auth__check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.nna-auth__link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--nna-primary);
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}
.nna-auth__link:hover { color: var(--nna-primary-dark); }

.nna-auth__submit { width: 100%; min-height: 48px; font-size: 16px; font-weight: 700; }
.nna-auth__form.is-loading .nna-auth__submit { opacity: .7; cursor: progress; }
.nna-auth__switch { color: var(--nna-muted); font-size: 14px; text-align: center; }

.nna-form-msg {
	margin: 0;
	padding: 10px 12px;
	border-left: 4px solid var(--nna-danger-strong);
	border-radius: 4px;
	background: var(--nna-danger-soft);
	color: #8e1c1c;
	font-size: 14px;
}
.nna-form-msg.is-ok { border-left-color: var(--nna-primary); background: var(--nna-soft); color: var(--nna-primary-dark); }
.nna-form-msg[hidden] { display: none; }

.nna-auth .woocommerce-privacy-policy-text p { margin: 0; color: var(--nna-muted); font-size: 13px; }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.nna-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 599.98px) {
	.nna-auth { padding: 24px 16px 20px; }
	.nna-auth--page { border: 0; padding: 0; }
}

/* Off-canvas account link (the header icon is hidden on mobile). */
.nna-offcanvas__account {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 20px;
	padding: 12px;
	border: 1px solid var(--nna-border);
	border-radius: var(--nna-radius);
	color: var(--nna-text);
	font-weight: 600;
	text-decoration: none;
}
.nna-offcanvas__account:hover { border-color: var(--nna-primary); color: var(--nna-primary); }

/* ---------- Floating contact buttons (F09) ---------- */

/* Floating buttons: a column of round buttons in the bottom-right corner (desktop). */
.nna-float {
	--nna-float-size: 52px;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 900;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.nna-float__btn {
	position: relative;
	display: flex;
	align-items: center;
	text-decoration: none;
}
.nna-float__icon {
	position: relative;
	display: grid;
	place-items: center;
	width: var(--nna-float-size);
	height: var(--nna-float-size);
	border-radius: 50%;
	background: var(--nna-float-color);
	color: var(--nna-white);
	box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
	transition: transform .15s;
}
.nna-float__btn:hover .nna-float__icon { transform: scale(1.08); }
.nna-float__btn--call { --nna-float-color: var(--nna-call); }
.nna-float__btn--zalo { --nna-float-color: var(--nna-zalo); }
.nna-float__btn--messenger { --nna-float-color: linear-gradient(45deg, #0099ff, #a033ff 60%, #ff5280); }
.nna-float__btn:focus-visible { outline: none; }
.nna-float__btn:focus-visible .nna-float__icon { outline: 3px solid var(--nna-text); outline-offset: 2px; }

/* Label slides out on hover / keyboard focus. */
.nna-float__label {
	position: absolute;
	right: calc(var(--nna-float-size) + 10px);
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--nna-text);
	color: var(--nna-white);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0;
	transform: translateX(6px);
	visibility: hidden;
	pointer-events: none;
	transition: opacity .15s, transform .15s, visibility 0s .15s;
}
.nna-float__btn:hover .nna-float__label,
.nna-float__btn:focus-visible .nna-float__label { opacity: 1; transform: none; visibility: visible; transition: opacity .15s, transform .15s; }

/* Call button: ringing handset and pulsing rings. */
.nna-float__btn--call .nna-float__icon::before,
.nna-float__btn--call .nna-float__icon::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 50%;
	background: var(--nna-float-color);
	animation: nna-float-pulse 1.8s ease-out infinite;
}
.nna-float__btn--call .nna-float__icon::after { animation-delay: .9s; }
.nna-float__btn--call .nna-icon { animation: nna-float-ring 1.8s ease-in-out infinite; }

@keyframes nna-float-pulse {
	from { opacity: .55; transform: scale(1); }
	to { opacity: 0; transform: scale(1.7); }
}
@keyframes nna-float-ring {
	0%, 50%, 100% { transform: rotate(0); }
	5%, 15%, 25%, 35% { transform: rotate(-18deg); }
	10%, 20%, 30%, 40% { transform: rotate(18deg); }
}
@media (prefers-reduced-motion: reduce) {
	.nna-float__btn--call .nna-float__icon::before,
	.nna-float__btn--call .nna-float__icon::after,
	.nna-float__btn--call .nna-icon { animation: none; }
}

/* Desktop: the add-to-cart toast opens to the left of the buttons. */
@media (min-width: 850px) {
	.nna-has-float .nna-toast { right: calc(20px + 52px + 16px); }
}

/* Mobile: a bar along the bottom; the page gets the same padding so it never covers content
   such as the "Thêm vào giỏ" button or the footer. */
@media (max-width: 849.98px) {
	body.nna-has-float { --nna-float-bar: calc(56px + env(safe-area-inset-bottom, 0px)); padding-bottom: var(--nna-float-bar); }

	.nna-float {
		--nna-float-size: 34px;
		left: 0;
		right: 0;
		bottom: 0;
		flex-direction: row;
		gap: 0;
		height: var(--nna-float-bar);
		padding-bottom: env(safe-area-inset-bottom, 0px);
		border-top: 1px solid var(--nna-border);
		background: var(--nna-white);
		box-shadow: 0 -4px 14px rgba(16, 40, 16, .08);
	}
	.nna-float__btn {
		flex: 1;
		justify-content: center;
		gap: 8px;
		color: var(--nna-text);
	}
	.nna-float__btn + .nna-float__btn { border-left: 1px solid var(--nna-border); }
	.nna-float__icon { box-shadow: none; }
	.nna-float__icon .nna-icon { width: 20px; height: 20px; }
	.nna-float__btn--call .nna-float__icon::before,
	.nna-float__btn--call .nna-float__icon::after { animation-name: nna-float-pulse-sm; }
	.nna-float__label,
	.nna-float__btn:hover .nna-float__label {
		position: static;
		padding: 0;
		background: none;
		color: inherit;
		opacity: 1;
		transform: none;
		visibility: visible;
	}
	.nna-float__btn--call .nna-float__label { color: var(--nna-call); font-weight: 700; }

	/* Add-to-cart toast sits above the bar. */
	.nna-has-float .nna-toast { bottom: calc(var(--nna-float-bar) + 12px); }
}
@keyframes nna-float-pulse-sm {
	from { opacity: .5; transform: scale(1); }
	to { opacity: 0; transform: scale(1.45); }
}

/* ---------- Back to top (F01) ---------- */

/* Bottom-right corner, centred under the floating contact column; fades in once scrolled (main.js). */
.nna-totop {
	--nna-totop-size: 44px;
	position: fixed;
	right: calc(20px + (52px - var(--nna-totop-size)) / 2);
	bottom: 20px;
	z-index: 900;
	display: grid;
	place-items: center;
	width: var(--nna-totop-size);
	height: var(--nna-totop-size);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nna-primary);
	color: var(--nna-white);
	box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
	cursor: pointer;
	opacity: 0;
	transform: translateY(12px);
	visibility: hidden;
	transition: opacity .2s, transform .2s, background-color .15s, visibility 0s .2s;
}
.nna-totop.is-visible { opacity: 1; transform: none; visibility: visible; transition: opacity .2s, transform .2s, background-color .15s; }
.nna-totop:hover { background: var(--nna-primary-dark); }
.nna-totop:focus-visible { outline: 3px solid var(--nna-text); outline-offset: 2px; }
.nna-totop .nna-icon { transform: rotate(-90deg); }
/* The header only takes focus from the button (tabindex -1); no ring around the whole header. */
.nna-header:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
	.nna-totop,
	.nna-totop.is-visible { transform: none; transition: none; }
}

/* Desktop: the contact column sits on top of the button, so the two never overlap. */
@media (min-width: 850px) {
	.nna-has-float .nna-float { bottom: calc(20px + 44px + 16px); }
}

/* Mobile: above the contact bar, at the right edge. */
@media (max-width: 849.98px) {
	.nna-totop {
		--nna-totop-size: 40px;
		right: 16px;
		bottom: calc(var(--nna-float-bar, 0px) + 16px);
	}
}

/* Static pages (Giới thiệu, policies): Blocksy's h2/h3 are larger than the page title. */
.page .entry-content h2 { margin-top: 1.6em; font-size: 22px; color: var(--nna-primary); }
.page .entry-content h3 { margin-top: 1.4em; font-size: 18px; }
.page .entry-content ul { padding-left: 1.2em; }
