/**
 * Mega Menu Styles
 * Responsive mega menu for both desktop and mobile
 * Compatible with Bootstrap
 */

/* Desktop Mega Menu */
.mega-menu-container {
	position: relative;
}

.mega-menu {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mega-menu > .menu-item {
	position: relative;
}

.mega-menu > .menu-item > a {
	display: block;
	padding: 1rem 1.5rem;
	color: #333;
	text-decoration: none;
	font-weight: 500;
	transition: color 0.3s ease;
}

.mega-menu > .menu-item > a:hover {
	color: #007cba;
}

/* Mega Menu Content */
.mega-menu-item {
	position: static;
}

.mega-menu-content {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-top: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	z-index: 1000;
	padding: 2rem;
	display: none;
	opacity: 0;
	transform: translateY(-10px);
	transition: all 0.3s ease;
}

.mega-menu-item:hover .mega-menu-content,
.mega-menu-item:focus-within .mega-menu-content {
	display: block;
	opacity: 1;
	transform: translateY(0);
}

/* Mega Menu Submenu */
.mega-menu-submenu {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mega-menu-column {
	flex: 1;
	min-width: 200px;
}

.mega-menu-column > a {
	display: block;
	font-weight: 600;
	color: #333;
	text-decoration: none;
	padding: 0.5rem 0;
	margin-bottom: 1rem;
	border-bottom: 2px solid #007cba;
}

.mega-menu-column > a:hover {
	color: #007cba;
}

.mega-menu-column ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mega-menu-column ul li {
	margin-bottom: 0.5rem;
}

.mega-menu-column ul li a {
	color: #666;
	text-decoration: none;
	transition: color 0.3s ease;
}

.mega-menu-column ul li a:hover {
	color: #007cba;
}

/* Column Width Classes */
.mega-menu-column-full {
	flex: 1 1 100%;
}

.mega-menu-column-half {
	flex: 1 1 calc(50% - 1rem);
}

.mega-menu-column-third {
	flex: 1 1 calc(33.333% - 1.33rem);
}

.mega-menu-column-quarter {
	flex: 1 1 calc(25% - 1.5rem);
}

/* Search and Language Switcher */
.mega-menu-search,
.mega-menu-language-switcher {
	margin-left: 1rem;
}

.mega-menu-search-form {
	display: flex;
	align-items: center;
}

.mega-menu-search-field {
	padding: 0.5rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	margin-right: 0.5rem;
}

.mega-menu-search-submit {
	background: #007cba;
	color: white;
	border: none;
	padding: 0.5rem;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.3s ease;
}

.mega-menu-search-submit:hover {
	background: #005a87;
}

.mega-menu-language-switcher select {
	padding: 0.5rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: white;
}

/* Mobile Mega Menu */
@media (max-width: 991.98px) {
	.mega-menu {
		flex-direction: column;
		width: 100%;
	}
	
	.mega-menu > .menu-item > a {
		padding: 1rem;
		border-bottom: 1px solid #eee;
	}
	
	.mega-menu-content {
		position: static;
		box-shadow: none;
		border: none;
		border-top: 1px solid #eee;
		padding: 1rem;
		display: none;
		opacity: 1;
		transform: none;
	}
	
	.mega-menu-item.active .mega-menu-content {
		display: block;
	}
	
	.mega-menu-submenu {
		flex-direction: column;
		gap: 1rem;
	}
	
	.mega-menu-column {
		min-width: auto;
	}
	
	.mega-menu-column > a {
		border-bottom: 1px solid #eee;
		margin-bottom: 0.5rem;
	}
	
	.mega-menu-column ul {
		margin-left: 1rem;
	}
	
	.mega-menu-column ul li a {
		padding: 0.5rem 0;
	}
	
	/* Mobile Toggle */
	.mega-menu-toggle {
		display: block;
		background: none;
		border: none;
		padding: 0.5rem;
		cursor: pointer;
	}
	
	.mega-menu-toggle-icon {
		display: block;
		width: 20px;
		height: 2px;
		background: #333;
		position: relative;
		transition: all 0.3s ease;
	}
	
	.mega-menu-toggle-icon::before,
	.mega-menu-toggle-icon::after {
		content: '';
		position: absolute;
		width: 20px;
		height: 2px;
		background: #333;
		transition: all 0.3s ease;
	}
	
	.mega-menu-toggle-icon::before {
		top: -6px;
	}
	
	.mega-menu-toggle-icon::after {
		bottom: -6px;
	}
	
	.mega-menu-item.active .mega-menu-toggle-icon {
		background: transparent;
	}
	
	.mega-menu-item.active .mega-menu-toggle-icon::before {
		transform: rotate(45deg);
		top: 0;
	}
	
	.mega-menu-item.active .mega-menu-toggle-icon::after {
		transform: rotate(-45deg);
		bottom: 0;
	}
	
	/* Mobile Search and Language */
	.mega-menu-search,
	.mega-menu-language-switcher {
		margin: 1rem 0;
		width: 100%;
	}
	
	.mega-menu-search-form {
		width: 100%;
	}
	
	.mega-menu-search-field {
		flex: 1;
	}
}

/* Overlay for mobile */
.mega-menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 999;
	display: none;
}

.mega-menu-overlay.active {
	display: block;
}

/* Animation Classes */
.mega-menu-fade-in {
	animation: megaMenuFadeIn 0.3s ease forwards;
}

.mega-menu-fade-out {
	animation: megaMenuFadeOut 0.3s ease forwards;
}

@keyframes megaMenuFadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes megaMenuFadeOut {
	from {
		opacity: 1;
		transform: translateY(0);
	}
	to {
		opacity: 0;
		transform: translateY(-10px);
	}
}

/* Accessibility */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Focus styles */
.mega-menu a:focus,
.mega-menu-toggle:focus {
	outline: 2px solid #007cba;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.mega-menu-content {
		border: 2px solid #000;
	}
	
	.mega-menu > .menu-item > a {
		border: 1px solid transparent;
	}
	
	.mega-menu > .menu-item > a:hover {
		border-color: #000;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.mega-menu-content,
	.mega-menu-toggle-icon {
		transition: none;
	}
	
	.mega-menu-fade-in,
	.mega-menu-fade-out {
		animation: none;
	}
} 