/*
 * Ziebart UAE - "Services" mega menu (see inc/zb-megamenu.php and megamenu.js).
 * Desktop panel under the header's Services link, and the grouped list inside the phone menu.
 * Xtreme IT Services, 2026-11-20.
 */

.zbmm,
.zbmm-m {
	--mm-red: #dd0017;
	--mm-red-dark: #b30013;
	--mm-ink: #16181b;
	--mm-text: #30343a;
	--mm-muted: #6b717a;
	--mm-line: #e9eaed;
	--mm-soft: #f6f6f7;
	--mm-tint: #fdf0f1;
}

.zbmm[hidden] {
	display: none !important;
}

/* ---------- Header link: small arrow, red while the panel is open ---------- */

.zbmm-caret {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-inline-start: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-3px) rotate(45deg);
	transition: transform 0.2s ease;
	vertical-align: middle;
}

.main-nav li.zbmm-li.is-open > a {
	color: var(--mm-red, #dd0017);
}

.main-nav li.zbmm-li.is-open > a .zbmm-caret {
	transform: translateY(0) rotate(225deg);
}

header.zbmm-open {
	z-index: 999 !important;
}

/* ---------- Desktop panel ---------- */

#zbmm {
	display: none;
	position: fixed;
	top: var(--zbmm-top, 88px);
	left: 0;
	right: 0;
	width: min(1180px, calc(100vw - 48px));
	height: auto;
	max-height: calc(100vh - var(--zbmm-top, 88px) - 16px);
	margin: 0 auto;
	padding: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	border-top: 3px solid var(--mm-red);
	border-radius: 0 0 18px 18px;
	box-shadow: 0 28px 60px rgba(16, 18, 22, 0.18), 0 2px 8px rgba(16, 18, 22, 0.06);
	color: var(--mm-text);
	font-size: 14px;
	line-height: 1.45;
	text-align: start;
	text-transform: none;
	z-index: 20;
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 0.2s ease, transform 0.2s ease, display 0.2s allow-discrete;
}

.main-nav li.zbmm-li.is-open > #zbmm {
	display: block;
	opacity: 1;
	transform: none;
}

@starting-style {
	.main-nav li.zbmm-li.is-open > #zbmm {
		opacity: 0;
		transform: translateY(-8px);
	}
}

/* The header's own menu rules reach into the panel; put everything back to normal inside it.
   (On the Services page the theme rule ".current_page_item a" forces red with !important, so the panel colours use !important too.) */
#zbmm div,
#zbmm ul,
#zbmm li,
#zbmm p {
	height: auto;
	margin: 0;
	padding: 0;
	float: none;
	list-style: none;
	line-height: inherit;
	width: auto;
}

#zbmm li {
	display: block;
}

#zbmm a {
	display: inline;
	height: auto;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	text-transform: none;
	vertical-align: baseline;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

#zbmm sup,
.zbmm-m sup {
	font-size: 0.62em;
	line-height: 0;
	vertical-align: super;
	margin-inline-start: 1px;
}

#zbmm .zbmm__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
}

#zbmm .zbmm__cols {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0 32px;
	padding: 28px 32px 8px;
}

#zbmm .zbmm__group {
	margin-bottom: 22px;
}

#zbmm .zbmm__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-bottom: 12px;
	margin-bottom: 6px;
	border-bottom: 1px solid var(--mm-line);
}

#zbmm .zbmm__thumb,
.zbmm-m .zbmm__thumb {
	flex: none;
	width: 46px;
	height: 46px;
	max-width: none;
	border-radius: 12px;
	object-fit: cover;
	background: var(--mm-soft);
	box-shadow: 0 0 0 1px rgba(16, 18, 22, 0.06);
}

#zbmm .zbmm__title {
	color: var(--mm-ink);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
}

#zbmm .zbmm__note {
	color: var(--mm-muted);
	font-size: 12.5px;
	line-height: 1.35;
	margin-top: 2px;
}

