/*
 * Manto Online header: category-focused, animated logo, mega menu, search, mobile category chips.
 * Markup additions come from features.php (mo-* classes); WoodMart header rows are restyled here.
 */

html:root {
	--mo-ease: cubic-bezier(.22, .8, .24, 1);
	--mo-line: rgba(51, 40, 33, .1);
}

/* ---------- Sticky: the top bar scrolls away, the main row stays ---------- */
html .whb-header {
	position: sticky;
	top: calc(-1 * var(--wd-top-bar-h, 40px));
	z-index: 390;
}
@media (max-width: 1024px) {
	html .whb-header { top: calc(-1 * var(--wd-top-bar-sm-h, 40px)); }
}

/* ---------- Top bar ---------- */
html .whb-top-bar {
	background-color: var(--mo-brown);
}
html .whb-top-bar .wd-nav-main > li > a {
	font-size: 13px;
	font-weight: 500;
	color: rgba(248, 239, 227, .78);
	transition: color .2s ease;
}
html .whb-top-bar .wd-nav-main > li > a:hover,
html .whb-top-bar .wd-nav-main > li.current-menu-item > a {
	color: var(--mo-cream);
}

/* ---------- Main row ---------- */
html .whb-general-header {
	background-color: var(--mo-white);
	border-bottom: 1px solid var(--mo-line);
	transition: box-shadow .3s ease;
}
html.mo-scrolled .whb-general-header {
	box-shadow: 0 14px 30px -22px rgba(51, 40, 33, .45);
}

@media (min-width: 1025px) {
	html .whb-general-header .container { position: relative; }
	html .whb-general-header .whb-col-left { display: none; }
	html .whb-general-header .whb-col-center {
		flex: 1 1 auto;
		justify-content: flex-start;
		align-self: stretch;
		gap: 28px;
	}
	html .whb-general-header .whb-col-center .site-logo { order: -1; }
	html .whb-general-header .whb-col-right {
		flex: 0 0 auto;
		gap: 10px;
	}
}

/* ---------- Logo (two layers: square + mark) ---------- */
html .wd-logo.wd-main-logo {
	display: flex !important;
	align-items: center;
	gap: 12px;
	text-decoration: none;
}
.mo-logo {
	position: relative;
	display: block;
	flex: none;
	width: 62px;
	aspect-ratio: 240 / 231;
}
.mo-logo img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	transition: transform .55s var(--mo-ease);
}
.mo-logo__sq {
	transform-origin: 50% 55%;
	animation: mo-sq-in .9s var(--mo-ease) .1s both;
}
.mo-logo__mk {
	animation: mo-mk-in 1.2s var(--mo-ease) .35s both;
}
.wd-logo:hover .mo-logo__sq { transform: rotate(-8deg) scale(1.06); }
.wd-logo:hover .mo-logo__mk { transform: translateY(-2px); }

.mo-wordmark {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
	animation: mo-wm-in .8s var(--mo-ease) .6s both;
}
.mo-wordmark b {
	font-size: 19px;
	font-weight: 800;
	color: var(--mo-brown);
	white-space: nowrap;
}
.mo-wordmark small {
	margin-top: 3px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 2.4px;
	text-transform: uppercase;
	color: var(--mo-taupe);
	direction: ltr;
	text-align: right;
	white-space: nowrap;
}
html.mo-scrolled .mo-logo { width: 52px; }
.mo-logo { transition: width .35s var(--mo-ease); }

@keyframes mo-sq-in {
	from { opacity: 0; transform: scale(.55) rotate(-14deg); }
	to { opacity: 1; transform: none; }
}
@keyframes mo-mk-in {
	from { opacity: .15; clip-path: inset(0 0 100% 0); transform: translateY(-6px); }
	to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; }
}
@keyframes mo-wm-in {
	from { opacity: 0; transform: translateX(14px); }
	to { opacity: 1; transform: none; }
}

/* ---------- Category nav (desktop) ---------- */
.mo-nav {
	display: flex;
	align-self: stretch;
}
.mo-nav__list {
	display: flex;
	align-items: stretch;
	gap: 2px;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}
.mo-nav__item {
	display: flex;
	align-items: center;
}
/* Animate the link, not the <li>: a transform animation on the <li> would become the
   containing block of the absolutely positioned mega panel and shrink it to the item width. */
