/*
 * Site header & sticky navigation bar.
 * Redesigned to match the Autima reference:
 * 1) Brand header band: 36px top utility strip + main row (logo, unified search box, action pills)
 * 2) Separate sticky white nav bar (48px) below <header> so sticky top: 0 works across the whole page.
 */

.kd-hdr {
	position: relative;
	z-index: 40;
	background: var(--kd-brand);
	color: var(--kd-brand-ink);
}

.kd-hdr a {
	color: inherit;
	text-decoration: none;
}

/* ---------- 1. Top Utility Strip ---------- */
.kd-hdr__util {
	border-block-end: 1px solid rgba(255, 255, 255, 0.18);
	font-size: 11px;
}

@media (min-width: 640px) {
	.kd-hdr__util {
		font-size: 12px;
	}
}

.kd-hdr__util-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 30px;
}

.kd-hdr__util-start,
.kd-hdr__util-end {
	display: flex;
	align-items: center;
	gap: 12px;
	font-weight: 500;
}

.kd-hdr__util-end {
	gap: 14px;
}

.kd-hdr__util-end a:hover {
	text-decoration: underline;
}

.kd-hdr__util-note {
	opacity: 0.9;
}

.kd-hdr__socials {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.kd-hdr__socials a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0.8;
	transition: opacity 0.2s var(--kd-ease);
}

.kd-hdr__socials a:hover {
	opacity: 1;
}

.kd-hdr__sep {
	color: rgba(255, 255, 255, 0.35);
}

.kd-hdr__phone {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-weight: 600;
}

.kd-hdr__sm-hide {
	display: none;
}

@media (min-width: 640px) {
	.kd-hdr__sm-hide {
		display: inline-flex;
	}
}

/* ---------- 2. Main Header Row ---------- */
.kd-hdr__main {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding-block: 10px;
}

@media (min-width: 640px) {
	.kd-hdr__main {
		padding-block: 12px;
	}
}

.kd-hdr__brand {
	order: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.kd-hdr__menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	color: var(--kd-brand-ink);
	cursor: pointer;
	transition: background-color 0.2s var(--kd-ease);
}

.kd-hdr__menu-toggle:hover {
	background: rgba(255, 255, 255, 0.26);
}

@media (min-width: 1024px) {
	.kd-hdr__menu-toggle {
		display: none;
	}
}

.kd-hdr__logo {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--kd-brand-ink);
	font-family: var(--kd-font-display);
	font-size: 20px;
	font-weight: 800;
	line-height: 1;
	flex-shrink: 0;
}

.kd-hdr__logo-icon {
	display: inline-flex;
	align-items: center;
}

.kd-hdr__logo-mark {
	width: 22px;
	height: 22px;
	display: block;
}

.kd-hdr__logo-type {
	height: 19px;
	width: auto;
	display: block;
}

@media (min-width: 640px) {
	.kd-hdr__logo-mark {
		width: 25px;
		height: 25px;
	}

	.kd-hdr__logo-type {
		height: 22px;
	}
}

.kd-hdr__logo-dot {
	width: 5px;
	height: 5px;
	border-radius: 999px;
	background: var(--kd-brand-ink);
	transition: transform 0.2s var(--kd-ease);
}

.kd-hdr__logo:hover .kd-hdr__logo-dot {
	transform: scale(1.25);
}

.kd-hdr__custom-logo img {
	max-height: 36px;
	width: auto;
	display: block;
}

/* ---------- 3. Unified Search Bar ---------- */
.kd-hdr__search {
	order: 3;
	width: 100%;
	position: relative;
}

@media (min-width: 768px) {
	.kd-hdr__search {
		order: 2;
		width: auto;
		flex: 1 1 320px;
		max-width: 576px;
	}
}

.kd-hdr__search-box {
	display: flex;
	align-items: center;
	height: 38px;
	padding-inline-end: 4px;
	background: #ffffff;
	border-radius: 9999px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.2s var(--kd-ease), border-color 0.2s var(--kd-ease);
}

.kd-hdr__search-box:focus-within {
	border-color: rgba(0, 0, 0, 0.2);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kd-hdr__cat {
	display: none;
	position: relative;
	flex-shrink: 0;
	height: 100%;
}

@media (min-width: 640px) {
	.kd-hdr__cat {
		display: flex;
		align-items: center;
	}
}

.kd-hdr__cat::after {
	content: "";
	width: 1px;
	height: 18px;
	background: #e5e7eb;
	flex-shrink: 0;
}

.kd-hdr .kd-hdr__cat-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 100%;
	padding: 0 14px 0 10px;
	margin: 0;
	border: 0;
	border-radius: 9999px;
	background: transparent;
	color: #52525b;
	font-family: inherit;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.15s var(--kd-ease);
}

.kd-hdr .kd-hdr__cat-btn:hover,
.kd-hdr__cat.is-open .kd-hdr__cat-btn {
	color: var(--kd-ink);
}

