/* CHXN component: header — topbar, logo/search/cart row, category pill nav.
   Targets this theme's OWN markup (header.php) directly — no page-builder
   generating competing/dynamic CSS to out-specificity anymore, so this is
   considerably shorter than hai-tra's version of the same file. */

.chxn-topbar {
	background-color: var(--chxn-green-d);
	color: #dcefe5;
	font-size: 12.5px;
	line-height: 1.4;
}
.chxn-topbar-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 8px;
	padding-bottom: 8px;
}
.chxn-topbar-right {
	display: flex;
	gap: 16px;
	align-items: center;
}
.chxn-topbar-right a {
	color: #dcefe5;
	text-decoration: none;
}
.chxn-topbar-right a:hover {
	color: #ffffff;
}
.chxn-topbar-phone {
	color: #ffffff !important;
	font-weight: 700;
}

.chxn-header {
	background: var(--chxn-card);
}
.chxn-header-main {
	border-bottom: 1px solid var(--chxn-line);
}
.chxn-header-main-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-top: 14px;
	padding-bottom: 14px;
}

.chxn-logo {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: none;
}
.chxn-logo img {
	width: 50px;
	height: 50px;
	border-radius: var(--chxn-radius-input);
	object-fit: cover;
}
.chxn-logo-text {
	display: flex;
	flex-direction: column;
	line-height: 1.05;
}
.chxn-logo-brand {
	font-weight: 800;
	font-size: 19px;
	color: var(--chxn-green);
}
.chxn-logo-tagline {
	font-size: 11px;
	color: var(--chxn-ink-2);
	font-weight: 500;
	line-height: 1.3;
	margin-top: 2px;
}

.chxn-search-form {
	flex: 1 1 auto;
	max-width: 620px;
	display: flex;
	align-items: center;
	gap: 0;
	background: var(--chxn-bg);
	border: 1.5px solid var(--chxn-line);
	border-radius: var(--chxn-radius-pill);
	padding: 7px;
	box-sizing: border-box;
}
.chxn-search-input {
	flex: 1;
	border: 0;
	background: transparent;
	height: 34px;
	padding: 0 12px;
	font-family: var(--chxn-font);
	font-size: 14px;
	color: var(--chxn-ink);
	min-width: 0;
}
.chxn-search-input:focus {
	outline: none;
}
.chxn-search-submit {
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 0;
	background: var(--chxn-green);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}
.chxn-search-submit:hover {
	background: var(--chxn-green-d);
}

.chxn-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
}
.chxn-account-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 8px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 500;
	color: var(--chxn-ink) !important;
}
.chxn-account-link:hover {
	background: var(--chxn-bg);
}
.chxn-account-icon {
	display: block;
	width: 19px;
	height: 19px;
	background-color: var(--chxn-ink-2);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* a <button>, not an <a> — no page to navigate to now that the cart page
   is gone, clicking this opens the flying cart drawer instead (see
   modules/flying-cart.js). base.css's site-wide "button{border-radius:
   pill!important}" reset otherwise wins over the 14px below regardless of
   specificity, and native <button> chrome needs its own border/background
   reset too. */
.chxn-cart-link {
	background: var(--chxn-green);
	color: #ffffff !important;
	border: 0;
	border-radius: 14px !important;
	padding: 10px 16px;
	display: flex;
	align-items: center;
	gap: 9px;
	font-weight: 600;
	font-size: 13.5px;
	font-family: inherit;
}
.chxn-cart-link:hover {
	background: var(--chxn-green-d);
}
.chxn-cart-count {
	background: var(--chxn-red);
	color: #fff;
	min-width: 18px;
	height: 18px;
	border-radius: 99px;
	font-size: 11px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
}

/* nav pill row — horizontal-scrolling pill bar (ChxHeader.dc.html): white
   row, gray pill items, green when active/hover. */
.chxn-nav-bottom {
	background: var(--chxn-card);
	border-bottom: 1px solid var(--chxn-line);
}
.chxn-nav-bottom-inner {
	padding-top: 0;
	padding-bottom: 0;
}
.chxn-nav-pills {
	display: flex;
	flex-wrap: nowrap;
	list-style: none;
	overflow-x: auto;
	gap: 9px;
	padding: 11px 0;
	margin: 0;
	scrollbar-width: none;
}
.chxn-nav-pills::-webkit-scrollbar {
	display: none;
}
.chxn-nav-pills li {
	flex: none;
	margin: 0;
}
.chxn-nav-pills li a {
	display: block;
	background: var(--chxn-bg);
	border: 1px solid var(--chxn-line);
	border-radius: var(--chxn-radius-pill);
	padding: 8px 16px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--chxn-ink) !important;
	white-space: nowrap;
	line-height: 1.3;
	transition: border-color .15s, color .15s, background-color .15s;
}
.chxn-nav-pills li a:hover,
.chxn-nav-pills li.current-menu-item a {
	border-color: var(--chxn-green) !important;
	color: var(--chxn-green-d) !important;
	background: var(--chxn-green-l) !important;
}

/* hamburger toggle (header.php's "chxn-menu-toggle") — a plain 3-line
   icon button, hidden on desktop entirely (only relevant once the search
   form + pill nav below actually disable, at the same 850px breakpoint). */
.chxn-menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 4px;
	width: 38px;
	height: 38px;
	border: 0;
	background: none;
	border-radius: 10px;
	padding: 0;
	cursor: pointer;
	font-family: inherit;
}
.chxn-menu-toggle:hover {
	background: var(--chxn-bg);
}
.chxn-menu-toggle span {
	display: block;
	width: 20px;
	height: 2px;
	border-radius: 2px;
	background: var(--chxn-ink);
}

