/**
 * Navbar layout – consistent on all pages (desktop + mobile).
 */

/* Mobile / tablet: keep flex row (logo + hamburger); overrides style.min #Lang_ar { display:block } */
@media (max-width: 991px) {
	.custom_navbar,
	#Lang_ar .custom_navbar,
	#Lang_en .custom_navbar {
		display: flex !important;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		min-height: 46px;
		height: auto;
		padding-block: 0;
		position: relative;
		gap: 8px;
	}

	.custom_navbar .site-branding,
	.custom_navbar .site-logo {
		flex: 0 1 auto;
		min-width: 0;
		position: relative;
		top: auto;
		left: auto;
		right: auto;
	}

	.custom_navbar .site-logo .custom-logo-link img,
	.custom_navbar .site-logo .custom-logo-link img.custom-logo {
		width: auto;
		max-width: min(165px, 42vw);
		height: auto;
	}

	.custom_navbar__actions {
		display: flex;
		flex-direction: row;
		align-items: center;
		flex: 0 0 auto;
		gap: 2px;
		margin-inline-start: auto;
		position: relative;
		z-index: 100003;
	}

	#Lang_ar .custom_navbar__actions,
	#Lang_en .custom_navbar__actions {
		margin-inline-start: auto;
		margin-inline-end: 0;
	}

	.custom_navbar #site-navigation.primary-navigation {
		flex: 0 0 auto;
		position: static !important;
		width: 0 !important;
		height: 0 !important;
		margin: 0 !important;
		overflow: visible !important;
	}

	.custom_navbar__actions .menu-button-container,
	.custom_navbar .menu-button-container {
		display: flex !important;
		align-items: center;
		position: relative !important;
		right: auto !important;
		left: auto !important;
		padding: 0 !important;
		background: transparent !important;
	}

	.custom_navbar__actions .search_for_mobile,
	.custom_navbar .search_for_mobile {
		position: relative !important;
		top: auto !important;
		right: auto !important;
		left: auto !important;
		flex: 0 0 auto;
		display: block !important;
	}

	#Lang_ar .custom_navbar__actions .search_for_mobile,
	#Lang_ar .custom_navbar .search_for_mobile {
		left: auto !important;
		right: auto !important;
		text-align: inherit;
	}

	.custom_navbar__actions .menu-button-container button#primary-mobile-menu .dropdown-icon.open,
	.custom_navbar .menu-button-container button#primary-mobile-menu .dropdown-icon.open {
		display: inline-flex !important;
	}

	.custom_navbar__actions .menu-button-container button#primary-mobile-menu .dropdown-icon.close,
	.custom_navbar .menu-button-container button#primary-mobile-menu .dropdown-icon.close {
		display: none !important;
	}

	.custom_navbar__actions .menu-button-container button#primary-mobile-menu[aria-expanded="true"] .dropdown-icon.open,
	.custom_navbar .menu-button-container button#primary-mobile-menu[aria-expanded="true"] .dropdown-icon.open {
		display: none !important;
	}

	.custom_navbar__actions .menu-button-container button#primary-mobile-menu[aria-expanded="true"] .dropdown-icon.close,
	.custom_navbar .menu-button-container button#primary-mobile-menu[aria-expanded="true"] .dropdown-icon.close {
		display: inline-flex !important;
	}

	.custom_navbar__actions .menu-button-container button#primary-mobile-menu .dropdown-icon .svg-icon,
	.custom_navbar .menu-button-container button#primary-mobile-menu .dropdown-icon .svg-icon {
		display: block;
		width: 24px;
		height: 24px;
		fill: currentColor;
	}
}

