/* =========================================================
   home-header.css — پایهٔ طراحی + هدر اختصاصی صفحهٔ اصلی
   پالت برگرفته از سایت نمونه:
     سرمه‌ای تیره #11207A ، سرمه‌ای #2B3992 ، سبز لیمویی #BBD430
   ========================================================= */

:root {
	--jw-navy-dark: #11207a;
	--jw-navy: #2b3992;
	--jw-navy-soft: #152067;
	--jw-lime: #bbd430;
	--jw-lime-dark: #a3ba22;
	--jw-lime-soft: rgba(187, 212, 48, .38);
	--jw-lime-tint: rgba(187, 212, 48, .16);
	--jw-ink: #2c2c2c;
	--jw-gray: #5e5d5d;
	--jw-line: #e1e1e1;
	--jw-white: #ffffff;
	--jw-radius-xl: 45px;
	--jw-radius-lg: 22px;
	--jw-radius: 14px;
	--jw-shadow: 0 0 100px -34px rgba(0, 0, 0, .33);
	--jw-shadow-sm: 0 8px 26px rgba(17, 32, 122, .09);
	--jw-ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body.jw-body {
	margin: 0;
	direction: rtl;
	background: var(--jw-white);
	color: var(--jw-ink);
	font-family: "iranyekanXfanum", "IRANYekanX", Tahoma, sans-serif;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
body.jw-body img { max-width: 100%; height: auto; }
body.jw-body a { color: inherit; text-decoration: none; }
body.jw-body ul { margin: 0; padding: 0; list-style: none; }
body.jw-body button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
body.jw-body input { font: inherit; }

.jw-skip { position: absolute; right: -9999px; top: 8px; z-index: 9999; background: #fff; padding: 10px 16px; border-radius: 10px; }
.jw-skip:focus { right: 14px; }

.jw-wrap {
	width: min(1240px, 100%);
	margin-inline: auto;
	padding-inline: 16px;
}

/* دکمه‌های مشترک */
.jw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 14px 34px;
	border-radius: 50px;
	font-size: 15px;
	font-weight: 600;
	border: 3px solid transparent;
	transition: background .22s, color .22s, border-color .22s, transform .18s var(--jw-ease);
}
.jw-btn svg { stroke: currentColor; }
.jw-btn--lg { padding: 17px 48px; font-size: 17px; }
.jw-btn--block { width: 100%; }

.jw-btn--lime {
	background: var(--jw-lime);
	border-color: var(--jw-lime);
	color: var(--jw-navy);
	box-shadow: 1px 5px 32px rgba(75, 44, 17, .35);
}
.jw-btn--lime:hover { background: transparent; color: #fff; }

.jw-btn--navy {
	background: var(--jw-navy);
	border-color: var(--jw-navy);
	color: #fff;
}
.jw-btn--navy:hover { background: transparent; color: var(--jw-navy); }

/* =========================================================
   هدر
   ========================================================= */
.jh {
	position: sticky;
	top: 0;
	z-index: 900;
	background: var(--jw-navy-dark);
}
.jh-wrap { width: min(1240px, 100%); margin-inline: auto; padding-inline: 16px; }

.jh-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	height: 92px;
}

.jh-logo { flex: 0 0 auto; display: flex; align-items: center; }
.jh-logo img { max-height: 54px; width: auto; object-fit: contain; }
.jh-logo span { color: #fff; font-size: 20px; font-weight: 800; }

/* منو */
.jh-nav__list { display: flex; align-items: center; gap: 4px; }
.jh-nav__list > li { position: relative; }
.jh-nav__list > li > a {
	position: relative;
	display: block;
	padding: 6px 10px;
	font-size: 15px;
	color: #fff;
	transition: color .2s;
}
.jh-nav__list > li > a::before {
	content: "";
	position: absolute;
	inset-inline: 10px;
	bottom: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--jw-lime);
	transform: scaleX(0);
	transition: transform .25s var(--jw-ease);
}
.jh-nav__list > li:hover > a { color: var(--jw-lime); }
.jh-nav__list > li:hover > a::before,
.jh-nav__list > li > a.is-current::before { transform: scaleX(1); }

.jh-nav__badge {
	position: absolute;
	top: -10px;
	inset-inline-start: 2px;
	font-size: 9.5px;
	font-weight: 700;
	color: var(--jw-lime);
	white-space: nowrap;
	pointer-events: none;
}

.jh-nav__sub {
	position: absolute;
	top: calc(100% + 14px);
	inset-inline-start: 0;
	min-width: 210px;
	padding: 10px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 5px 20px rgba(187, 212, 48, .49);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity .2s var(--jw-ease), transform .2s var(--jw-ease), visibility .2s;
}
.jh-nav__has-child:hover .jh-nav__sub { opacity: 1; visibility: visible; transform: none; }
.jh-nav__sub a {
	display: block;
	padding: 9px 12px;
	border-radius: 9px;
	font-size: 13.5px;
	color: var(--jw-ink);
	transition: background .18s, color .18s;
}
.jh-nav__sub a:hover { background: var(--jw-navy); color: #fff; }

/* اکشن‌ها */
.jh-actions { display: flex; align-items: center; gap: 8px; }

.jh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 44px;
	min-width: 44px;
	padding: 0 12px;
	border-radius: 12px;
	transition: background .2s, color .2s;
}
.jh-btn svg { stroke: #fff; }
.jh-btn--glass { background: rgba(255, 255, 255, .31); color: #fff; }
.jh-btn--glass:hover { background: var(--jw-lime); }
.jh-btn--glass:hover svg { stroke: var(--jw-navy); }

.jh-btn--lime { background: var(--jw-lime-soft); color: var(--jw-lime); font-size: 13.5px; font-weight: 600; padding: 0 16px; }
.jh-btn--lime svg { stroke: var(--jw-lime); }
.jh-btn--lime:hover { background: var(--jw-lime); color: var(--jw-navy); }
.jh-btn--lime:hover svg { stroke: var(--jw-navy); }

.jh-toggle { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px; align-items: center; justify-content: center; }
.jh-toggle span { width: 20px; height: 2px; border-radius: 2px; background: #f1f1f1; transition: transform .25s var(--jw-ease), opacity .2s; }
.jh-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.jh-toggle.is-open span:nth-child(2) { opacity: 0; }
.jh-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* سبد خرید */
.jh-cart { position: relative; }
.jh-cart__btn { position: relative; }
.jh-cart__badge {
	position: absolute;
	top: -6px;
	inset-inline-start: -6px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	display: grid;
	place-items: center;
	border-radius: 999px;
	background: #fff;
	color: var(--jw-navy);
	font-size: 11px;
	font-weight: 700;
}
.jh-cart__panel {
	position: absolute;
	top: calc(100% + 14px);
	inset-inline-start: 0;
	width: min(340px, calc(100vw - 32px));
	border-radius: 18px;
	background: #fff;
	box-shadow: var(--jw-shadow-sm);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity .2s var(--jw-ease), transform .2s var(--jw-ease), visibility .2s;
	z-index: 40;
}
.jh-cart.is-open .jh-cart__panel { opacity: 1; visibility: visible; transform: none; }
.jh-cart__head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--jw-line); font-size: 14px; font-weight: 700; }
.jh-cart__close { font-size: 22px; line-height: 1; color: var(--jw-gray); }
.jh-cart__body { max-height: 320px; overflow-y: auto; padding: 8px; }
.jh-cart__empty { margin: 0; padding: 30px 12px; text-align: center; font-size: 13.5px; color: var(--jw-gray); }

.jh-citem { display: flex; gap: 10px; padding: 10px; }
.jh-citem + .jh-citem { border-top: 1px solid var(--jw-line); }
.jh-citem__thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: #f4f5f7; }
.jh-citem__thumb img { width: 100%; height: 100%; object-fit: cover; }
.jh-citem__info { flex: 1; min-width: 0; }
.jh-citem__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; line-height: 1.75; }
.jh-citem__row { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.jh-citem__price { font-size: 12.5px; font-weight: 700; color: var(--jw-navy); }
.jh-qty { display: flex; align-items: center; gap: 9px; border: 1px solid var(--jw-line); border-radius: 9px; padding: 2px 8px; }
.jh-qty button { font-size: 15px; line-height: 1; color: var(--jw-navy); }
.jh-qty span { font-size: 12.5px; min-width: 14px; text-align: center; }

.jh-cart__foot { padding: 15px 18px; border-top: 1px solid var(--jw-line); }
.jh-cart__total { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; }
.jh-cart__total strong { font-size: 15px; color: var(--jw-navy); }

/* خط جداکنندهٔ زیر هدر */
.jh-divider { height: 1px; background: rgba(238, 238, 238, .23); }

/* =========================================================
   مودال جستجو
   ========================================================= */
.jh-search { position: fixed; inset: 0; z-index: 1300; pointer-events: none; }
.jh-search.is-open { pointer-events: auto; }
.jh-search__backdrop { position: absolute; inset: 0; background: rgba(9, 9, 9, .55); opacity: 0; transition: opacity .25s; }
.jh-search.is-open .jh-search__backdrop { opacity: 1; }
.jh-search__box {
	position: relative;
	width: min(640px, calc(100% - 28px));
	margin: 12vh auto 0;
	padding: 22px;
	border-radius: 22px;
	background: #fff;
	transform: translateY(-14px);
	opacity: 0;
	transition: opacity .25s var(--jw-ease), transform .25s var(--jw-ease);
}
.jh-search.is-open .jh-search__box { opacity: 1; transform: none; }
.jh-search__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--jw-line); font-size: 16px; font-weight: 700; }
.jh-search__close { font-size: 26px; line-height: 1; color: var(--jw-gray); }

.jh-search__form { position: relative; margin: 18px 0; }
.jh-search__form input {
	width: 100%;
	height: 52px;
	padding: 0 50px 0 16px;
	border: 1.5px solid var(--jw-line);
	border-radius: 14px;
	outline: 0;
	font-size: 14px;
	transition: border-color .2s;
}
.jh-search__form input:focus { border-color: var(--jw-navy); }
.jh-search__icon { position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-50%); }
.jh-search__icon svg { stroke: var(--jw-gray); }

