/* =============================================================
   Daruport — global site header (ported from the design
   prototype's sticky header). Self-contained: it does NOT depend
   on Tailwind, so it can load on every page without the CDN cost.
   All colours are the prototype's brand/ink palette, scoped to
   `.dp-header` so the rest of the site tokens stay untouched.
   ============================================================= */
.dp-header {
	--b50:#ecfdf5; --b400:#34d399; --b500:#10b981; --b600:#059669; --b700:#047857;
	--i50:#f6f7f6; --i100:#eceeed; --i400:#7f8a85; --i500:#5a655f; --i600:#414b46; --i900:#141a17;
	--rose:#f43f5e;
	--glow:0 10px 40px rgba(5,150,105,.18);
	--soft:0 1px 2px rgba(20,26,23,.04), 0 8px 30px rgba(20,26,23,.06);
	--tr:all .25s cubic-bezier(.4,0,.2,1);

	position: sticky;
	inset-block-start: 0;
	z-index: 100;
	background: rgba(255,255,255,.9);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-block-end: 1px solid var(--i100);
	font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.dp-header.is-stuck { box-shadow: var(--soft); }
.dp-header *, .dp-header *::before, .dp-header *::after { box-sizing: border-box; }

.dp-header__bar {
	max-width: 80rem;
	margin-inline: auto;
	padding-inline: 1rem;
	min-height: 72px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
}

/* ---- Logo ---- */
.dp-logo { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.dp-logo:hover { color: inherit; }
.dp-logo__mark {
	position: relative;
	width: 44px; height: 44px;
	border-radius: 1rem;
	background: var(--b600);
	box-shadow: var(--glow);
	display: flex; align-items: center; justify-content: center;
	transition: var(--tr);
}
.dp-logo:hover .dp-logo__mark { transform: rotate(6deg); }
.dp-logo__mark i {
	position: absolute;
	background: #fff;
	border-radius: 999px;
}
.dp-logo__mark i:first-child { width: 20px; height: 3px; }
.dp-logo__mark i:last-child  { width: 3px; height: 20px; }
.dp-logo__img { display: block; max-height: 48px; width: auto; }
.dp-logo__text { line-height: 1.15; }
.dp-logo__name { display: block; font-weight: 900; font-size: 1.25rem; color: var(--i900); }
.dp-logo__tag  { display: none; font-size: 11px; color: var(--b600); font-weight: 700; letter-spacing: .03em; }

/* ---- Desktop search ---- */
.dp-search { position: relative; flex: 1 1 auto; max-width: 36rem; }
.dp-search__field {
	width: 100%;
	background: var(--i50);
	border: 1px solid var(--i100);
	border-radius: .75rem;
	padding: .625rem 2.75rem .625rem 1rem;
	font: inherit;
	font-size: .875rem;
	color: var(--i900);
	transition: var(--tr);
}
.dp-search__field::placeholder { color: var(--i400); }
.dp-search__field:focus {
	outline: none;
	border-color: var(--b500);
	box-shadow: 0 0 0 3px rgba(16,185,129,.18);
	background: #fff;
}
.dp-search__btn {
	position: absolute;
	inset-inline-start: .5rem;
	inset-block-start: 50%;
	transform: translateY(-50%);
	width: 2rem; height: 2rem;
	display: flex; align-items: center; justify-content: center;
	background: none; border: 0; padding: 0; cursor: pointer;
	color: var(--i400);
}
.dp-search__btn svg { width: 20px; height: 20px; }

/* ---- Live search dropdown (filled by main.js) ---- */
.dp-search__panel {
	position: absolute;
	inset-block-start: calc(100% + .375rem);
	inset-inline: 0;
	background: #fff;
	border: 1px solid var(--i100);
	border-radius: .75rem;
	box-shadow: var(--soft);
	max-height: 420px;
	overflow-y: auto;
	z-index: 90;
	padding: .375rem;
}
.dp-search__item {
	display: flex;
	align-items: center;
	gap: .625rem;
	padding: .5rem .625rem;
	border-radius: .5rem;
	color: var(--i900);
	text-decoration: none;
	transition: background-color .15s ease;
}
.dp-search__item:hover,
.dp-search__item:focus { background: var(--b50); color: var(--i900); }
.dp-search__item img {
	width: 2.5rem;
	height: 2.5rem;
	object-fit: contain;
	border-radius: .5rem;
	background: var(--i50);
	flex: none;
}
.dp-search__item-t {
	flex: 1 1 auto;
	min-width: 0;
	font-size: .8125rem;
	font-weight: 700;
	line-height: 1.4;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.dp-search__item-p {
	flex: none;
	font-size: .75rem;
	font-weight: 800;
	color: var(--b700);
	white-space: nowrap;
}
.dp-search__none {
	padding: .875rem;
	font-size: .8125rem;
	color: var(--i400);
	text-align: center;
}
.dp-search__all {
	display: block;
	margin-top: .25rem;
	padding: .625rem;
	border-top: 1px solid var(--i100);
	text-align: center;
	font-size: .75rem;
	font-weight: 800;
	color: var(--b700);
	text-decoration: none;
}
.dp-search__all:hover { color: var(--b600); }

/* ---- Tools (cart / account) ---- */
.dp-header__tools { display: flex; align-items: center; gap: .375rem; flex-shrink: 0; }
.dp-icon-btn {
	position: relative;
	display: flex; align-items: center; justify-content: center;
	width: 2.75rem; height: 2.75rem;
	border-radius: .75rem;
	color: var(--i500);
	background: none; border: 0; cursor: pointer;
	transition: var(--tr);
}
.dp-icon-btn:hover { color: var(--b700); background: var(--b50); }
.dp-icon-btn svg { width: 24px; height: 24px; }
.dp-cart .header-cart__count {
	position: absolute;
	inset-block-start: 2px; inset-inline-end: 2px;
	min-width: 18px; height: 18px;
	padding: 0 3px;
	background: var(--rose);
	color: #fff;
	font-size: 10px; font-weight: 900; line-height: 18px;
	text-align: center;
	border-radius: 999px;
}
.dp-cart .header-cart__count.is-empty { display: none; }

.dp-login {
	display: flex; align-items: center; gap: .5rem;
	border: 1px solid var(--i100);
	color: var(--i600);
	padding: .5rem 1rem;
	border-radius: .75rem;
	font-size: .75rem; font-weight: 700;
	transition: var(--tr);
	white-space: nowrap;
}
.dp-login:hover { border-color: var(--b400); color: var(--b700); }
.dp-login svg { width: 20px; height: 20px; }

/* ---- Category bar (editable via Appearance → Menus → Primary) ---- */
.dp-header__catbar { border-block-start: 1px solid var(--i100); background: rgba(255,255,255,.6); }
.dp-catmenu {
	max-width: 80rem;
	margin-inline: auto;
	padding-inline: 1rem;
	min-height: 44px;
	display: flex;
	align-items: center;
	gap: 1.75rem;
	overflow-x: auto;
}
.dp-catmenu::-webkit-scrollbar { display: none; }
.dp-catmenu { -ms-overflow-style: none; scrollbar-width: none; }
.dp-catmenu ul { display: contents; list-style: none; margin: 0; padding: 0; }
.dp-catmenu li { position: relative; flex-shrink: 0; }
.dp-catmenu a {
	display: inline-block;
	font-size: .875rem; font-weight: 700;
	color: var(--i500);
	padding-block: .25rem;
	transition: var(--tr);
	white-space: nowrap;
}
.dp-catmenu a:hover,
.dp-catmenu .current-menu-item > a,
.dp-catmenu .current-product_cat-ancestor > a { color: var(--b700); }
/* dropdown submenus */
.dp-catmenu .sub-menu {
	position: absolute;
	inset-block-start: 100%;
	inset-inline-start: 0;
	min-width: 200px;
	background: #fff;
	border: 1px solid var(--i100);
	border-radius: .75rem;
	box-shadow: var(--soft);
	padding: .5rem;
	display: none;
	z-index: 60;
}
.dp-catmenu li:hover > .sub-menu,
.dp-catmenu li:focus-within > .sub-menu { display: block; }
.dp-catmenu .sub-menu a { display: block; padding: .4rem .6rem; border-radius: .5rem; }
.dp-catmenu .sub-menu a:hover { background: var(--b50); }

/* ---- Mobile search drawer ---- */
.dp-search-toggle { display: none; }
.dp-msearch { display: none; padding: 0 1rem .75rem; }
.dp-msearch.is-open { display: block; }
.dp-msearch .dp-search { max-width: none; }
.dp-msearch .dp-search__btn { inset-inline-start: auto; inset-inline-end: .5rem; }
.dp-msearch .dp-search__field { padding-inline: 1rem 2.75rem; }

/* ---- Logged-in admin bar: the sticky header must sit below it, not under it. ---- */
.admin-bar .dp-header { inset-block-start: 32px; }
@media (max-width: 782px) {
	.admin-bar .dp-header { inset-block-start: 46px; }
}
@media (max-width: 599px) {
	/* Below 600px the admin bar is absolute (scrolls away), so stick at the top. */
	.admin-bar .dp-header { inset-block-start: 0; }
}

/* ---- Responsive ---- */
@media (min-width: 640px) {
	.dp-logo__tag { display: block; }
}
@media (min-width: 768px) {
	.dp-logo__name { font-size: 1.375rem; }
}
/* Below md: hide desktop search + cat bar, show mobile search toggle */
@media (max-width: 767px) {
	.dp-header__bar > .dp-search { display: none; }
	.dp-header__catbar { display: none; }
	.dp-search-toggle { display: flex; }
	.dp-login { display: none; }
}