@media (max-width: 850px) {
	.chxn-logo-tagline {
		display: none;
	}
	.chxn-search-form {
		display: none;
	}
	.chxn-nav-bottom {
		display: none;
	}
	.chxn-menu-toggle {
		display: flex;
	}
	/* the topbar's own promo text + Giới thiệu/Chính sách/Liên hệ/phone
	   links are all already reachable from the hamburger drawer below
	   (header.php's "chxn-mobile-menu-links") — keeping this second copy
	   on screen too just spent a full row of a narrow phone's height on
	   duplicate links. */
	.chxn-topbar {
		display: none;
	}
}

/* mobile/tablet nav drawer (header.php, right after </header>) — same
   slide-in-panel + overlay pattern as the flying cart/quick view
   (components/flying-cart.css, components/quick-view.css), holding the
   search form and category menu that "@media (max-width: 850px)" above
   just disables outright with nothing else on screen to replace them. */
.chxn-mobile-menu-overlay {
	position: fixed;
	inset: 0;
	background: rgba(13, 30, 22, .45);
	z-index: 940;
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility 0s linear .25s;
}
.chxn-mobile-menu {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 320px;
	max-width: 86vw;
	background: var(--chxn-card);
	z-index: 941;
	overflow-y: auto;
	box-shadow: 12px 0 34px rgba(0, 0, 0, .18);
	transform: translateX(-100%);
	transition: transform .28s ease;
}
body.chxn-mobile-menu-open .chxn-mobile-menu-overlay {
	opacity: 1;
	visibility: visible;
	transition: opacity .25s ease;
}
body.chxn-mobile-menu-open .chxn-mobile-menu {
	transform: translateX(0);
}
body.chxn-mobile-menu-open {
	overflow: hidden;
}
.chxn-mobile-menu-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--chxn-line);
}
.chxn-mobile-menu-head .chxn-logo img {
	width: 40px;
	height: 40px;
}
.chxn-mobile-menu-head .chxn-logo-brand {
	font-size: 16px;
}
.chxn-mobile-menu-close {
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 0;
	background: var(--chxn-bg);
	color: var(--chxn-ink-2);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.chxn-mobile-menu-close:hover {
	background: var(--chxn-line);
	color: var(--chxn-ink);
}
.chxn-mobile-search-form {
	display: flex;
	align-items: center;
	gap: 0;
	margin: 16px 20px;
	background: var(--chxn-bg);
	border: 1.5px solid var(--chxn-line);
	border-radius: var(--chxn-radius-pill);
	padding: 6px;
}
.chxn-mobile-search-input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	height: 32px;
	padding: 0 12px;
	font-family: var(--chxn-font);
	font-size: 14px;
	color: var(--chxn-ink);
}
.chxn-mobile-search-input:focus {
	outline: none;
}
.chxn-mobile-search-submit {
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 0;
	background: var(--chxn-green);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
}
.chxn-mobile-nav-list {
	list-style: none;
	margin: 0;
	padding: 4px 20px 16px;
}
.chxn-mobile-nav-list li {
	margin: 0;
}
.chxn-mobile-nav-list li a {
	display: block;
	padding: 12px 4px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--chxn-ink) !important;
	border-bottom: 1px solid var(--chxn-line);
}
.chxn-mobile-nav-list li.current-menu-item a {
	color: var(--chxn-green-d) !important;
}
.chxn-mobile-menu-links {
	display: flex;
	flex-direction: column;
	padding: 4px 20px 24px;
	border-top: 1px solid var(--chxn-line);
}
/* same padding/size/weight/color/divider as ".chxn-mobile-nav-list li a"
   above — this row used to read as a visibly lighter, smaller, un-bolded
   afterthought tacked under the real menu instead of more of the same
   drawer. */
.chxn-mobile-menu-links a {
	padding: 12px 4px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--chxn-ink) !important;
	text-decoration: none;
	border-bottom: 1px solid var(--chxn-line);
}
.chxn-mobile-menu-links a:last-child {
	border-bottom: 0;
}
.chxn-mobile-menu-links a:hover {
	color: var(--chxn-green-d);
}
.chxn-mobile-menu-phone {
	font-weight: 700;
	color: var(--chxn-green-d) !important;
}

/* the topbar's long promo text and its 4-item link row were both fixed-
   width content competing for the same row with no wrapping/truncation,
   which overlapped once the viewport got much narrower than a tablet
   (phone widths) — same for the header-actions row, where the account/
   cart buttons' own text labels ("Đăng nhập"/"Giỏ hàng") pushed the cart
   button's right edge past the viewport instead of shrinking. */
@media (max-width: 480px) {
	.chxn-topbar-left {
		display: none;
	}
	.chxn-topbar-inner {
		justify-content: center;
	}
	.chxn-topbar-right a:not(.chxn-topbar-phone) {
		display: none;
	}
	.chxn-header-main-inner {
		gap: 10px;
	}
	.chxn-logo img {
		width: 40px;
		height: 40px;
	}
	.chxn-logo-brand {
		font-size: 16px;
	}
	.chxn-account-link span:last-child,
	.chxn-cart-link span:first-of-type {
		display: none;
	}
	.chxn-account-link {
		padding: 8px;
	}
	.chxn-cart-link {
		padding: 10px 12px;
	}
}