.kd-hdr__cat-label {
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.kd-hdr__cat-chevron {
	flex-shrink: 0;
	width: 12px;
	height: 12px;
	color: #9ca3af;
	transition: transform 0.2s var(--kd-ease);
}

.kd-hdr__cat.is-open .kd-hdr__cat-chevron {
	transform: rotate(180deg);
}

.kd-hdr__cat-menu {
	position: absolute;
	top: calc(100% + 8px);
	inset-inline-start: 0;
	z-index: 60;
	min-width: 200px;
	max-height: 270px;
	overflow-y: auto;
	margin: 0;
	padding: 5px;
	list-style: none;
	background: #ffffff;
	border: 1px solid var(--kd-border);
	border-radius: 12px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.kd-hdr__cat-menu[hidden] {
	display: none;
}

.kd-hdr__cat-menu li {
	display: flex;
	align-items: center;
	padding: 7px 11px;
	border-radius: 7px;
	font-size: 12px;
	font-weight: 500;
	color: var(--kd-text);
	cursor: pointer;
	transition: background-color 0.15s var(--kd-ease), color 0.15s var(--kd-ease);
}

.kd-hdr__cat-menu li:hover {
	background: var(--kd-tint);
	color: var(--kd-ink);
}

.kd-hdr__cat-menu li[aria-selected="true"] {
	background: rgba(255, 98, 0, 0.1);
	color: var(--kd-brand);
	font-weight: 600;
}

.kd-hdr .kd-hdr__search-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	min-height: 0;
	margin: 0;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	padding: 0 14px;
	font-family: inherit;
	font-size: 12.5px;
	color: var(--kd-ink);
	appearance: none;
	-webkit-appearance: none;
}

.kd-hdr .kd-hdr__search-input::placeholder {
	color: #9ca3af;
}

.kd-hdr .kd-hdr__search-input:focus {
	outline: none;
	box-shadow: none !important;
}

.kd-hdr .kd-hdr__search-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 9999px;
	background: var(--kd-ink);
	color: #ffffff;
	cursor: pointer;
	flex-shrink: 0;
	transition: background-color 0.2s var(--kd-ease), transform 0.15s var(--kd-ease);
}

.kd-hdr .kd-hdr__search-btn svg {
	width: 15px;
	height: 15px;
}

.kd-hdr .kd-hdr__search-btn:hover {
	background: #000000;
	transform: scale(1.04);
}

/* ---------- 4. Header Actions (Account, Wallet, Cart) ---------- */
.kd-hdr__actions {
	order: 2;
	display: flex;
	align-items: center;
	gap: 14px;
}

@media (min-width: 768px) {
	.kd-hdr__actions {
		order: 3;
		gap: 22px;
	}
}

.kd-hdr__action {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--kd-brand-ink);
}

.kd-hdr__action-icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	transition: background-color 0.2s var(--kd-ease);
}

.kd-hdr__action-icon svg {
	width: 18px;
	height: 18px;
}

.kd-hdr__action:hover .kd-hdr__action-icon {
	background: rgba(255, 255, 255, 0.26);
}

.kd-hdr__badge {
	position: absolute;
	top: -3px;
	inset-inline-end: -3px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--kd-ink);
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.kd-hdr__badge.is-empty {
	opacity: 0.7;
}

.kd-hdr__action-label {
	display: none;
	line-height: 1.3;
	text-align: start;
}

.kd-hdr__action-label span {
	display: block;
	font-size: 11px;
	color: rgba(255, 255, 255, 0.85);
}

.kd-hdr__action-label strong {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: var(--kd-brand-ink);
}

@media (min-width: 1024px) {
	.kd-hdr__action-label {
		display: block;
	}
}

/* ---------- 5. Sticky White Navigation Bar ---------- */
.kd-nav {
	position: sticky;
	top: 0;
	z-index: 30;
	background: #ffffff;
	border-block-end: 1px solid var(--kd-border);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.kd-nav__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 42px;
}

.kd-nav__menu {
	display: flex;
	align-items: center;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	white-space: nowrap;
	font-size: 12px;
	font-weight: 600;
	scrollbar-width: none;
}

.kd-nav__menu::-webkit-scrollbar {
	display: none;
}

@media (min-width: 640px) {
	.kd-nav__menu {
		gap: 32px;
		font-size: 13px;
	}
}

.kd-nav__menu > li {
	position: relative;
}

.kd-nav__menu a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding-block: 10px;
	color: var(--kd-ink);
	text-decoration: none;
	transition: color 0.2s var(--kd-ease);
}

.kd-nav__menu a:hover,
.kd-nav__menu .current-menu-item > a,
.kd-nav__menu .current_page_item > a {
	color: var(--kd-brand);
}

.kd-nav__menu .sub-menu {
	display: none;
}

.kd-nav__hotline {
	display: none;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--kd-muted);
	text-decoration: none;
	flex-shrink: 0;
}

.kd-nav__hotline svg {
	color: var(--kd-brand);
}

.kd-nav__hotline strong {
	color: var(--kd-ink);
	font-weight: 700;
}

@media (min-width: 1024px) {
	.kd-nav__hotline {
		display: inline-flex;
	}
}
