/* DeskPicko Header & Navigation — base styles.
   Design tokens match the approved DeskPicko blueprint. */

:root {
	--dp-hf-ink: #111827;
	--dp-hf-cyan: #00E5FF;
	--dp-hf-purple: #7A5CFF;
	--dp-hf-teal: #0D9488;
	--dp-hf-teal-hover: #0F766E;
	--dp-hf-bg: #FFFFFF;
	--dp-hf-soft: #F8FAFC;
	--dp-hf-border: #E2E8F0;
	--dp-hf-muted: #64748B;
	--dp-hf-radius: 10px;
	--dp-hf-control-radius: 12px;
	--dp-hf-sticky-h: 64px;
}

.dp-hf-header, .dp-hf-header * ,
.dp-hf-mobile-header, .dp-hf-mobile-header *,
.dp-hf-drawer, .dp-hf-drawer * {
	box-sizing: border-box;
}

.dp-hf-icon { width: 20px; height: 20px; display: block; }

/* ---------------------------------------------------------------
   Desktop header shell
--------------------------------------------------------------- */

.dp-hf-header {
	background: var(--dp-hf-bg);
	border-bottom: 1px solid var(--dp-hf-border);
	position: sticky;
	top: 0;
	z-index: 500;
	display: none;
}

@media (min-width: 1025px) {
	.dp-hf-header { display: block; }
	.dp-hf-mobile-header, .dp-hf-drawer { display: none !important; }
}

.dp-hf-row { width: 100%; }

.dp-hf-row-1-inner {
	max-width: 1440px;
	margin: 0 auto;
	padding: 1.5rem 2rem;
	display: flex;
	align-items: center;
	gap: 2.5rem;
	transition: padding 0.15s ease;
}

.dp-hf-header[data-dp-hf-header].is-scrolled .dp-hf-row-1-inner {
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
}

.dp-hf-header[data-dp-hf-header].is-scrolled {
	box-shadow: 0 1px 0 rgba(17, 24, 39, 0.05), 0 8px 20px -14px rgba(17, 24, 39, 0.18);
}

.dp-hf-header[data-dp-hf-header].is-scrolled .dp-hf-logo img {
	max-height: 32px;
}

@media (prefers-reduced-motion: reduce) {
	.dp-hf-row-1-inner { transition: none; }
}

.dp-hf-logo { flex: 0 0 auto; display: flex; align-items: center; }
.dp-hf-logo img { display: block; height: auto; max-height: 44px; width: auto; transition: max-height 0.15s ease; }
.dp-hf-logo--text a { font-weight: 700; font-size: 1.4375rem; color: var(--dp-hf-ink); text-decoration: none; letter-spacing: -0.02em; }

.dp-hf-row-1-search { flex: 1 1 auto; max-width: clamp(340px, 40vw, 720px); }

