/**
 * NNF Commerce — Header Component (Top Bar, Main Header, Search & Responsive)
 * @package NNF_Commerce
 */

/* ==========================================================================
   HEADER: WOODMART VEGETABLES HEADER (TOP BAR + MAIN BAR)
   ========================================================================== */
.nnf-header-right .nnf-cart-opener {
	display: flex;
}

.nnf-woodmart-header {
	background-color: var(--nnf-header-bg, #FFFFFF);
	border-bottom: 1px solid var(--nnf-border, #DDE8D8);
	position: sticky;
	top: 0;
	z-index: 1000;
	box-shadow: 0 2px 10px rgba(30, 43, 31, 0.03);
}

/* ==========================================================================
   TOP BAR (NNF Fresh Green Style)
   ========================================================================== */
.nnf-top-bar {
	background-color: var(--nnf-top-bar-bg, #F8FBF5);
	border-bottom: 1px solid var(--nnf-border, #DDE8D8);
	padding: 6px 0;
	font-size: 13px;
	color: var(--nnf-text-muted, #667264);
}

.nnf-top-bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.nnf-top-bar-left {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Nút Tuyển dụng trên Top Bar (Luôn hiển thị ở mọi kích thước) */
.nnf-top-career-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	background: #EAF7E2;
	color: var(--nnf-primary-dark, #39841F);
	border: 1px solid var(--nnf-soft-green, #B8DFA0);
	border-radius: 9999px;
	font-size: 11.5px;
	font-weight: 700;
	text-decoration: none;
	line-height: 1.2;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.nnf-top-career-btn:hover {
	background: var(--nnf-primary, #4F9E28);
	color: #ffffff;
	border-color: var(--nnf-primary, #4F9E28);
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(79, 158, 40, 0.25);
}

.nnf-top-career-btn svg {
	flex-shrink: 0;
	stroke: currentColor;
}

/* Chấm xanh nhấp nháy báo hiệu đang tuyển */
.nnf-career-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: #22c55e;
	box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
	animation: nnf-pulse-dot 1.8s infinite;
}

@keyframes nnf-pulse-dot {
	0% {
		box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
	}
	70% {
		box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
	}
}

.nnf-top-links {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 22px;
	margin: 0;
	padding: 0;
}

.nnf-top-links a {
	color: var(--nnf-text-muted, #667264);
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	transition: color 0.2s ease;
	position: relative;
	padding: 2px 0;
}

.nnf-top-links a:hover,
.nnf-top-links li.current-menu-item > a,
.nnf-top-links li.current_page_item > a {
	color: var(--nnf-primary-dark, #39841F);
}

/* Ẩn link Tuyển dụng dạng chữ thường trong menu để chỉ hiển thị nút Tuyển dụng nổi bật duy nhất */
.nnf-top-links li a[href*="tuyen-dung"],
.nnf-top-links li a[href*="careers"] {
	display: none;
}

.nnf-top-bar-right {
	display: flex;
	align-items: center;
	gap: 14px;
}

.nnf-top-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--nnf-text-main, #1E2B1F);
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	transition: color 0.2s ease;
}

.nnf-top-item:hover {
	color: var(--nnf-primary, #4F9E28);
}

.nnf-top-phone {
	color: var(--nnf-primary-dark, #39841F);
	font-weight: 700;
}

.nnf-top-phone svg {
	fill: var(--nnf-primary, #4F9E28);
}

.nnf-top-divider {
	width: 1px;
	height: 14px;
	background: var(--nnf-border, #DDE8D8);
}

.nnf-lang-switcher {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
}

.nnf-lang-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	text-decoration: none;
	color: var(--nnf-text-muted, #667264);
	transition: color 0.2s;
}

.nnf-flag-svg {
	display: inline-block;
	vertical-align: middle;
	width: 16px;
	height: 12px;
	border-radius: 2px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
	flex-shrink: 0;
}

.nnf-lang-btn.active,
.nnf-lang-btn:hover {
	color: var(--nnf-primary-dark, #39841F);
}

.nnf-lang-sep {
	color: var(--nnf-border, #DDE8D8);
}

/* ==========================================================================
   MAIN GENERAL HEADER (Header V2 Layout)
   ========================================================================== */
.nnf-general-header {
	padding: 10px 0;
	background-color: var(--nnf-header-bg, #FFFFFF);
}

.nnf-general-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

/* Logo */
.nnf-header-logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.nnf-logo-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	padding: 0;
	margin: 0;
}

.nnf-site-logo {
	height: 52px;
	max-height: 56px;
	width: auto;
	object-fit: contain;
	display: block;
	transition: transform 0.2s ease;
}

.nnf-logo-link:hover .nnf-site-logo {
	transform: scale(1.02);
}

.nnf-logo-icon {
	font-size: 30px;
	line-height: 1;
}

.nnf-logo-title {
	font-size: 19px;
	font-weight: 900;
	color: var(--nnf-text-main, #1E2B1F);
	letter-spacing: -0.4px;
	display: block;
	line-height: 1.1;
}

.nnf-logo-sub {
	font-size: 10.5px;
	font-weight: 700;
	color: var(--nnf-primary, #4F9E28);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: block;
}

/* Center: Category Button + Search Form */
.nnf-header-center {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 1 1 auto;
	max-width: 900px;
}

/* "Danh mục" Pill Gradient Button */
.nnf-all-cat-btn {
	background: var(--nnf-cat-btn-gradient, linear-gradient(110deg, #39841F 0%, #56A52C 50%, #89CC62 84%, #EAF7E2 100%));
	border: none;
	border-radius: 9999px;
	height: 44px;
	padding: 0 18px 0 16px;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-size: 13.5px;
	font-weight: 800;
	color: #ffffff;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba(57, 132, 31, 0.28);
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
	white-space: nowrap;
	flex-shrink: 0;
	outline: none;
}

.nnf-all-cat-btn:hover {
	transform: translateY(-1.5px);
	box-shadow: 0 6px 18px rgba(57, 132, 31, 0.38);
	filter: brightness(1.03);
	color: #ffffff;
}

.nnf-hamburger-icon {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 15px;
	height: 12px;
	flex-shrink: 0;
}

.nnf-hamburger-icon span {
	display: block;
	height: 2px;
	width: 100%;
	background-color: #ffffff;
	border-radius: 2px;
	transition: background-color 0.2s;
}

.nnf-cat-btn-label {
	letter-spacing: -0.1px;
	text-shadow: 0 1px 2px rgba(30, 43, 31, 0.25);
}

/* WoodMart Rounded Search Form (Soft Green Pill) */
.nnf-header-searchform {
	flex: 1 1 auto;
	max-width: 100%;
	width: 100%;
	height: 44px;
	display: flex;
	align-items: center;
	background: #ffffff;
	border: 1.5px solid var(--nnf-soft-green, #B8DFA0);
	border-radius: 9999px;
	padding: 0;
	box-shadow: 0 2px 8px rgba(79, 158, 40, 0.08);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
	position: relative;
	overflow: hidden;
}

.nnf-header-searchform:focus-within {
	border-color: var(--nnf-primary, #4F9E28);
	box-shadow: 0 0 0 3px rgba(131, 201, 87, 0.22);
}

.nnf-header-searchform input[type="search"].nnf-search-input,
.nnf-header-searchform input.nnf-search-input,
.nnf-header-searchform .nnf-search-input,
.nnf-search-input {
	flex: 1;
	border: none;
	outline: none;
	background: transparent;
	font-size: 13.5px;
	font-family: inherit;
	font-weight: 500;
	color: var(--nnf-text-main, #1E2B1F);
	padding: 0 16px 0 20px;
	height: 100%;
	line-height: 44px;
	box-shadow: none;
}

.nnf-search-input::placeholder {
	color: var(--nnf-text-muted, #667264);
	font-size: 13px;
	font-weight: 400;
}

/* Search Submit Button: Flush against right edge of search input */
.nnf-header-searchform button.nnf-search-submit,
.nnf-header-searchform .nnf-search-submit,
.nnf-search-submit {
	height: 100%;
	margin: 0;
	background: var(--nnf-search-btn-gradient, linear-gradient(110deg, #F4FBEF 0%, #91CD6E 22%, #65AF39 55%, #39841F 100%));
	color: #ffffff;
	border: none;
	border-radius: 0 9999px 9999px 0;
	padding: 0 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
	white-space: nowrap;
	flex-shrink: 0;
	text-shadow: 0 1px 2px rgba(30, 43, 31, 0.35);
	outline: none;
	box-sizing: border-box;
}

.nnf-header-searchform .nnf-search-submit:hover,
.nnf-search-submit:hover {
	filter: brightness(1.05);
	transform: translateY(-1px);
}

.nnf-header-searchform .nnf-search-submit svg {
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}


/* ==========================================================================
   RESPONSIVE GENERAL HEADER (WoodMart Vegetables Mobile & Tablet Architecture)
   ========================================================================== */

/* 1. Laptop / Medium Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
	.nnf-general-header-inner {
		gap: 16px;
	}
	.nnf-site-logo {
		height: 58px;
		max-height: 62px;
	}
	.nnf-header-center {
		gap: 12px;
		flex: 1 1 auto;
		max-width: none;
	}
	.nnf-all-cat-btn {
		height: 42px;
		padding: 0 16px;
		font-size: 13px;
	}
	.nnf-header-searchform {
		height: 44px;
		flex: 1 1 auto;
		max-width: 100%;
		width: 100%;
	}
	.nnf-header-searchform .nnf-search-input {
		font-size: 13px;
		padding: 0 16px;
	}
	.nnf-header-searchform button.nnf-search-submit,
	.nnf-header-searchform .nnf-search-submit {
		height: 100%;
		margin: 0;
		padding: 0 18px;
		font-size: 13px;
		border-radius: 0 9999px 9999px 0;
	}
	.nnf-sec-nav-list {
		gap: 10px;
	}
	.nnf-sec-nav-list a {
		font-size: 12.5px;
	}
	.nnf-cart-circle-icon {
		width: 42px;
		height: 42px;
	}
	.nnf-cart-meta-total {
		font-size: 13px;
	}
}

/* 2. Tablet Architecture (769px - 1024px): 2-Row App-Like Architecture (WoodMart Style) */
@media (min-width: 769px) and (max-width: 1024px) {
	.nnf-general-header {
		padding: 8px 0 12px 0;
		background-color: var(--wd-body-bg, #FAF8F5);
		border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	}

	.nnf-general-header-inner {
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-rows: auto auto;
		align-items: center;
		row-gap: 12px;
		column-gap: 14px;
		width: 100%;
		box-sizing: border-box;
	}

	/* Row 1: Logo centered in the middle of header on tablet (1024px) */
	.nnf-header-logo {
		grid-column: 1 / -1;
		grid-row: 1;
		justify-self: center;
		display: flex;
		align-items: center;
		justify-content: center;
		margin: 0 auto;
	}

	.nnf-site-logo {
		height: 68px;
		max-height: 72px;
		width: auto;
		max-width: 100%;
		object-fit: contain;
	}

	/* Row 2, Left/Center: Category Button + Search Form */
	.nnf-header-center {
		grid-column: 1;
		grid-row: 2;
		display: flex;
		align-items: center;
		gap: 10px;
		width: 100%;
		min-width: 0;
	}

	/* Row 2, Right: 2 Icons Wishlist & Cart sit together inline with Search */
	.nnf-header-right {
		grid-column: 2;
		grid-row: 2;
		justify-self: end;
		display: flex;
		align-items: center;
		gap: 10px;
	}

	.nnf-header-right .nnf-header-wishlist,
	.nnf-header-right .nnf-cart-opener {
		display: flex;
	}

	.nnf-mobile-combined-btn {
		display: none;
	}

	/* Show cart text on tablet */
	.nnf-cart-opener .nnf-cart-meta {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		line-height: 1.2;
	}

	.nnf-cart-circle-icon {
		width: 42px;
		height: 42px;
	}

	.nnf-cart-circle-icon svg {
		width: 19px;
		height: 19px;
	}

	.nnf-header-right .nnf-cart-opener .nnf-cart-counter {
		width: 18px;
		height: 18px;
		font-size: 10.5px;
		top: -2px;
		right: -2px;
	}

	/* Circular 3-line hamburger category icon button */
	.nnf-all-cat-btn {
		width: 42px;
		height: 42px;
		min-width: 42px;
		max-width: 42px;
		border-radius: 50%;
		padding: 0;
		margin: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		background: var(--wd-primary, #8CBC67);
		border: none;
		box-shadow: 0 2px 8px rgba(140, 188, 103, 0.3);
		flex-shrink: 0;
		cursor: pointer;
	}

	/* Hide text label so it is a pure 3-line circular icon */
	.nnf-all-cat-btn .nnf-cat-btn-label {
		display: none;
	}

	.nnf-all-cat-btn .nnf-hamburger-icon {
		width: 18px;
		height: 13px;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		margin: 0;
	}

	.nnf-all-cat-btn .nnf-hamburger-icon span {
		height: 2px;
		background-color: #ffffff;
		border-radius: 2px;
		display: block;
		width: 100%;
	}

	/* Search Form inline with circular category button */
	.nnf-header-searchform {
		flex: 1;
		min-width: 0;
		width: auto;
		max-width: 100%;
		height: 42px;
		margin: 0;
		display: flex;
		align-items: center;
		background: #ffffff;
		border: 1.5px solid var(--wd-primary, #8CBC67);
		border-radius: 30px;
		overflow: hidden;
	}

	.nnf-header-searchform .nnf-search-input {
		flex: 1;
		height: 100%;
		font-size: 13.5px;
		padding: 0 14px 0 16px;
		line-height: normal;
		border: none;
		outline: none;
		background: transparent;
	}

	.nnf-header-searchform button.nnf-search-submit,
	.nnf-header-searchform .nnf-search-submit {
		height: 100%;
		margin: 0;
		padding: 0 18px;
		font-size: 13px;
		border-radius: 0 30px 30px 0;
		background: var(--wd-primary, #8CBC67);
		color: #ffffff;
		border: none;
		display: flex;
		align-items: center;
		gap: 6px;
	}

	/* Hide secondary nav links from main header row on mobile/tablet (they live in offcanvas) */
	.nnf-header-sec-nav {
		display: none;
	}
}

/* 3. Mobile Phones (<= 768px): Centered Logo, Circular Magnifying Glass, Combined Cart & Wishlist */
@media (max-width: 768px) {
	.nnf-top-bar-left {
		display: flex;
		align-items: center;
	}

	.nnf-top-bar-left .nnf-top-nav {
		display: none;
	}

	.nnf-general-header {
		padding: 6px 0 10px 0;
	}

	.nnf-general-header-inner {
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-rows: auto auto;
		align-items: center;
		column-gap: 8px;
		row-gap: 10px;
		width: 100%;
		box-sizing: border-box;
	}

	/* Row 1, Center: Logo centered */
	.nnf-header-logo {
		grid-column: 1 / -1;
		grid-row: 1;
		justify-self: center;
		display: flex;
		align-items: center;
		justify-content: center;
		text-align: center;
		margin: 0 auto;
	}

	.nnf-site-logo {
		height: 78px;
		max-height: 82px;
		width: auto;
		max-width: 100%;
		object-fit: contain;
	}

	/* Row 2, Left/Center: Category Button + Search Form */
	.nnf-header-center {
		grid-column: 1;
		grid-row: 2;
		display: flex;
		align-items: center;
		gap: 8px;
		width: 100%;
		min-width: 0;
	}

	/* Row 2, Right: Combined Cart & Wishlist button sitting in the SAME ROW */
	.nnf-header-right {
		grid-column: 2;
		grid-row: 2;
		justify-self: end;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		flex-shrink: 0;
	}

	/* Hide separate desktop wishlist and cart on mobile */
	.nnf-header-right .nnf-header-wishlist,
	.nnf-header-right .nnf-cart-opener {
		display: none;
	}

	/* Show combined button on mobile */
	.nnf-header-right button.nnf-mobile-combined-btn,
	.nnf-header-right .nnf-mobile-combined-btn,
	.nnf-mobile-combined-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
	}

	.nnf-all-cat-btn {
		width: 40px;
		height: 40px;
		min-width: 40px;
		max-width: 40px;
		border-radius: 50%;
		padding: 0;
		margin: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		background: var(--wd-primary, #8CBC67);
		border: none;
		box-shadow: 0 2px 8px rgba(140, 188, 103, 0.3);
		flex-shrink: 0;
		cursor: pointer;
	}

	.nnf-all-cat-btn .nnf-cat-btn-label {
		display: none;
	}

	/* Mobile Search Form */
	.nnf-header-searchform {
		height: 40px;
		padding: 3px;
		display: flex;
		align-items: center;
		position: relative;
		border-radius: 30px;
		overflow: hidden;
		border: 1.5px solid var(--wd-primary, #8CBC67);
		background: #ffffff;
		box-sizing: border-box;
	}

	.nnf-header-searchform .nnf-search-input {
		font-size: 13px;
		padding: 0 8px 0 14px;
		flex: 1;
		min-width: 0;
		height: 100%;
		border: none;
		outline: none;
		background: transparent;
	}

	/* Mobile search button: Perfectly round 32x32px circle with magnifying glass */
	.nnf-header-searchform .nnf-search-submit span {
		display: none;
	}

	.nnf-header-searchform button.nnf-search-submit,
	.nnf-header-searchform .nnf-search-submit {
		width: 32px;
		height: 32px;
		min-width: 32px;
		max-width: 32px;
		min-height: 32px;
		max-height: 32px;
		align-self: center;
		aspect-ratio: 1 / 1;
		border-radius: 50%;
		padding: 0;
		margin: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
		background: var(--wd-primary, #8CBC67);
		color: #ffffff;
		border: none;
		box-shadow: 0 2px 6px rgba(140, 188, 103, 0.35);
		line-height: 1;
		box-sizing: border-box;
	}

	.nnf-header-searchform button.nnf-search-submit svg,
	.nnf-header-searchform .nnf-search-submit svg {
		width: 16px;
		height: 16px;
		stroke: #ffffff;
		stroke-width: 2.5;
		display: block;
		margin: 0;
	}
}

/* 4. Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
	.nnf-top-bar {
		padding: 4px 0;
	}
	.nnf-top-bar-inner {
		gap: 6px;
	}
	.nnf-top-career-btn {
		padding: 2px 7px;
		font-size: 11px;
		gap: 4px;
	}
	.nnf-top-bar-right {
		gap: 8px;
	}
	.nnf-top-item {
		font-size: 11.5px;
		gap: 3px;
	}
	.nnf-top-phone span {
		font-size: 11.5px;
	}
	.nnf-top-divider {
		height: 10px;
	}

	.nnf-general-header-inner {
		column-gap: 6px;
		row-gap: 8px;
	}

	.nnf-site-logo {
		height: 88px;
		max-height: 92px;
		width: auto;
		max-width: 100%;
		object-fit: contain;
	}

	.nnf-all-cat-btn {
		width: 36px;
		height: 36px;
		min-width: 36px;
		max-width: 36px;
	}

	.nnf-header-searchform {
		height: 36px;
		padding: 2px;
	}

	.nnf-header-searchform .nnf-search-input {
		padding: 0 6px 0 12px;
		font-size: 12px;
	}

	.nnf-header-searchform button.nnf-search-submit,
	.nnf-header-searchform .nnf-search-submit {
		width: 28px;
		height: 28px;
		min-width: 28px;
		max-width: 28px;
		min-height: 28px;
		max-height: 28px;
		align-self: center;
		aspect-ratio: 1 / 1;
		border-radius: 50%;
	}

	.nnf-header-searchform button.nnf-search-submit svg,
	.nnf-header-searchform .nnf-search-submit svg {
		width: 14px;
		height: 14px;
	}

	.nnf-combined-circle-icon {
		width: 36px;
		height: 36px;
	}

	.nnf-combined-cart-svg {
		width: 17px;
		height: 17px;
	}
}


