/* =========================================================
   سربرگ — نوار بالا، منو، ابزارها، جستجو، کشوی موبایل
   ========================================================= */

.site-header {
	position: relative;
	z-index: var(--z-header);
	background-color: var(--bkk-cream);
}

/* ---------------------------------------------------------
   نوار بالا
   --------------------------------------------------------- */

.bkk-topbar {
	background-color: var(--bkk-ink);
	color: var(--bkk-cream);
	font-size: var(--step--2);
}

.bkk-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-s);
	min-height: 38px;
	padding-block: var(--space-3xs);
}

.bkk-topbar__note {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2xs);
	margin: 0;
	color: var(--bkk-sand);
}

.bkk-topbar__icon {
	width: 1.15em;
	height: 1.15em;
	flex-shrink: 0;
	color: var(--bkk-saffron);
}

.bkk-topbar__phone {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2xs);
	margin: 0;
}

.bkk-topbar__phone-label {
	color: var(--bkk-sand);
	opacity: 0.8;
}

.bkk-topbar__phone-num {
	color: var(--bkk-cream);
	font-weight: 600;
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}

.bkk-topbar__phone-num:hover {
	color: var(--bkk-saffron);
}

@media (max-width: 599px) {
	.bkk-topbar__phone-label {
		display: none;
	}

	.bkk-topbar__note span {
		display: none;
	}
}

/* ---------------------------------------------------------
   ردیف اصلی سربرگ
   --------------------------------------------------------- */

.bkk-header {
	border-block-end: 1px solid var(--bkk-line);
	background-color: var(--bkk-cream);
}

.bkk-header__inner {
	display: flex;
	align-items: center;
	gap: var(--space-m);
	min-height: 76px;
}

/* برند */

.bkk-brand {
	margin: 0;
}

.bkk-brand__link {
	display: flex;
	flex-direction: column;
	gap: 2px;
	text-decoration: none;
	line-height: 1.15;
}

.bkk-brand__name {
	font-family: var(--font-display);
	font-size: var(--step-2);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--bkk-ink);
}

.bkk-brand__tag {
	font-size: var(--step--2);
	color: var(--bkk-muted);
	font-weight: 400;
}

.custom-logo-link {
	display: block;
}

.custom-logo {
	max-height: 56px;
	width: auto;
}

/* منوی افقی */

.bkk-header__nav {
	margin-inline-start: auto;
}

.bkk-menu {
	display: flex;
	align-items: center;
	gap: var(--space-m);
	list-style: none;
	margin: 0;
	padding: 0;
}

.bkk-menu > li {
	position: relative;
}

.bkk-menu a {
	display: block;
	padding-block: var(--space-2xs);
	font-family: var(--font-display);
	font-size: var(--step-0);
	font-weight: 500;
	text-decoration: none;
	color: var(--bkk-ink);
	white-space: nowrap;
}

.bkk-menu a:hover,
.bkk-menu .current-menu-item > a {
	color: var(--bkk-saffron-deep);
}

/* زیرمنو */

.bkk-menu .sub-menu {
	position: absolute;
	inset-block-start: 100%;
	inset-inline-start: 0;
	min-width: 210px;
	margin: 0;
	padding: var(--space-2xs);
	list-style: none;
	background-color: var(--bkk-surface);
	border: 1px solid var(--bkk-line);
	border-radius: var(--radius-m);
	box-shadow: var(--shadow-lift);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity var(--dur-fast) var(--ease-out),
		transform var(--dur-fast) var(--ease-out),
		visibility var(--dur-fast);
}

.bkk-menu > li:hover > .sub-menu,
.bkk-menu > li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.bkk-menu .sub-menu a {
	padding: var(--space-2xs) var(--space-xs);
	border-radius: var(--radius-s);
	font-size: var(--step--1);
	font-weight: 400;
}

.bkk-menu .sub-menu a:hover {
	background-color: var(--bkk-sand);
}

@media (max-width: 1023px) {
	.bkk-header__nav {
		display: none;
	}
}