/* Desktop: logo left, menu items right (matches site design) */
@media (min-width: 992px) {
	.custom_navbar,
	#Lang_ar .custom_navbar,
	#Lang_en .custom_navbar {
		display: flex !important;
		justify-content: space-between;
		align-items: center;
		padding-block: 22px;
		width: 100%;
		height: auto;
		position: relative;
	}

	.custom_navbar .site-branding,
	.custom_navbar .site-logo {
		flex: 0 0 auto;
		margin: 0;
		position: relative;
		top: auto;
		left: auto;
		right: auto;
	}

	.custom_navbar .site-logo .custom-logo-link {
		display: inline-block;
		line-height: 0;
	}

	.custom_navbar .site-logo .custom-logo-link img,
	.custom_navbar .site-logo .custom-logo-link img.custom-logo {
		width: 275px;
		max-width: 275px;
		height: auto;
	}

	.custom_navbar #site-navigation,
	.custom_navbar #site-navigation.primary-navigation {
		flex: 0 1 auto;
		margin-left: auto;
		margin-right: 0;
		position: relative;
		width: auto;
	}

	#Lang_ar .custom_navbar #site-navigation {
		margin-left: 0;
		margin-right: auto;
	}

	.custom_navbar .primary-navigation > .primary-menu-container {
		position: relative;
		visibility: visible;
		opacity: 1;
		transform: none;
		height: auto;
		overflow: visible;
		background: transparent;
		padding: 0;
	}

	.custom_navbar #site-navigation .menu-wrapper,
	.custom_navbar .primary-navigation > div > .menu-wrapper {
		display: flex !important;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: flex-end;
		column-gap: 28px;
		row-gap: 0;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	#Lang_ar .custom_navbar #site-navigation .menu-wrapper {
		justify-content: flex-start;
	}

	.custom_navbar #site-navigation .menu-wrapper > .menu-item {
		display: flex !important;
		align-items: center;
		width: auto !important;
		margin: 0;
		position: relative;
		border: none;
	}

	.custom_navbar #site-navigation .menu-wrapper .menu-item a {
		display: inline-block;
		color: #fff;
		font-size: 15px;
		font-weight: 300;
		letter-spacing: 0.5px;
		padding: 0;
		border: none;
		white-space: nowrap;
		text-decoration: none;
	}

	.custom_navbar #site-navigation .menu-wrapper .menu-item a::before {
		content: "";
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		width: 0;
		height: 1px;
		bottom: -10px;
		background-color: #fff;
		transition: width 0.25s ease-in-out;
	}

	.custom_navbar #site-navigation .menu-wrapper .menu-item a:hover::before,
	.custom_navbar #site-navigation .menu-wrapper .menu-item.current-menu-item > a::before,
	.custom_navbar #site-navigation .menu-wrapper .menu-item.current-menu-ancestor > a::before {
		width: 100%;
	}

	.custom_navbar #site-navigation .menu-item button.sub-menu-toggle {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		background: transparent;
		border: 0;
		width: 20px;
		height: 20px;
		padding: 0;
		margin-inline-start: 4px;
		position: relative;
		right: auto;
		line-height: 1;
	}

	.custom_navbar #site-navigation .menu-item button.sub-menu-toggle::before {
		content: "\f078";
		font-family: "Font Awesome 6 Free";
		font-weight: 900;
		font-size: 12px;
		color: #fff;
	}

	.custom_navbar #site-navigation .menu-item button.sub-menu-toggle span.icon-plus,
	.custom_navbar #site-navigation .menu-item button.sub-menu-toggle span.icon-minus {
		display: none !important;
	}

	.custom_navbar .search_for_mobile {
		display: none !important;
	}

	.custom_navbar .menu-button-container {
		display: none !important;
	}
}

@media (min-width: 992px) and (max-width: 1370px) {
	.custom_navbar .site-logo .custom-logo-link img,
	.custom_navbar .site-logo .custom-logo-link img.custom-logo {
		width: 230px;
		max-width: 230px;
	}

	.custom_navbar #site-navigation .menu-wrapper {
		column-gap: 22px;
	}
}

@media (min-width: 992px) and (max-width: 1199px) {
	.custom_navbar #site-navigation .menu-wrapper {
		column-gap: 18px;
	}

	.custom_navbar #site-navigation .menu-wrapper .menu-item a {
		font-size: 14px;
	}
}

/* Language switcher: flag + label on one line */
.custom_navbar #site-navigation .menu-wrapper > li.menu-item-language > a {
	display: inline-flex !important;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 0.4em;
	white-space: nowrap;
	line-height: 1.2;
}

.custom_navbar #site-navigation .menu-wrapper li.menu-item-language .wpml-ls-flag {
	display: inline-block;
	width: 18px;
	height: auto;
	max-width: none;
	flex: 0 0 auto;
	margin: 0;
	vertical-align: middle;
}

.custom_navbar #site-navigation .menu-wrapper li.menu-item-language .wpml-ls-native {
	display: inline !important;
	white-space: nowrap;
}

/* Hide secondary WPML label (e.g. translated name in parentheses) in navbar */
.custom_navbar #site-navigation .menu-wrapper li.menu-item-language .wpml-ls-display {
	display: none !important;
}

#Lang_ar .custom_navbar #site-navigation .menu-wrapper li.menu-item-language .wpml-ls-flag + .wpml-ls-native {
	margin-right: 0;
	margin-left: 0;
}

.custom_navbar #site-navigation .menu-wrapper li.menu-item-language .sub-menu a {
	display: inline-flex !important;
	align-items: center;
	gap: 0.4em;
}

.custom_navbar #site-navigation .menu-wrapper li.menu-item-language .sub-menu .wpml-ls-flag {
	display: inline-block;
	width: 18px;
	height: auto;
	flex: 0 0 auto;
}
