/* Site header — Figma node 4026:1058 */
.site-header {
	position: relative;
	z-index: 10; /* keep the shadow above the content below */
	background: var(--n-100);
	box-shadow: var(--header-shadow);
}

.site-header__top {
	display: flex;
	align-items: center;
	gap: var(--sp-8);
	padding-block: var(--sp-24) var(--sp-32);
}

.site-header .custom-logo-link { flex: none; display: block; }
.site-header .custom-logo { width: auto; height: 50px; }

/* Auto margins centre the search between the logo and the contact group. */
.site-header__search { flex: 0 1 518px; margin-inline: auto; }

.site-header__phone {
	display: flex;
	align-items: center;
	gap: var(--sp-8);
	height: 50px;
	padding-inline: var(--sp-8);
	border-radius: var(--r-12);
	color: var(--n-20);
	font-size: var(--fs-label-l);
	line-height: var(--lh-label-l);
	white-space: nowrap;
	transition: color .15s;
}
.site-header__phone:hover { color: var(--blue); }
.site-header__phone-icon { display: none; font-size: 20px; } /* mobile only */
.site-header__phone-label::after { content: "|"; margin-inline-start: var(--sp-8); color: var(--n-80); }


/* Bottom row: category button, main menu, wishlist / cart / account */
.site-header__bottom {
	display: flex;
	align-items: center;
	gap: 4px; /* Figma: gap between wishlist and cart */
	padding-block-end: var(--sp-24);
}

.cat-button {
	display: flex;
	align-items: center;
	gap: var(--sp-8);
	height: 50px;
	padding: 5px;
	padding-inline-end: var(--sp-16);
	border: 0;
	border-radius: var(--r-16);
	color: var(--blue);
	background: var(--blue-light);
	font-size: var(--fs-body-l);
	line-height: var(--lh-body-l);
	cursor: pointer;
	transition: background-color .15s;
}
.cat-button:hover,
.cat-button[aria-expanded="true"] { background: var(--blue-light-hover); }
.cat-button__icon {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: var(--r-12);
	color: var(--n-100);
	background: var(--blue);
	font-size: 20px;
}
.cat-button__arrow { font-size: 18px; transition: rotate .2s; }
.cat-button[aria-expanded="true"] .cat-button__arrow { rotate: 180deg; }

.main-nav {
	display: flex;
	align-items: center;
	gap: var(--sp-24);
	margin-inline-start: var(--sp-24);
}
.main-nav::before { /* divider after the category button */
	content: "";
	width: 1px;
	height: 20px;
	background: var(--c-border);
}
.main-nav__list { display: flex; gap: var(--sp-8); }
.main-nav__list a {
	position: relative;
	display: flex;
	align-items: center;
	gap: 4px; /* Figma: icon to text */
	padding: var(--sp-12) var(--sp-8);
	color: var(--n-40);
	font-size: var(--fs-body-l);
	line-height: var(--lh-body-l);
	letter-spacing: .25px;
	white-space: nowrap;
	transition: color .3s;
}
/* Underline grows from the centre on hover; stays on the current page (live site behaviour). */
.main-nav__list a::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 24px;
	height: 2px;
	border-radius: 2px;
	background: var(--orange);
	transform: translateX(-50%) scaleX(0);
	transition: transform .3s ease;
}
.main-nav__list a:hover,
.main-nav__list a:focus-visible,
.main-nav__list .is-current > a,
.main-nav__list .is-parent > a { color: var(--n-10); }
.main-nav__list a:hover::after,
.main-nav__list a:focus-visible::after,
.main-nav__list .is-current > a::after { transform: translateX(-50%) scaleX(1); }
.main-nav__list .sub-menu { display: none; } /* dropdowns come later */

.site-header__wishlist { margin-inline-start: auto; }

.account-button {
	display: flex;
	align-items: center;
	gap: var(--sp-8);
	height: 50px;
	margin-inline-start: 4px;
	padding-inline: var(--sp-8);
	border-radius: var(--r-16);
	color: var(--n-10);
	font-size: var(--fs-title-m);
	line-height: var(--lh-title-m);
	font-weight: 700;
	letter-spacing: 0; /* letter-spacing breaks Persian letter joining (Windows browsers) */
	white-space: nowrap;
	transition: background-color .15s;
}
.account-button:hover { background: var(--n-97); }
.account-button > .icon:first-child { color: var(--n-60); }
.account-button__arrow { font-size: 18px; }