.mo-nav__item > .mo-nav__link {
	animation: mo-fade-down .6s var(--mo-ease) calc(.3s + var(--i, 0) * .06s) both;
}
.mo-nav__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 9px 12px;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--mo-brown) !important;
	white-space: nowrap;
	transition: background-color .25s ease, color .25s ease;
}
.mo-nav__link::after {
	content: "";
	position: absolute;
	right: 12px;
	left: 12px;
	bottom: 3px;
	height: 2px;
	border-radius: 2px;
	background: var(--mo-taupe);
	transform: scaleX(0);
	transition: transform .35s var(--mo-ease);
}
.mo-nav__item:hover > .mo-nav__link::after,
.mo-nav__item:focus-within > .mo-nav__link::after,
.mo-nav__item.is-open > .mo-nav__link::after {
	transform: scaleX(1);
}
.mo-nav__link:focus-visible {
	outline: 2px solid var(--mo-taupe);
	outline-offset: 2px;
}
.mo-nav__caret {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform .3s var(--mo-ease);
}
.mo-nav__item:hover .mo-nav__caret,
.mo-nav__item:focus-within .mo-nav__caret,
.mo-nav__item.is-open .mo-nav__caret {
	transform: rotate(180deg);
}

/* "New arrivals" pill */
.mo-nav__item--new .mo-nav__link {
	margin-inline-end: 6px;
	padding: 9px 16px 9px 18px;
	background: var(--mo-brown);
	color: var(--mo-cream) !important;
}
.mo-nav__item--new .mo-nav__link::after { display: none; }
.mo-nav__item--new .mo-nav__link::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mo-soft);
	margin-inline-end: 4px;
	animation: mo-pulse 1.8s ease-in-out infinite;
}
.mo-nav__item--new .mo-nav__link:hover { background: var(--mo-hover); }

@keyframes mo-fade-down {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: none; }
}
@keyframes mo-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(216, 197, 173, .7); }
	50% { box-shadow: 0 0 0 6px rgba(216, 197, 173, 0); }
}

/* ---------- Mega menu ---------- */
.mo-mega {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: 40;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	pointer-events: none;
	transition: opacity .22s ease, transform .3s var(--mo-ease), visibility 0s linear .3s;
}
/* invisible bridge over the gap between the menu item and the panel, so the hover isn't lost */
.mo-mega::before {
	content: "";
	position: absolute;
	right: 0;
	left: 0;
	bottom: 100%;
	height: 30px;
}
.mo-nav__item--mega:hover > .mo-mega,
.mo-nav__item--mega:focus-within > .mo-mega,
.mo-nav__item--mega.is-open > .mo-mega,
.mo-nav__item--mega.is-hover > .mo-mega {
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
	transition-delay: .06s, .06s, 0s;
}
.mo-mega__inner {
	display: grid;
	grid-template-columns: 210px 1fr 240px;
	gap: 32px;
	padding: 28px 32px;
	background: var(--mo-white);
	border: 1px solid var(--mo-line);
	border-top: 0;
	border-radius: 0 0 24px 24px;
	box-shadow: 0 30px 60px -30px rgba(51, 40, 33, .4);
}
.mo-mega__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding-inline-start: 4px;
	border-inline-start: 0;
}
.mo-mega__eyebrow {
	font-size: 12px;
	font-weight: 600;
	color: var(--mo-taupe);
}
.mo-mega__head strong {
	font-size: 26px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--mo-brown);
}
.mo-mega__all {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--mo-cream);
	color: var(--mo-brown) !important;
	font-size: 14px;
	font-weight: 700;
	transition: background-color .25s ease;
}
.mo-mega__all::after { content: "←"; transition: transform .3s var(--mo-ease); }
.mo-mega__all:hover { background: var(--mo-soft); }
.mo-mega__all:hover::after { transform: translateX(-4px); }

.mo-mega__links {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	align-content: start;
	gap: 4px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.mo-mega__links li {
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .3s ease, transform .35s var(--mo-ease);
}
.mo-nav__item--mega:hover .mo-mega__links li,
.mo-nav__item--mega:focus-within .mo-mega__links li,
.mo-nav__item--mega.is-open .mo-mega__links li,
.mo-nav__item--mega.is-hover .mo-mega__links li {
	opacity: 1;
	transform: none;
	transition-delay: calc(var(--j, 1) * .035s);
}
.mo-mega__links a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 11px 14px;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 500;
	color: var(--mo-brown) !important;
	transition: background-color .2s ease, padding .25s var(--mo-ease);
}
.mo-mega__links a::after {
	content: "←";
	opacity: 0;
	transform: translateX(6px);
	color: var(--mo-taupe);
	transition: opacity .2s ease, transform .3s var(--mo-ease);
}
.mo-mega__links a:hover,
.mo-mega__links a:focus-visible {
	background: var(--mo-cream);
	padding-inline-start: 18px;
}
.mo-mega__links a:hover::after,
.mo-mega__links a:focus-visible::after {
	opacity: 1;
	transform: none;
}

