/* ===========================================================
   GIAHBAN HEADER — variables
   Change colors / sizing here.
=========================================================== */
:root {
	--giahban-header-height: 76px;
	--giahban-header-height-mobile: 62px;
	--giahban-primary: #2f5233;      /* deep natural green */
	--giahban-bg: #ffffff;
	--giahban-text: #1f2420;
	--giahban-text-muted: #6b7369;
	--giahban-border: #e7e5e0;
	--giahban-shadow: 0 2px 16px rgba(0,0,0,0.06);
	--giahban-radius: 10px;
	--giahban-transition: 200ms ease;
}

/* ===========================================================
   BASE HEADER
=========================================================== */
.giahban-header {
	position: sticky;
	top: 0;
	inset-inline: 0;
	z-index: 999;
	background: var(--giahban-bg);
	border-block-end: 1px solid var(--giahban-border);
	transition: box-shadow var(--giahban-transition), background var(--giahban-transition);
}

.giahban-header.is-stuck {
	box-shadow: var(--giahban-shadow);
}

.giahban-header__inner {
	max-width: 1280px;
	margin-inline: auto;
	height: var(--giahban-header-height);
	padding-inline: 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

/* ===========================================================
   LOGO (right side in RTL — first flex child = right in RTL doc)
=========================================================== */
.giahban-header__logo {
	display: flex;
	align-items: center;
	max-height: 44px;
}

.giahban-header__logo a {
	display: inline-flex;
	align-items: center;
	border-radius: var(--giahban-radius);
	padding: 6px 10px;
	margin: -6px -10px; /* offsets the padding so the logo's visual size/position is unchanged */
	transition: background var(--giahban-transition);
	-webkit-tap-highlight-color: transparent;
}

.giahban-header__logo a:hover,
.giahban-header__logo a:focus-visible {
	background: rgba(47, 82, 51, 0.08);
}

.giahban-header__logo img,
.giahban-header__logo .custom-logo {
	max-height: 40px !important;
	width: auto !important;
	height: auto !important;
	display: block;
}
/* Astra applies its own !important sizing rules to .custom-logo via the
   Customizer logo-width control — the !important above is required to
   override those, not just style preference. */

.giahban-header__logo-text {
	font-size: 22px;
	font-weight: 700;
	color: var(--giahban-primary);
	text-decoration: none;
}

/* ===========================================================
   NAV (center)
=========================================================== */
.giahban-header__nav {
	flex: 1;
	display: flex;
	justify-content: center;
}

.giahban-header__nav-list {
	display: flex;
	align-items: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.giahban-header__nav-item {
	position: relative;
}

.giahban-header__nav-link {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 10px 18px;
	color: var(--giahban-text);
	text-decoration: none;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	font-family: inherit;
	border-radius: var(--giahban-radius);
	transition: background var(--giahban-transition), color var(--giahban-transition);
}

.giahban-header__nav-link:hover,
.giahban-header__nav-link:focus-visible {
	background: rgba(47, 82, 51, 0.08);
	color: var(--giahban-primary);
}

.giahban-header__chevron {
	width: 10px !important;
	height: 6px !important;
	flex-shrink: 0;
	transition: transform var(--giahban-transition);
}

/* Desktop relies on hover to reveal the dropdown, matching the pattern on
   most large commercial sites — no arrow needed there. Mobile has no hover,
   so it keeps the chevron as the only cue that an item expands. */
.giahban-header__nav-list .giahban-header__chevron {
	display: none;
}

.giahban-header__nav-item.has-children:hover .giahban-header__chevron,
.giahban-header__nav-link--parent[aria-expanded="true"] .giahban-header__chevron {
	transform: rotate(180deg);
}

/* Dropdown */
.giahban-header__submenu {
	position: absolute;
	inset-inline-start: 0;
	top: calc(100% + 6px);
	min-width: 160px;
	background: var(--giahban-bg);
	border: 1px solid var(--giahban-border);
	border-radius: var(--giahban-radius);
	box-shadow: var(--giahban-shadow);
	list-style: none;
	margin: 0;
	padding: 5px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}

.giahban-header__nav-item.has-children:hover .giahban-header__submenu,
.giahban-header__nav-item.has-children:focus-within .giahban-header__submenu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.giahban-header__submenu .giahban-header__nav-link {
	padding: 8px 10px;
	font-size: 13.5px;
	border-radius: 6px;
}

/* ===========================================================
   ACCOUNT / CART / HAMBURGER (left side)
=========================================================== */
.giahban-header__actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.giahban-header__icon-btn {
	all: unset;
	position: relative;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--giahban-text);
	cursor: pointer;
	transition: background var(--giahban-transition);
	-webkit-tap-highlight-color: transparent;
}

.giahban-header__icon-btn:hover,
.giahban-header__icon-btn:focus-visible {
	background: rgba(47, 82, 51, 0.08);
}

/* Astra/WooCommerce ship global "svg { width:100% }"-style resets that
   were shrinking or stretching our inline icons to invisibility.
   Forcing explicit pixel sizes here is required, not just tidy CSS. */
.giahban-header__icon-btn svg {
	width: 22px !important;
	height: 22px !important;
	display: block;
	flex-shrink: 0;
}

.giahban-header__emoji {
	font-size: 19px;
	line-height: 1;
}

.giahban-header__cart-badge {
	position: absolute;
	top: 2px;
	inset-inline-end: 2px;
	min-width: 16px;
	height: 16px;
	padding-inline: 3px;
	border-radius: 999px;
	background: var(--giahban-primary);
	color: #fff;
	font-size: 10px;
	line-height: 16px;
	text-align: center;
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 150ms ease, transform 150ms ease;
}

.giahban-header__cart-badge.is-visible {
	opacity: 1;
	transform: scale(1);
}

.giahban-header__hamburger {
	all: unset;
	box-sizing: border-box;
	display: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--giahban-text);
	cursor: pointer;
	align-items: center;
	justify-content: center;
	transition: background var(--giahban-transition);
	-webkit-tap-highlight-color: transparent;
}

