/* =========================================================
   Custom Mega Menu Widget - Estilos
   ========================================================= */

.cmw-menu-wrap {
	position: relative;
	width: 100%;
}

/* ---------- DESKTOP ---------- */

.cmw-desktop-menu {
	display: block;
}

.cmw-menu-list {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 32px;
}

.cmw-menu-item {
	position: relative;
}

.cmw-menu-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: #1a1a1a;
	cursor: pointer;
	line-height: 1.4;
	background: none;
	border: none;
	padding: 8px 0;
}

.cmw-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.25s ease;
}

/* Painel do submenu */
.cmw-submenu-panel {
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: 12px;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 100;
	min-width: 480px;
}

/* Área invisível que conecta o item do menu ao painel, evitando que o
   submenu feche ao mover o mouse pelo pequeno espaço entre os dois. */
.cmw-submenu-panel::before {
	content: "";
	position: absolute;
	top: -12px;
	left: 0;
	right: 0;
	height: 12px;
}

/* Abre no HOVER (comportamento principal no desktop) */
.cmw-menu-item.has-submenu:hover > .cmw-submenu-panel,
.cmw-menu-item.has-submenu:focus-within > .cmw-submenu-panel,
.cmw-menu-item.cmw-open > .cmw-submenu-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.cmw-menu-item.has-submenu:hover > .cmw-menu-link .cmw-arrow,
.cmw-menu-item.has-submenu:focus-within > .cmw-menu-link .cmw-arrow,
.cmw-menu-item.cmw-open > .cmw-menu-link .cmw-arrow {
	transform: rotate(180deg);
}

.cmw-submenu-inner {
	display: flex;
	align-items: stretch;
	gap: 24px;
	padding: 28px;
}

.cmw-submenu-list {
	list-style: none;
	margin: 0;
	padding: 0;
	flex: 1 1 auto;
	min-width: 200px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.cmw-submenu-list a {
	text-decoration: none;
	color: #1a1a1a;
	white-space: nowrap;
	transition: color 0.15s ease;
}

.cmw-submenu-list a:hover {
	color: #d6006c;
}

/* Card de informação adicional */
.cmw-submenu-info {
	flex: 0 0 280px;
	width: 280px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cmw-info-image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 12px;
	object-fit: cover;
	aspect-ratio: 16 / 10;
}

.cmw-info-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
}

.cmw-info-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #6b6b6b;
}

.cmw-info-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 4px;
	padding: 12px 20px;
	background-color: #0a1f44;
	color: #ffffff;
	text-decoration: none;
	border-radius: 8px;
	font-weight: 500;
	text-align: center;
	transition: opacity 0.15s ease;
}

.cmw-info-btn:hover {
	opacity: 0.85;
}

/* Botão/ícone mobile escondidos no desktop (!important blinda contra CSS
   do tema ou de outros plugins que tenham prioridade maior) */
.cmw-mobile-toggle,
.cmw-mobile-menu,
.cmw-mobile-overlay {
	display: none !important;
}

/* ---------- MOBILE ---------- */

@media (max-width: 1024px) {

	.cmw-desktop-menu {
		display: none !important;
	}

	.cmw-mobile-toggle {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		background: none;
		border: none;
		cursor: pointer;
		color: #0a1f44;
		font-size: 28px;
		padding: 0;
		line-height: 1;
	}

	.cmw-mobile-toggle svg,
	.cmw-mobile-toggle i {
		width: 1em;
		height: 1em;
		font-size: inherit;
	}

	.cmw-mobile-overlay {
		display: block !important;
		position: fixed;
		inset: 0;
		background: rgba(10, 10, 10, 0.35);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.25s ease, visibility 0.25s ease;
		z-index: 998;
	}

	.cmw-mobile-menu {
		display: block !important;
		position: fixed;
		top: 0;
		right: 0;
		width: 88%;
		max-width: 380px;
		height: 100%;
		background: #fbf8f3;
		z-index: 999;
		padding: 24px;
		box-sizing: border-box;
		overflow-y: auto;
		transform: translateX(100%);
		transition: transform 0.3s ease;
	}

	.cmw-menu-wrap.cmw-mobile-active .cmw-mobile-menu {
		transform: translateX(0);
	}

	.cmw-menu-wrap.cmw-mobile-active .cmw-mobile-overlay {
		opacity: 1;
		visibility: visible;
	}

	.cmw-mobile-close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		margin-left: auto;
		margin-bottom: 24px;
		background-color: #0a1f44;
		color: #ffffff;
		border: none;
		border-radius: 6px;
		cursor: pointer;
		font-size: 16px;
	}

	.cmw-mobile-close svg,
	.cmw-mobile-close i {
		width: 1em;
		height: 1em;
	}

	.cmw-mobile-list {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.cmw-mobile-item {
		border-bottom: 1px solid #e4dfd6;
	}

	.cmw-mobile-item-header {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: none;
		border: none;
		cursor: pointer;
		padding: 16px 0;
		text-align: left;
	}

	.cmw-mobile-label {
		font-weight: 600;
		font-size: 16px;
		color: #0a1f44;
	}

	.cmw-mobile-link {
		display: block;
		padding: 16px 0;
		text-decoration: none;
		font-weight: 600;
		font-size: 16px;
		color: #0a1f44;
	}

	.cmw-mobile-arrow {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		transition: transform 0.25s ease;
		color: #0a1f44;
	}

	.cmw-mobile-item.cmw-mobile-open > .cmw-mobile-item-header .cmw-mobile-arrow {
		transform: rotate(180deg);
	}

	.cmw-mobile-submenu {
		list-style: none;
		margin: 0;
		padding: 0 0 12px 0;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease;
	}

	.cmw-mobile-submenu li a {
		display: block;
		padding: 10px 0 10px 12px;
		text-decoration: none;
		color: #4a4a4a;
		font-size: 15px;
	}

	/* Impede rolagem do body quando o menu mobile está aberto */
	body.cmw-no-scroll {
		overflow: hidden;
	}
}