#zbmm .zbmm__link {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0 -10px;
	padding: 7px 10px;
	border-radius: 8px;
	color: var(--mm-text) !important;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
}

#zbmm .zbmm__link::after {
	content: "";
	flex: none;
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateX(-4px) rotate(-45deg);
	opacity: 0;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

#zbmm .zbmm__link:hover,
#zbmm .zbmm__link:focus-visible {
	background: var(--mm-tint);
	color: var(--mm-red-dark) !important;
}

#zbmm .zbmm__link:hover::after,
#zbmm .zbmm__link:focus-visible::after {
	opacity: 1;
	transform: translateX(0) rotate(-45deg);
}

#zbmm .zbmm__link[aria-current="page"] {
	background: var(--mm-tint);
	color: var(--mm-red) !important;
	font-weight: 700;
}

#zbmm .zbmm__link[aria-current="page"]::after {
	opacity: 1;
	transform: none;
	width: 7px;
	height: 7px;
	border: 0;
	border-radius: 50%;
	background: currentColor;
}

#zbmm a:focus-visible {
	outline: 2px solid var(--mm-red);
	outline-offset: 2px;
}

/* Side card: free quote and call */
#zbmm .zbmm__cta {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin: 16px;
	padding: 26px 24px 22px;
	border-radius: 14px;
	color: #fff;
	background:
		radial-gradient(120% 70% at 100% 0%, rgba(221, 0, 23, 0.55) 0%, rgba(221, 0, 23, 0) 60%),
		#16181b;
}

#zbmm .zbmm__cta-kicker {
	color: #ff8d98;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

#zbmm .zbmm__cta-title {
	margin-top: 8px;
	color: #fff;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
}

#zbmm .zbmm__cta-text {
	margin-top: 8px;
	color: rgba(255, 255, 255, 0.76);
	font-size: 14px;
	line-height: 1.5;
}

#zbmm .zbmm__cta-btns {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#zbmm .zbmm__btn,
.zbmm-m .zbmm__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 10px 16px;
	border-radius: 8px;
	border: 1px solid transparent;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	white-space: nowrap;
}

#zbmm .zbmm__btn--red,
.zbmm-m .zbmm__btn--red {
	background: var(--mm-red);
	color: #fff !important;
}

#zbmm .zbmm__btn--red:hover,
.zbmm-m .zbmm__btn--red:hover {
	background: var(--mm-red-dark);
	color: #fff !important;
}

#zbmm .zbmm__btn--ghost {
	border-color: rgba(255, 255, 255, 0.38);
	color: #fff !important;
}

#zbmm .zbmm__btn--ghost:hover {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.08);
	color: #fff !important;
}

#zbmm .zbmm__ico {
	width: 17px;
	height: 17px;
	fill: currentColor;
}

#zbmm .zbmm__all,
.zbmm-m .zbmm__all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	font-size: 14px;
	font-weight: 700;
}

#zbmm .zbmm__all {
	color: #fff !important;
	padding-top: 14px;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
}

#zbmm .zbmm__all:hover {
	color: #ff8d98 !important;
}

.zbmm__arrow {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.15s ease;
}

.zbmm__all:hover .zbmm__arrow {
	transform: translateX(3px);
}

/* Arabic */
#zbmm.zbmm--ar,
.zbmm-m--ar {
	direction: rtl;
	font-family: "Changa", sans-serif;
}

#zbmm.zbmm--ar .zbmm__link::after {
	transform: translateX(4px) rotate(135deg);
}

#zbmm.zbmm--ar .zbmm__link:hover::after,
#zbmm.zbmm--ar .zbmm__link:focus-visible::after {
	transform: translateX(0) rotate(135deg);
}

#zbmm.zbmm--ar .zbmm__link[aria-current="page"]::after {
	transform: none;
}

#zbmm.zbmm--ar .zbmm__cta {
	background:
		radial-gradient(120% 70% at 0% 0%, rgba(221, 0, 23, 0.55) 0%, rgba(221, 0, 23, 0) 60%),
		#16181b;
}