.giahban-header__hamburger:hover,
.giahban-header__hamburger:focus-visible {
	background: rgba(47, 82, 51, 0.08);
}

.giahban-header__hamburger .giahban-header__emoji {
	font-size: 21px;
}

/* ===========================================================
   MOBILE MENU PANEL
=========================================================== */
.giahban-header__mobile-menu {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 14px; /* matches header's mobile padding-inline, so it sits flush under the hamburger */
	left: auto;
	width: 220px;
	background: var(--giahban-bg);
	border: 1px solid var(--giahban-border);
	border-radius: var(--giahban-radius);
	box-shadow: var(--giahban-shadow);
	padding: 6px;
	max-height: calc(100vh - var(--giahban-header-height-mobile) - 16px);
	overflow-y: auto;
	z-index: 998;
}

.giahban-header__mobile-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.giahban-header__mobile-list .giahban-header__nav-link {
	width: 100%;
	padding: 9px 10px;
	font-size: 14.5px;
	border-radius: 6px;
}

.giahban-header__mobile-list .giahban-header__nav-item + .giahban-header__nav-item {
	border-top: 1px solid var(--giahban-border);
	margin-top: 2px;
	padding-top: 2px;
}

.giahban-header__mobile-list .giahban-header__submenu {
	position: static;
	opacity: 1;
	visibility: visible;
	transform: none;
	box-shadow: none;
	border: none;
	display: none;
	padding-right: 16px;
	padding-left: 0;
}

.giahban-header__mobile-list .giahban-header__nav-item.is-open .giahban-header__submenu {
	display: block;
}

/* ===========================================================
   CART DRAWER
=========================================================== */
.giahban-header__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.35);
	z-index: 1000;
	opacity: 0;
	transition: opacity var(--giahban-transition);
}

.giahban-header__overlay.is-visible {
	opacity: 1;
}

.giahban-header__cart-drawer {
	position: fixed;
	top: 0;
	inset-inline-end: 0;
	bottom: 0;
	width: min(380px, 100vw);
	background: var(--giahban-bg);
	z-index: 1001;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 250ms ease;
	box-shadow: var(--giahban-shadow);
}

