/* Menu Simple et Responsive */
/* Supports both structures: header and .simple-header */
header,
.simple-header {
	background: #fff;
	border-bottom: 1px solid #ddd;
	padding: 15px 20px;
	position: sticky;
	top: 0;
	z-index: 10000;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	display: block !important;
	visibility: visible !important;
	overflow: visible !important;
	box-sizing: border-box !important;
}

header > div,
.simple-header-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	overflow: visible !important;
	box-sizing: border-box !important;
	padding: 0 20px !important;
}

header a[href="/"],
.simple-logo {
	font-size: 1.5rem;
	font-weight: 700;
	color: #27aae1;
	text-decoration: none;
	display: inline-block;
	white-space: nowrap;
}

header a[href="/"]:hover,
.simple-logo:hover {
	color: #1a8bc4;
}

header button,
.simple-mobile-toggle {
	display: none;
	font-size: 28px;
	cursor: pointer;
	border: none;
	background: none;
	padding: 8px 12px;
	color: #333;
	line-height: 1;
}

header button:hover,
.simple-mobile-toggle:hover {
	color: #27aae1;
}

header nav,
.simple-header nav {
	flex: 1;
	display: block;
	visibility: visible;
	overflow: visible;
}

/* Main menu list */
header nav > ul,
.simple-nav {
	display: flex !important;
	list-style: none !important;
	margin: 0;
	padding: 0;
	gap: 5px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

header nav > ul > li,
.simple-nav > li {
	position: relative;
	list-style: none !important;
}

header nav > ul > li > a,
.simple-nav > li > a {
	text-decoration: none;
	color: #333;
	font-weight: 500;
	padding: 10px 15px;
	display: block;
	white-space: nowrap;
}

header nav > ul > li > a:hover,
.simple-nav > li > a:hover {
	color: #27aae1;
}

/* Arrow for items with submenu (new structure) */
header nav > ul > li.has-submenu > a::after {
	content: " ▼";
	font-size: 0.7em;
	margin-left: 5px;
}

/* Submenus - HIDDEN by default */
header nav ul ul,
.simple-nav ul,
.simple-nav .submenu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: auto;
	background: #fff;
	box-shadow: 0 4px 15px rgba(0,0,0,0.15);
	list-style: none !important;
	margin: 0;
	padding: 8px 0;
	min-width: 220px;
	z-index: 10001;
	flex-direction: column;
}

/* Show submenu on hover */
header nav > ul > li.has-submenu:hover > ul,
header nav > ul > li:hover > ul,
.simple-nav > li:hover > ul,
.simple-nav > li:hover > .submenu {
	display: block !important;
}

header nav ul ul li,
.simple-nav ul li,
.simple-nav .submenu li {
	width: 100%;
	list-style: none !important;
}

header nav ul ul a,
.simple-nav ul a,
.simple-nav .submenu a {
	padding: 10px 20px;
	white-space: nowrap;
	display: block;
	color: #333;
	text-decoration: none;
}

header nav ul ul a:hover,
.simple-nav ul a:hover,
.simple-nav .submenu a:hover {
	background-color: #f5f5f5;
	color: #27aae1;
}

/* ==================== Force LTR for Menu (even on RTL pages) ==================== */
header,
.simple-header,
header > div,
.simple-header-inner,
header nav,
.simple-header nav,
header nav ul,
header nav ul ul,
header nav ul li,
.simple-nav,
.simple-nav li,
.simple-nav ul,
.simple-nav .submenu,
.simple-nav .submenu li,
.simple-nav .submenu a,
.simple-nav ul li,
.simple-nav ul a {
	direction: ltr !important;
	text-align: left !important;
}

/* Force consistent max-width for header */
header > div,
.simple-header-inner {
	max-width: 1200px !important;
	margin: 0 auto !important;
	padding: 0 20px !important;
}

/* Force submenu to be LTR positioned */
header nav ul ul,
.simple-nav ul,
.simple-nav .submenu {
	left: 0 !important;
	right: auto !important;
}

/* ==================== Mobile ==================== */
@media (max-width: 768px) {
	header > div,
	.simple-header-inner {
		flex-wrap: wrap;
		justify-content: space-between;
	}
	
	/* Logo on the left */
	header a[href="/"],
	.simple-logo {
		order: 1;
		flex: 1;
	}
	
	/* Burger button on the right */
	header button,
	.simple-mobile-toggle {
		display: block !important;
		order: 2;
		flex-shrink: 0;
	}
	
	/* Nav hidden by default, takes full width when shown */
	header nav,
	.simple-header nav {
		display: none !important;
		width: 100%;
		order: 3;
	}
	
	/* Show nav when menu is active */
	header nav.active,
	.simple-header nav.active {
		display: block !important;
	}
	
	/* Main menu hidden by default on mobile */
	header nav > ul,
	.simple-nav {
		display: none !important;
		flex-direction: column;
		width: 100%;
		margin-top: 15px;
		background: #fff;
		border-top: 1px solid #eee;
		padding-top: 10px;
		gap: 0;
	}
	
	/* Show menu when active */
	header nav > ul.active,
	.simple-nav.active {
		display: flex !important;
	}
	
	header nav > ul > li,
	.simple-nav > li {
		width: 100%;
		border-bottom: 1px solid #f0f0f0;
	}
	
	header nav > ul > li:last-child,
	.simple-nav > li:last-child {
		border-bottom: none;
	}
	
	header nav > ul > li > a,
	.simple-nav > li > a {
		padding: 15px 20px;
		width: 100%;
	}
	
	/* Submenus on mobile */
	header nav ul ul,
	.simple-nav ul,
	.simple-nav .submenu {
		position: static !important;
		box-shadow: none;
		padding: 0;
		margin: 0;
		background: #f9f9f9;
		display: none;
		min-width: 100%;
	}
	
	/* Disable hover on mobile - use click instead */
	header nav > ul > li.has-submenu:hover > ul,
	header nav > ul > li:hover > ul,
	.simple-nav > li:hover > ul,
	.simple-nav > li:hover > .submenu {
		display: none;
	}
	
	/* Show submenu when clicked (submenu-open class added by JS) */
	header nav > ul > li.submenu-open > ul,
	.simple-nav > li.submenu-open > ul,
	.simple-nav > li.submenu-open > .submenu {
		display: flex !important;
		flex-direction: column;
	}
	
	header nav ul ul a,
	.simple-nav ul a,
	.simple-nav .submenu a {
		padding: 12px 40px;
		font-size: 0.95em;
	}
	
}