/* ---------------------------------------------------------
   ابزارهای سربرگ
   --------------------------------------------------------- */

.bkk-header__tools {
	display: flex;
	align-items: center;
	gap: var(--space-2xs);
	margin-inline-start: auto;
}

@media (min-width: 1024px) {
	.bkk-header__tools {
		margin-inline-start: var(--space-m);
	}
}

.bkk-tool {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: var(--space-3xs);
	padding: var(--space-2xs) var(--space-xs);
	border-radius: var(--radius-pill);
	font-size: var(--step--1);
	font-weight: 500;
	font-family: var(--font-display);
	color: var(--bkk-ink);
	text-decoration: none;
	background: none;
	border: none;
	cursor: pointer;
	transition: background-color var(--dur-fast) var(--ease-out);
}

.bkk-tool:hover {
	background-color: var(--bkk-sand);
	color: var(--bkk-ink);
}

.bkk-tool__icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}

@media (max-width: 767px) {
	.bkk-tool__label {
		display: none;
	}
}

/* شمارنده سبد */

.bkk-tool__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding-inline: 5px;
	border-radius: var(--radius-pill);
	background-color: var(--bkk-saffron);
	color: #fff;
	font-size: var(--step--2);
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	transition: transform var(--dur-base) var(--ease-out);
}

.bkk-tool__count.is-empty {
	display: none;
}

/* وقتی چیزی به سبد اضافه می‌شود شمارنده یک تپش کوتاه دارد */
.bkk-tool__count.is-bumped {
	animation: bkk-bump 420ms var(--ease-out);
}

@keyframes bkk-bump {
	40% {
		transform: scale(1.35);
	}
}

/* ---------------------------------------------------------
   دکمه همبرگری
   --------------------------------------------------------- */

.bkk-header__burger {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0 10px;
	border-radius: var(--radius-s);
	cursor: pointer;
}

.bkk-burger__bar {
	display: block;
	height: 2px;
	width: 100%;
	background-color: var(--bkk-ink);
	border-radius: 2px;
	transition: transform var(--dur-base) var(--ease-out),
		opacity var(--dur-fast) var(--ease-out);
}

.bkk-header__burger[aria-expanded="true"] .bkk-burger__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.bkk-header__burger[aria-expanded="true"] .bkk-burger__bar:nth-child(2) {
	opacity: 0;
}

.bkk-header__burger[aria-expanded="true"] .bkk-burger__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 1024px) {
	.bkk-header__burger {
		display: none;
	}
}

/* ---------------------------------------------------------
   پنل جستجو
   --------------------------------------------------------- */

.bkk-search-panel {
	border-block-end: 1px solid var(--bkk-line);
	background-color: var(--bkk-sand);
	padding-block: var(--space-m);
}

.bkk-search-panel[hidden] {
	display: none;
}

.bkk-search-form {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--space-2xs);
}

.bkk-search-form__icon {
	position: absolute;
	inset-inline-start: var(--space-s);
	width: 20px;
	height: 20px;
	color: var(--bkk-muted);
	pointer-events: none;
}

.bkk-search-form__input {
	flex: 1;
	padding-inline-start: calc(var(--space-s) * 2 + 20px);
	height: 52px;
	border-radius: var(--radius-pill);
	border-color: transparent;
	font-size: var(--step-0);
}

.bkk-search-panel__close {
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: var(--bkk-muted);
}

.bkk-search-panel__close:hover {
	background-color: var(--bkk-sand-deep);
	color: var(--bkk-ink);
}

.bkk-search-panel__close svg {
	width: 20px;
	height: 20px;
}

/* نتایج زنده */

.bkk-search-results:empty {
	display: none;
}

.bkk-search-results {
	margin-block-start: var(--space-s);
	display: grid;
	gap: var(--space-2xs);
	max-height: 60vh;
	overflow-y: auto;
}

.bkk-search-result {
	display: flex;
	align-items: center;
	gap: var(--space-s);
	padding: var(--space-2xs);
	border-radius: var(--radius-m);
	background-color: var(--bkk-surface);
	text-decoration: none;
	color: var(--bkk-ink);
}