[dir="rtl"] .giahban-header__cart-drawer {
	transform: translateX(-100%);
}

.giahban-header__cart-drawer.is-open {
	transform: translateX(0);
}

.giahban-header__cart-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-block-end: 1px solid var(--giahban-border);
}

.giahban-header__cart-drawer-head h2 {
	font-size: 17px;
	font-weight: 600;
	margin: 0;
	color: var(--giahban-text);
}

.giahban-header__cart-drawer-head button {
	all: unset;
	cursor: pointer;
	color: var(--giahban-text);
	display: inline-flex;
}

.giahban-header__cart-drawer-head button svg {
	width: 20px !important;
	height: 20px !important;
	display: block;
}

.giahban-header__cart-items {
	list-style: none;
	margin: 0;
	padding: 12px 20px;
	overflow-y: auto;
	flex: 1;
}

.giahban-header__cart-item {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 12px 0;
	border-block-end: 1px solid var(--giahban-border);
}

.giahban-header__cart-item-thumb img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 8px;
}

.giahban-header__cart-item-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.giahban-header__cart-item-title {
	font-size: 14px;
	color: var(--giahban-text);
	text-decoration: none;
}

.giahban-header__cart-item-meta {
	font-size: 13px;
	color: var(--giahban-text-muted);
}

.giahban-header__cart-item-remove {
	color: var(--giahban-text-muted);
	text-decoration: none;
	font-size: 18px;
	padding: 4px 8px;
}

.giahban-header__cart-empty {
	padding: 40px 20px;
	text-align: center;
	color: var(--giahban-text-muted);
}

.giahban-header__cart-cta {
	display: inline-block;
	margin-top: 12px;
	color: var(--giahban-primary);
	text-decoration: underline;
}

.giahban-header__cart-footer {
	padding: 16px 20px 20px;
	border-block-start: 1px solid var(--giahban-border);
}

.giahban-header__cart-subtotal {
	display: flex;
	justify-content: space-between;
	font-size: 15px;
	margin-block-end: 12px;
}

.giahban-header__btn {
	display: block;
	text-align: center;
	padding: 12px;
	border-radius: var(--giahban-radius);
	text-decoration: none;
	font-size: 14px;
	margin-block-end: 8px;
	transition: opacity var(--giahban-transition);
}

.giahban-header__btn:hover {
	opacity: 0.9;
}

.giahban-header__btn--outline {
	border: 1px solid var(--giahban-primary);
	color: var(--giahban-primary);
}

.giahban-header__btn--solid {
	background: var(--giahban-primary);
	color: #fff;
}

/* ===========================================================
   RESPONSIVE — tablet keeps desktop structure, mobile switches layout
=========================================================== */
@media (max-width: 1024px) {
	.giahban-header__nav-list {
		gap: 2px;
	}
	.giahban-header__nav-link {
		padding: 8px 10px;
		font-size: 14px;
	}
}

@media (max-width: 640px) {
	.giahban-header {
		--giahban-header-height: var(--giahban-header-height-mobile);
		position: sticky; /* keep sticky context so the floating menu below anchors to it */
	}
	.giahban-header__inner {
		position: relative;
		padding-inline: 14px;
		justify-content: space-between;
	}
	.giahban-header__nav {
		display: none;
	}
	.giahban-header__logo {
		position: absolute;
		left: 50%;
		right: auto;
		transform: translateX(-50%);
	}
	.giahban-header__hamburger {
		display: inline-flex;
	}
	.giahban-header__mobile-menu[hidden] {
		display: none;
	}
	.giahban-header__mobile-menu:not([hidden]) {
		display: block;
	}
}

/* ===========================================================
   ACCESSIBILITY
=========================================================== */
.giahban-header a:focus-visible,
.giahban-header button:focus-visible {
	outline: 2px solid var(--giahban-primary);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.giahban-header,
	.giahban-header *,
	.giahban-header *::before,
	.giahban-header *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