.mo-mega__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	max-height: 300px;
	border-radius: 18px;
	background: var(--mo-soft);
}
.mo-mega__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 20%;
	transition: transform .8s var(--mo-ease);
}
.mo-mega__media:hover img { transform: scale(1.05); }
.mo-mega__media span {
	position: absolute;
	inset: auto 0 0 0;
	padding: 40px 16px 14px;
	background: linear-gradient(to top, rgba(51, 40, 33, .85), transparent);
	color: var(--mo-cream);
	font-size: 16px;
	font-weight: 700;
}

/* ---------- Icon buttons, account, cart (cart is last = far left) ---------- */
.mo-icon-btn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(51, 40, 33, .14);
	border-radius: 50%;
	background: transparent;
	color: var(--mo-brown);
	cursor: pointer;
	transition: background-color .25s ease, border-color .25s ease, transform .25s var(--mo-ease);
}
.mo-icon-btn svg,
.mo-chip--search svg,
.mo-search__field svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}
.mo-icon-btn:hover,
.mo-icon-btn[aria-expanded="true"] {
	background: var(--mo-cream);
	border-color: var(--mo-soft);
}
.mo-icon-btn:focus-visible {
	outline: 2px solid var(--mo-taupe);
	outline-offset: 2px;
}

html .whb-general-header .whb-col-right .mo-search-toggle { order: 1; }
html .whb-general-header .whb-col-right .wd-header-my-account { order: 2; }
html .whb-general-header .whb-col-right .wd-header-cart { order: 3; }

html .whb-general-header .wd-header-my-account > a {
	height: 44px;
	padding: 0 16px;
	border: 1px solid rgba(51, 40, 33, .14);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	transition: background-color .25s ease, border-color .25s ease;
}
html .whb-general-header .wd-header-my-account > a:hover {
	background: var(--mo-cream);
	border-color: var(--mo-soft);
}

html .whb-header .wd-header-cart > a {
	transition: transform .25s var(--mo-ease);
}
html .whb-header .wd-header-cart:hover > a { transform: translateY(-1px); }
html .whb-header .wd-header-cart .wd-tools-count {
	background: var(--mo-soft) !important;
	color: var(--mo-brown) !important;
	font-weight: 700;
}
html .whb-header .wd-header-cart.mo-bump .wd-tools-icon {
	animation: mo-bump .7s var(--mo-ease);
}
@keyframes mo-bump {
	0% { transform: scale(1); }
	30% { transform: scale(1.18) rotate(-8deg); }
	60% { transform: scale(.94) rotate(4deg); }
	100% { transform: none; }
}

/* ---------- Search panel ---------- */
.mo-search {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: 45;
	background: var(--mo-white);
	border-bottom: 1px solid var(--mo-line);
	box-shadow: 0 30px 50px -30px rgba(51, 40, 33, .4);
	animation: mo-drop .35s var(--mo-ease);
}
.mo-search[hidden] { display: none; }
@keyframes mo-drop {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: none; }
}
.mo-search__inner {
	max-width: 760px;
	margin: 0 auto;
	padding: 22px 16px 20px;
}
.mo-search__label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--mo-brown);
}
.mo-search__field {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 56px;
	padding: 0 18px 0 6px;
	border: 1.5px solid var(--mo-soft);
	border-radius: 999px;
	background: var(--mo-cream);
	color: var(--mo-taupe);
	transition: border-color .2s ease, box-shadow .2s ease;
}
.mo-search__field:focus-within {
	border-color: var(--mo-taupe);
	box-shadow: 0 0 0 4px rgba(140, 117, 98, .15);
}
.mo-search__field input[type="search"] {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	font-size: 16px;
	color: var(--mo-brown);
}
.mo-search__field button {
	height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: var(--mo-brown);
	color: var(--mo-cream);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .25s ease;
}
.mo-search__field button:hover { background: var(--mo-hover); }
.mo-search__quick {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
	font-size: 13px;
	color: var(--mo-taupe);
}
.mo-search__quick a {
	padding: 6px 14px;
	border: 1px solid rgba(51, 40, 33, .12);
	border-radius: 999px;
	color: var(--mo-brown) !important;
	transition: background-color .2s ease;
}
.mo-search__quick a:hover { background: var(--mo-cream); }