.dp-hf-search { position: relative; display: flex; align-items: center; width: 100%; }
.dp-hf-search-input {
	width: 100%;
	/* Slightly more generous than 1.2.x for the "comfortable input
	   height" the Phase H1 brief calls for; still a plain rem value,
	   not a new fixed width — the clamp() on .dp-hf-row-1-search above
	   still governs how wide the whole block gets. */
	padding: 0.9rem 3.25rem 0.9rem 1.25rem;
	border: 1.5px solid var(--dp-hf-border);
	border-radius: var(--dp-hf-control-radius);
	/* White rather than the previous soft-gray fill, per the "clean
	   white editorial appearance" requirement; hover/focus states
	   below are unchanged in behavior. */
	background: var(--dp-hf-bg);
	box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
	font-size: 0.9375rem;
	color: var(--dp-hf-ink);
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.dp-hf-search-input::placeholder { color: var(--dp-hf-muted); }
.dp-hf-search-input:hover { border-color: #CBD5E1; }
.dp-hf-search-input:focus-visible {
	outline: none;
	border-color: var(--dp-hf-ink);
	background: var(--dp-hf-bg);
	box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.07);
}
@media (prefers-reduced-motion: reduce) {
	.dp-hf-search-input { transition: none; }
}

/* Quick-search shortcut row (Phase H1) — see
   DP_HF_Header::render_search_chips() for why these are labeled "Try:"
   rather than "Popular:". Lives inside .dp-hf-row-1-search, which is
   already desktop-only (that whole header is display:none below the
   1025px breakpoint above), so no extra media query is needed here. */
.dp-hf-search-quick {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin-top: 0.6rem;
	overflow-x: auto;
	scrollbar-width: thin;
}
.dp-hf-search-quick-label {
	flex: 0 0 auto;
	font-size: 0.8125rem;
	color: var(--dp-hf-muted);
	white-space: nowrap;
}
.dp-hf-search-quick ul {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.dp-hf-search-quick li { flex: 0 0 auto; }
.dp-hf-search-quick a {
	display: inline-block;
	padding: 0.3rem 0.8rem;
	border: 1px solid var(--dp-hf-border);
	border-radius: 999px;
	background: var(--dp-hf-soft);
	font-size: 0.8125rem;
	color: var(--dp-hf-ink);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}
.dp-hf-search-quick a:hover { background: var(--dp-hf-bg); border-color: #CBD5E1; }
.dp-hf-search-quick a:focus-visible { outline: 2px solid var(--dp-hf-cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	.dp-hf-search-quick a { transition: none; }
}
.dp-hf-search-submit {
	position: absolute;
	right: 0.3125rem;
	top: 50%;
	transform: translateY(-50%);
	width: 38px;
	height: 38px;
	/* Explicit, !important, zero padding + border-box: a button has no
	   author padding rule of its own by default, so any inherited/theme
	   padding is free to eat into this fixed-width box. With box-sizing:
	   border-box, padding is carved out of that fixed width — enough of
	   it and the flex content area collapses toward zero, at which point
	   the icon below (a default flex-shrink:1 item) gets compressed
	   along with it. Locking both padding and box-sizing here removes
	   that possibility outright, regardless of what set the padding. */
	padding: 0 !important;
	box-sizing: border-box !important;
	border: 0;
	border-radius: calc(var(--dp-hf-control-radius) - 4px);
	background: var(--dp-hf-ink);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.dp-hf-search-submit:hover { background: #1f2937; }
.dp-hf-search-submit .dp-hf-icon {
	width: 16px;
	height: 16px;
	/* Belt-and-suspenders on top of the padding fix above: even if the
	   button's content box were squeezed by something we haven't
	   anticipated, the icon itself won't shrink along the row axis. */
	flex: 0 0 auto !important;
}
.dp-hf-search-submit:focus-visible { outline: 2px solid var(--dp-hf-cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	.dp-hf-search-submit { transition: none; }
}

/* ---------------------------------------------------------------
   Search System Phase H2 — Autocomplete / Live Suggestions.
   Server-rendered empty shell (see
   DP_HF_Header::render_search_field()); dp-hf-header.js populates
   it. White, restrained-radius, soft-shadow, editorial panel —
   never a giant panel, never a neon effect.
--------------------------------------------------------------- */
.dp-hf-search-wrap { position: relative; }

.dp-hf-search-autocomplete {
	position: absolute;
	top: calc(100% + 0.5rem);
	left: 0;
	right: 0;
	z-index: 60;
	background: var(--dp-hf-bg);
	border: 1px solid var(--dp-hf-border);
	border-radius: var(--dp-hf-radius);
	box-shadow: 0 12px 28px -12px rgba(17, 24, 39, 0.18), 0 2px 8px rgba(17, 24, 39, 0.06);
	max-height: min(70vh, 520px);
	overflow-y: auto;
	padding: 0.5rem 0;
}

/* Search System Phase H3 — Intelligent Multi-Type Results.
   [ All / Products / Articles / Categories ] tab row, only for types
   that actually have results (see dp-hf-header.js buildTabs()). Reuses
   the same restrained pill language as the Phase H1 "Try:" quick-search
   chips for visual consistency — never a heavier tab/button treatment. */
.dp-hf-ac-tabs {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.25rem 1rem 0.625rem;
	margin-bottom: 0.375rem;
	border-bottom: 1px solid var(--dp-hf-border);
	overflow-x: auto;
	scrollbar-width: thin;
}

.dp-hf-ac-tab {
	flex: 0 0 auto;
	appearance: none;
	border: 1px solid var(--dp-hf-border);
	border-radius: 999px;
	background: var(--dp-hf-soft);
	color: var(--dp-hf-ink);
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 500;
	white-space: nowrap;
	padding: 0.3rem 0.8rem;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.dp-hf-ac-tab:hover { background: var(--dp-hf-bg); border-color: #CBD5E1; }
.dp-hf-ac-tab:focus-visible { outline: 2px solid var(--dp-hf-cyan); outline-offset: 2px; }
.dp-hf-ac-tab.is-active {
	background: var(--dp-hf-ink);
	border-color: var(--dp-hf-ink);
	color: #fff;
}
.dp-hf-ac-tab.is-active:hover { background: var(--dp-hf-ink); }
@media (prefers-reduced-motion: reduce) {
	.dp-hf-ac-tab { transition: none; }
}

.dp-hf-ac-group + .dp-hf-ac-group { border-top: 1px solid var(--dp-hf-border); margin-top: 0.375rem; padding-top: 0.375rem; }

.dp-hf-ac-group-label {
	padding: 0.375rem 1rem 0.25rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--dp-hf-muted);
}

.dp-hf-ac-option {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 1rem;
	text-decoration: none;
	color: var(--dp-hf-ink);
	cursor: pointer;
}
.dp-hf-ac-option:hover,
.dp-hf-ac-option.is-active { background: var(--dp-hf-soft); }

.dp-hf-ac-thumb {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	object-fit: cover;
	background: var(--dp-hf-soft);
	border: 1px solid var(--dp-hf-border);
}

.dp-hf-ac-text { min-width: 0; }
.dp-hf-ac-title {
	display: block;
	font-size: 0.9375rem;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.dp-hf-ac-meta {
	display: block;
	font-size: 0.8125rem;
	color: var(--dp-hf-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dp-hf-ac-empty,
.dp-hf-ac-loading {
	padding: 0.9rem 1rem;
	font-size: 0.875rem;
	color: var(--dp-hf-muted);
}

.dp-hf-ac-seeall {
	display: block;
	margin-top: 0.375rem;
	padding: 0.7rem 1rem;
	border-top: 1px solid var(--dp-hf-border);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--dp-hf-ink);
	text-decoration: none;
}
.dp-hf-ac-seeall:hover,
.dp-hf-ac-seeall.is-active { background: var(--dp-hf-soft); }

/* Search System v1.5.2 — inline message shown instead of submitting an
   empty / whitespace-only search (see initSearchSubmitGuard() in
   dp-hf-header.js). A small calm note under the field — never an
   alert box, never a layout shift (absolutely positioned like the
   autocomplete panel). The explicit [hidden] rule keeps it hidden
   even though the base rule sets display. */
.dp-hf-search-hint {
	position: absolute;
	top: calc(100% + 0.375rem);
	left: 0;
	z-index: 60;
	display: block;
	max-width: 100%;
	padding: 0.4rem 0.75rem;
	background: var(--dp-hf-bg);
	border: 1px solid var(--dp-hf-border);
	border-radius: 8px;
	box-shadow: 0 6px 16px -8px rgba(17, 24, 39, 0.18);
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--dp-hf-muted);
	pointer-events: none;
}
.dp-hf-search-hint[hidden] { display: none; }

.dp-hf-row-1-actions { display: flex; align-items: center; gap: 1.25rem; flex: 0 0 auto; }

.dp-hf-icon-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	padding: 0.4rem 0.55rem;
	border-radius: var(--dp-hf-radius);
	color: var(--dp-hf-ink);
	text-decoration: none;
	transition: background-color 0.15s ease;
}
.dp-hf-icon-link-label { font-size: 0.6875rem; color: var(--dp-hf-muted); }
.dp-hf-icon-link:hover, .dp-hf-icon-link:focus-visible { background: var(--dp-hf-soft); }
.dp-hf-icon-link:hover .dp-hf-icon, .dp-hf-icon-link:focus-visible .dp-hf-icon { color: var(--dp-hf-purple); }
.dp-hf-icon-link:focus-visible { outline: 2px solid var(--dp-hf-cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	.dp-hf-icon-link { transition: none; }
}

/* Hansis AI — a clearly-legible, softly-filled control rather than a
   bare outline, so it reads unambiguously as an interactive Header
   button at a glance (not a stray dark mark). */
.dp-hf-hansis-wrap { position: relative; }
.dp-hf-hansis {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 1.1rem;
	border-radius: var(--dp-hf-control-radius);
	border: 1.5px solid transparent;
	background: var(--dp-hf-soft);
	color: var(--dp-hf-ink);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.875rem;
	white-space: nowrap;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dp-hf-hansis:hover, .dp-hf-hansis:focus-visible {
	border-color: var(--dp-hf-purple);
	background: #fff;
	color: var(--dp-hf-purple);
}
.dp-hf-hansis:focus-visible { outline: 2px solid var(--dp-hf-cyan); outline-offset: 2px; }
.dp-hf-hansis-mark { width: 20px; height: 20px; color: var(--dp-hf-purple); flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) {
	.dp-hf-hansis { transition: none; }
}

.dp-hf-work-better {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.7rem 1.25rem;
	border-radius: var(--dp-hf-control-radius);
	background: var(--dp-hf-ink);
	color: #fff;
	font-weight: 600;
	font-size: 0.875rem;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease;
}
.dp-hf-work-better:hover, .dp-hf-work-better:focus-visible { background: #1f2937; color: #fff; }
.dp-hf-work-better:focus-visible { outline: 2px solid var(--dp-hf-cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	.dp-hf-work-better { transition: none; }
}

/* ---------------------------------------------------------------
   Row 2 — primary + contextual navigation
--------------------------------------------------------------- */

.dp-hf-row-2 {
	border-top: 1px solid var(--dp-hf-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 2rem;
	min-height: 50px;
}

.dp-hf-primary-nav ul, .dp-hf-contextual-nav ul {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 2.25rem;
}

.dp-hf-primary-nav a, .dp-hf-nav-trigger {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 1rem 0;
	color: var(--dp-hf-ink);
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: -0.005em;
	background: none;
	border: 0;
	cursor: pointer;
	font-family: inherit;
}
.dp-hf-primary-nav a::after, .dp-hf-nav-trigger::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--dp-hf-purple);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.15s ease;
}
.dp-hf-primary-nav a:hover, .dp-hf-nav-trigger:hover,
.dp-hf-primary-nav a:focus-visible, .dp-hf-nav-trigger:focus-visible {
	color: var(--dp-hf-purple);
}
.dp-hf-primary-nav a:hover::after, .dp-hf-nav-trigger:hover::after,
.dp-hf-primary-nav a:focus-visible::after, .dp-hf-nav-trigger:focus-visible::after,
.dp-hf-nav-item--categories.is-open .dp-hf-nav-trigger::after {
	transform: scaleX(1);
}
.dp-hf-nav-trigger:focus-visible, .dp-hf-primary-nav a:focus-visible { outline: 2px solid var(--dp-hf-cyan); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
	.dp-hf-primary-nav a::after, .dp-hf-nav-trigger::after { transition: none; }
}

.dp-hf-nav-trigger-chevron { width: 14px; height: 14px; transition: transform 0.15s ease; }
.dp-hf-nav-item--categories.is-open .dp-hf-nav-trigger-chevron { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
	.dp-hf-nav-trigger-chevron { transition: none; }
}

.dp-hf-nav-contextual { color: var(--dp-hf-muted) !important; font-weight: 500; display: inline-flex; align-items: center; gap: 0.35rem; }
.dp-hf-nav-contextual .dp-hf-icon { width: 16px; height: 16px; color: var(--dp-hf-purple); }

/* ---------------------------------------------------------------
   Hansis micro popup
--------------------------------------------------------------- */

.dp-hf-hansis-popup {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 600;
	background: var(--dp-hf-ink);
	color: #fff;
	border-radius: var(--dp-hf-radius);
	padding: 0.85rem 2.25rem 0.85rem 1rem;
	max-width: 300px;
	font-size: 0.875rem;
	box-shadow: 0 10px 30px rgba(17, 24, 39, 0.25);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.dp-hf-hansis-popup.is-visible { opacity: 1; transform: translateY(0); }
.dp-hf-hansis-popup a { color: #fff; text-decoration: none; font-weight: 600; }
.dp-hf-hansis-popup-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 22px;
	height: 22px;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	padding: 0;
}
.dp-hf-hansis-popup-close .dp-hf-icon { width: 14px; height: 14px; }

@media (prefers-reduced-motion: reduce) {
	.dp-hf-hansis-popup { transition: none; }
}