#zbmm.zbmm--ar .zbmm__cta-kicker {
	letter-spacing: 0;
}

.zbmm--ar .zbmm__arrow,
.zbmm-m--ar .zbmm__arrow {
	transform: scaleX(-1);
}

.zbmm--ar .zbmm__all:hover .zbmm__arrow,
.zbmm-m--ar .zbmm__all:hover .zbmm__arrow {
	transform: scaleX(-1) translateX(3px);
}

/* Smaller desktops: the quote card runs across the bottom */
@media (max-width: 1279px) {
	#zbmm .zbmm__inner {
		grid-template-columns: minmax(0, 1fr);
	}

	#zbmm .zbmm__cols {
		gap: 0 24px;
		padding: 24px 24px 4px;
	}

	#zbmm .zbmm__cta {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 14px 28px;
		margin: 0 16px 16px;
		padding: 20px 24px;
	}

	#zbmm .zbmm__cta-copy {
		flex: 1 1 320px;
	}

	#zbmm .zbmm__cta-title {
		font-size: 18px;
	}

	#zbmm .zbmm__cta-btns {
		flex-direction: row;
	}

	#zbmm .zbmm__all {
		margin-top: 0;
		padding-top: 0;
		border-top: 0;
	}
}

@media (max-width: 1080px) {
	#zbmm {
		display: none !important;
	}

	.zbmm-caret {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	#zbmm,
	#zbmm a,
	#zbmm .zbmm__link::after,
	.zbmm-caret,
	.zbmm__arrow {
		transition: none;
	}

	#zbmm {
		transform: none;
	}
}

/* ---------- Phone and tablet menu: the groups inside "Services" ---------- */

.mobile-menu .zbmm-m {
	margin: 4px 0 18px;
	padding: 18px 16px 16px;
	border-radius: 14px;
	background: var(--mm-soft);
	text-align: start;
}

.mobile-menu .zbmm-m.zbmm-m--ar {
	text-align: right;
}

.mobile-menu .zbmm-m .zbmm__cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 0 28px;
}

.mobile-menu .zbmm-m .zbmm__group {
	margin-bottom: 18px;
}

.mobile-menu .zbmm-m .zbmm__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-bottom: 8px;
	margin-bottom: 2px;
	border-bottom: 1px solid #e3e4e7;
}

.mobile-menu .zbmm-m .zbmm__thumb {
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border-radius: 10px;
	display: block;
}

.mobile-menu .zbmm-m p {
	margin: 0;
}

.mobile-menu .zbmm-m .zbmm__title {
	color: var(--mm-ink);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
}

.mobile-menu .zbmm-m .zbmm__note {
	color: var(--mm-muted);
	font-size: 12.5px;
	line-height: 1.35;
}

.mobile-menu .zbmm-m ul {
	display: block;
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: inherit;
}

.mobile-menu .zbmm-m ul li {
	margin: 0;
	padding: 0;
}

.mobile-menu .zbmm-m .zbmm__link {
	display: block;
	padding: 10px 2px;
	border-bottom: 1px solid #e9eaed;
	color: var(--mm-text) !important;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	text-align: inherit;
	text-decoration: none;
}

.mobile-menu .zbmm-m li:last-child .zbmm__link {
	border-bottom: 0;
}

.mobile-menu .zbmm-m .zbmm__link[aria-current="page"] {
	color: var(--mm-red) !important;
	font-weight: 700;
}

.mobile-menu .zbmm-m .zbmm-m__foot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding-top: 4px;
}

.mobile-menu .zbmm-m .zbmm__btn--red {
	width: 100%;
	max-width: 360px;
	padding: 12px 16px;
	border-bottom: 0;
	color: #fff !important;
	font-size: 15px;
}

.mobile-menu .zbmm-m .zbmm__all {
	padding: 6px 0;
	border-bottom: 0;
	color: var(--mm-red) !important;
	font-size: 15px;
}