/* ---------- Mobile: logo size + category chips ---------- */
.mo-chips { display: none; }

@media (max-width: 1024px) {
	.mo-logo { width: 46px; }
	html.mo-scrolled .mo-logo { width: 42px; }
	.mo-wordmark b { font-size: 16px; }
	.mo-wordmark small { font-size: 9px; letter-spacing: 1.8px; }

	.mo-chips {
		display: block;
		background: var(--mo-white);
		border-bottom: 1px solid var(--mo-line);
	}
	.mo-chips__track {
		display: flex;
		gap: 8px;
		padding: 10px 16px;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		-webkit-mask-image: linear-gradient(to left, #000 86%, transparent);
		mask-image: linear-gradient(to left, #000 86%, transparent);
	}
	.mo-chips__track::-webkit-scrollbar { display: none; }
	.mo-chip {
		flex: none;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		height: 38px;
		padding: 0 16px;
		border: 1px solid rgba(51, 40, 33, .15);
		border-radius: 999px;
		background: var(--mo-white);
		color: var(--mo-brown) !important;
		font-size: 14px;
		font-weight: 600;
		white-space: nowrap;
		scroll-snap-align: start;
		animation: mo-fade-down .5s var(--mo-ease) both;
	}
	.mo-chip:nth-child(2) { animation-delay: .05s; }
	.mo-chip:nth-child(3) { animation-delay: .1s; }
	.mo-chip:nth-child(4) { animation-delay: .15s; }
	.mo-chip:nth-child(5) { animation-delay: .2s; }
	.mo-chip:nth-child(n+6) { animation-delay: .25s; }
	.mo-chip--new {
		background: var(--mo-brown);
		border-color: var(--mo-brown);
		color: var(--mo-cream) !important;
	}
	.mo-chip--search {
		width: 38px;
		padding: 0;
		cursor: pointer;
	}
	.mo-chip--search[aria-expanded="true"] { background: var(--mo-cream); }
	.mo-search__inner { padding: 16px; }
	.mo-search__field { height: 52px; }
	.mo-search__field button { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.mo-logo__sq, .mo-logo__mk, .mo-wordmark, .mo-nav__item > .mo-nav__link, .mo-chip, .mo-search,
	.mo-nav__item--new .mo-nav__link::before {
		animation: none !important;
	}
	.mo-mega, .mo-mega__links li, .mo-logo img, .mo-nav__link::after {
		transition: none !important;
	}
}

/* ---------- Top bar Instagram link (replaced the phone-icon box) ---------- */
.mo-ig {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: rgba(248, 239, 227, .85) !important;
	font-size: 13px;
	font-weight: 500;
	transition: color .2s ease;
}
.mo-ig b { font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.mo-ig svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	transition: transform .3s var(--mo-ease);
}
.mo-ig circle:last-child { fill: currentColor; stroke: none; }
.mo-ig:hover { color: var(--mo-cream) !important; }
.mo-ig:hover svg { transform: rotate(-8deg) scale(1.08); }

/* ---------- Mobile: no social share icons / top bar; header sticks from the top ---------- */
@media (max-width: 1024px) {
	html .whb-top-bar { display: none !important; }
	html .whb-header { top: 0; }
}
/* ---------- Page change progress bar (header.js) ---------- */
.mo-pbar {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 100001;
	height: 3px;
	pointer-events: none;
}
.mo-pbar i {
	display: block;
	width: 0;
	height: 100%;
	margin-inline-start: 0;
	border-radius: 0 3px 3px 0;
	background: linear-gradient(90deg, var(--mo-taupe), var(--mo-brown));
	box-shadow: 0 0 10px rgba(140, 117, 98, .7);
	opacity: 0;
}
.mo-pbar.is-on i {
	opacity: 1;
	animation: mo-pbar-run 9s cubic-bezier(.1, .7, .2, 1) forwards;
}
.mo-pbar.is-done i {
	width: 100%;
	opacity: 0;
	transition: width .25s ease, opacity .35s ease .2s;
}
@keyframes mo-pbar-run {
	0% { width: 0; }
	15% { width: 35%; }
	50% { width: 70%; }
	100% { width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
	.mo-pbar.is-on i { animation: none; width: 70%; }
}
/* Visually hidden, still read by search engines and screen readers */
.mo-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}