.bkk-search-result:hover {
	background-color: var(--bkk-saffron-soft);
	color: var(--bkk-ink);
}

.bkk-search-result__thumb {
	width: 48px;
	height: 48px;
	border-radius: var(--radius-s);
	object-fit: cover;
	flex-shrink: 0;
	background-color: var(--bkk-sand);
}

.bkk-search-result__title {
	font-weight: 600;
	font-family: var(--font-display);
	font-size: var(--step--1);
}

.bkk-search-result__meta {
	font-size: var(--step--2);
	color: var(--bkk-muted);
}

.bkk-search-note {
	padding: var(--space-s);
	text-align: center;
	color: var(--bkk-muted);
	font-size: var(--step--1);
}

/* ---------------------------------------------------------
   کشوی موبایل — از سمت راست، درست برای راست‌چین
   --------------------------------------------------------- */

.bkk-drawer[hidden] {
	display: none;
}

.bkk-drawer {
	position: fixed;
	inset: 0;
	z-index: var(--z-drawer);
}

.bkk-drawer__backdrop {
	position: absolute;
	inset: 0;
	background-color: var(--bkk-overlay);
	opacity: 0;
	transition: opacity var(--dur-base) var(--ease-out);
}

.bkk-drawer.is-open .bkk-drawer__backdrop {
	opacity: 1;
}

.bkk-drawer__panel {
	position: absolute;
	inset-block: 0;
	inset-inline-end: 0;
	width: min(340px, 86vw);
	display: flex;
	flex-direction: column;
	background-color: var(--bkk-cream);
	box-shadow: var(--shadow-lift);
	transform: translateX(-100%);
	transition: transform var(--dur-base) var(--ease-out);
	overflow-y: auto;
}

/* در راست‌چین پنل از راست می‌آید، پس جابه‌جایی مثبت است */
:dir(rtl) .bkk-drawer__panel {
	transform: translateX(100%);
}

.bkk-drawer.is-open .bkk-drawer__panel {
	transform: none;
}

.bkk-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-s);
	padding: var(--space-s) var(--space-m);
	border-block-end: 1px solid var(--bkk-line);
}

.bkk-drawer__title {
	font-family: var(--font-display);
	font-size: var(--step-1);
	font-weight: 800;
}

.bkk-drawer__close {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: var(--bkk-muted);
}

.bkk-drawer__close:hover {
	background-color: var(--bkk-sand);
	color: var(--bkk-ink);
}

.bkk-drawer__close svg {
	width: 22px;
	height: 22px;
}

.bkk-drawer__nav {
	flex: 1;
	padding: var(--space-s);
}

.bkk-drawer__menu,
.bkk-drawer__menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bkk-drawer__menu a {
	display: block;
	padding: var(--space-xs) var(--space-s);
	border-radius: var(--radius-s);
	font-family: var(--font-display);
	font-size: var(--step-1);
	font-weight: 500;
	text-decoration: none;
	color: var(--bkk-ink);
}

.bkk-drawer__menu a:hover {
	background-color: var(--bkk-sand);
}

.bkk-drawer__menu .sub-menu a {
	font-size: var(--step-0);
	font-weight: 400;
	color: var(--bkk-muted);
	padding-inline-start: var(--space-l);
}

.bkk-drawer__foot {
	padding: var(--space-m);
	border-block-start: 1px solid var(--bkk-line);
	background-color: var(--bkk-sand);
}

.bkk-drawer__foot-label {
	display: block;
	font-size: var(--step--2);
	color: var(--bkk-muted);
	margin-block-end: var(--space-3xs);
}

.bkk-drawer__phone {
	font-family: var(--font-display);
	font-size: var(--step-2);
	font-weight: 800;
	color: var(--bkk-ink);
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}

/* جلوگیری از اسکرول پس‌زمینه وقتی کشو باز است */
body.bkk-no-scroll {
	overflow: hidden;
}