@media (max-width: 1024px) {
	.site-header__phone-label { display: none; }
	.main-nav { display: none; } /* replaced by the mobile menu */
}

/* Phones: a sticky header — row 1 «menu | logo | cart» (64px), row 2 the search. Rows 1 and 2 are drawn on the header's
   ::before / ::after (full-bleed white bands); the header element itself is transparent and lets clicks through,
   so when the search slides up under row 1 (.is-search-hidden, set by site-header.js on scrolling down) the space it
   leaves shows the page instead of a white gap — and nothing below jumps. */
.site-header__menu { display: none; }
@media (max-width: 769px) {
	.site-header {
		position: sticky;
		top: 0;
		z-index: 900;
		display: grid;
		grid-template-columns: 44px minmax(0, 1fr) 44px;
		grid-template-rows: 64px auto;
		grid-template-areas: "menu logo cart" "search search search";
		align-items: center;
		column-gap: var(--sp-12);
		padding: 0 var(--gutter) var(--sp-12);
		background: none;
		box-shadow: none;
		pointer-events: none;
		--ease-search: cubic-bezier(.22, .61, .36, 1); /* soft ease-out for the search row's slide */
	}
	.site-header::before, .site-header::after { content: ""; position: absolute; inset-inline: 0; pointer-events: none; }
	.site-header::before { top: 0; height: 64px; z-index: 2; background: var(--n-100); }
	.site-header::after { top: 64px; bottom: 0; z-index: 0; background: var(--n-100); box-shadow: var(--header-shadow); transition: translate .4s var(--ease-search); }
	.site-header__top, .site-header__bottom { display: contents; }
	.site-header > *, .site-header__top > *, .site-header__bottom > * { pointer-events: auto; }
	.site-header .site-header__phone, .site-header__top > .social-links, .site-header .cat-button, .site-header .main-nav, .site-header .site-header__wishlist, .site-header .account-button, .site-header .account-menu { display: none; } /* in the phone menu instead; doubled class: component CSS loads later */

	.site-header__menu { grid-area: menu; position: relative; z-index: 3; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-12); color: var(--n-10); background: var(--n-97); font-size: 22px; cursor: pointer; }
	.site-header__menu:active { background: var(--n-93); }
	.site-header .custom-logo-link { grid-area: logo; position: relative; z-index: 3; justify-self: center; }
	.site-header .custom-logo { height: 36px; }
	.site-header__cart { grid-area: cart; position: relative; z-index: 3; }
	.site-header__search { grid-area: search; position: relative; z-index: 1; width: 100%; margin: 0; }
	.site-header .site-header__search { height: 40px; padding-inline: var(--sp-12); border-radius: var(--r-12); transition: translate .4s var(--ease-search), opacity .3s ease, visibility 0s, box-shadow .15s; } /* slim on phones (desktop: 50px); doubled class: search-form.css loads later */

	/* Scrolling down: the search slides up under row 1; row 1 then carries the shadow (from the band beneath it) */
	.site-header.is-search-hidden::after { translate: 0 -100%; }
	.site-header.is-search-hidden .site-header__search { translate: 0 calc(-100% - var(--sp-12)); opacity: 0; visibility: hidden; transition: translate .4s var(--ease-search), opacity .25s ease, visibility 0s .4s, box-shadow .15s; }
}
@media (max-width: 769px) and (prefers-reduced-motion: reduce) {
	.site-header::after, .site-header .site-header__search, .site-header.is-search-hidden .site-header__search { transition: none; }
}


/* Guest: «ورود / ثبت‌نام» as a light outlined pill */
.account-button--guest { height: 44px; padding-inline: 14px 16px; border: 1px solid var(--n-90, #e3e5e8); border-radius: 999px; color: var(--n-20, #333); font-size: 14px; font-weight: 500; }
.account-button--guest:hover { border-color: var(--blue, #00aae9); background: #f2fbfe; color: var(--blue-dark, #0080af); }
.account-button--guest > .icon:first-child { color: var(--blue, #00aae9); font-size: 20px; }
.account-button--guest .account-button__label { display: inline-flex; align-items: center; gap: 8px; }
.account-button__sep { width: 1px; height: 14px; background: currentColor; opacity: .3; }