.jh-search__results { max-height: 46vh; overflow-y: auto; }
.jh-search__group + .jh-search__group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--jw-line); }
.jh-search__gtitle { display: block; margin-bottom: 8px; font-size: 12.5px; font-weight: 700; color: var(--jw-gray); }
.jh-search__results a {
	display: block;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 13.5px;
	transition: background .18s, color .18s;
}
.jh-search__results a:hover { background: var(--jw-lime-tint); color: var(--jw-navy); }
.jh-search__state { margin: 0; padding: 16px; text-align: center; font-size: 13px; color: var(--jw-gray); }
.jh-search__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.jh-chip {
	padding: 7px 14px;
	border-radius: 999px;
	background: #f4f5f7;
	font-size: 12.5px;
	color: var(--jw-gray);
	transition: background .18s, color .18s;
}
.jh-chip:hover { background: var(--jw-navy); color: #fff; }

/* =========================================================
   منوی کشویی موبایل
   ========================================================= */
.jh-drawer { position: fixed; inset: 0; z-index: 1200; pointer-events: none; }
.jh-drawer.is-open { pointer-events: auto; }
.jh-drawer__backdrop { position: absolute; inset: 0; background: rgba(9, 9, 9, .5); opacity: 0; transition: opacity .28s; }
.jh-drawer.is-open .jh-drawer__backdrop { opacity: 1; }
.jh-drawer__panel {
	position: absolute;
	inset-block: 0;
	inset-inline-end: 0;
	width: min(320px, 86vw);
	padding: 18px;
	overflow-y: auto;
	background: var(--jw-navy-dark);
	color: #fff;
	transform: translateX(-100%);
	transition: transform .3s var(--jw-ease);
}
.jh-drawer.is-open .jh-drawer__panel { transform: none; }
.jh-drawer__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid rgba(255, 255, 255, .15); }
.jh-drawer__head img { max-height: 40px; width: auto; }
.jh-drawer__close { font-size: 28px; line-height: 1; color: #fff; }
.jh-drawer__profile {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	margin: 18px 0;
	height: 46px;
	border-radius: 12px;
	background: var(--jw-lime);
	color: var(--jw-navy);
	font-size: 14px;
	font-weight: 700;
}
.jh-drawer__profile svg { stroke: var(--jw-navy); }
.jh-drawer__list li + li { border-top: 1px solid rgba(255, 255, 255, .12); }
.jh-drawer__list a { display: block; padding: 13px 4px; font-size: 14px; }
.jh-drawer__list--sub a { font-size: 13px; color: rgba(255, 255, 255, .78); }
.jh-drawer__title { display: block; margin: 20px 0 6px; font-size: 12px; font-weight: 700; color: var(--jw-lime); }

/* =========================================================
   واکنش‌گرایی
   ========================================================= */
@media (max-width: 1100px) {
	.jh-nav__list > li > a { padding: 6px 7px; font-size: 14px; }
}

@media (max-width: 992px) {
	.jh-nav { display: none; }
	.jh-toggle { display: flex; }
	.jh-bar__inner { height: 74px; }
	.jh-logo img { max-height: 42px; }
	.jh-btn--wide span { display: none; }
	.jh-btn--lime { padding: 0 12px; }
}

@media (max-width: 520px) {
	.jh-bar__inner { gap: 10px; }
	.jh-search__box { margin-top: 8vh; padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.jh *, .jw-btn { transition: none !important; animation: none !important; }
}
