/**
 * Depilart Menu — desktop horizontal com mega submenu + drawer mobile.
 */

.depilart-menu,
.depilart-menu *,
.depilart-menu *::before,
.depilart-menu *::after {
	box-sizing: border-box;
}

.depilart-menu {
	position: relative;
	width: 100%;
	font-family: var(--global-font-family);
	color: #111827;
}

.screen-reader-text {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* =========================================
   Hambúrguer (mobile)
   ========================================= */
.depilart-menu__burger {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--wp--preset--color--primary, #614d76);
	background: transparent;
	border: 1px solid #e5e7eb;
	border-radius: 9999px;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

.depilart-menu__burger:hover {
	background: #f3f4f6;
	border-color: #d1d5db;
}

.depilart-menu__burger:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(97, 77, 118, 0.12);
}

/* =========================================
   Desktop horizontal
   ========================================= */
.depilart-menu__desktop {
	width: 100%;
}

.depilart-menu__list {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
	justify-content: center;
	width: min(1180px, calc(100% - 32px));
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

.depilart-menu__item {
	position: static;
	display: inline-flex;
	align-items: center;
	margin: 0;
}

.depilart-menu__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	font-size: 0.855rem;
	font-weight: 700;
	color: #111827;
	background: transparent;
	border: 0;
	text-decoration: none;
	border-radius: 9999px;
	cursor: pointer;
	transition: color 0.18s ease;
}

.depilart-menu__link:hover,
.depilart-menu__link:focus-visible {
	color: var(--wp--preset--color--primary, #614d76);
	outline: none;
}

.depilart-menu__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	padding: 0;
	color: #6b7280;
	background: transparent;
	border: 0;
	transition: color 0.18s ease;
}

.depilart-menu__item--has-children:hover > .depilart-menu__toggle,
.depilart-menu__item--has-children:focus-within > .depilart-menu__toggle,
.depilart-menu__item--has-children.is-open > .depilart-menu__toggle,
.depilart-menu__expand:hover .depilart-menu__toggle,
.depilart-menu__expand:focus-visible .depilart-menu__toggle,
.depilart-menu__expand[aria-expanded="true"] .depilart-menu__toggle {
	color: var(--wp--preset--color--primary, #614d76);
}

.depilart-menu__toggle svg {
	transition: transform 0.2s ease;
}

.depilart-menu__item--has-children:hover > .depilart-menu__toggle svg,
.depilart-menu__item--has-children:focus-within > .depilart-menu__toggle svg,
.depilart-menu__item--has-children.is-open > .depilart-menu__toggle svg,
.depilart-menu__item--has-children:hover > .depilart-menu__expand .depilart-menu__toggle svg,
.depilart-menu__item--has-children:focus-within > .depilart-menu__expand .depilart-menu__toggle svg,
.depilart-menu__expand[aria-expanded="true"] .depilart-menu__toggle svg {
	transform: rotate(180deg);
}

/* =========================================
   Mega panel (submenu full-width)
   ========================================= */
.depilart-menu__megapanel {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-8px);
	width: 100%;
	max-width: 100%;
	padding: 0;
	background: #ffffff;
	border-top: 1px solid #ececef;
	box-shadow: 0 16px 32px rgba(17, 24, 39, 0.08);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 40;
}

.depilart-menu__item--has-children:hover > .depilart-menu__megapanel,
.depilart-menu__item--has-children:focus-within > .depilart-menu__megapanel,
.depilart-menu__item--has-children.is-open > .depilart-menu__megapanel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

.depilart-menu__megapanel[aria-hidden="false"] {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

.depilart-menu__megapanel-inner {
	width: min(1180px, calc(100% - 32px));
	margin: 0 auto;
	padding: 24px 0 28px;
}

.depilart-menu__megapanel .sub-menu {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 6px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.depilart-menu__megapanel .sub-menu li {
	margin: 0;
}

.depilart-menu__megapanel .sub-menu a {
	display: block;
	padding: 10px 12px;
	font-size: 0.855rem;
	font-weight: 500;
	color: #111827;
	text-decoration: none;
	border-radius: 10px;
	transition: color 0.14s ease;
}

.depilart-menu__megapanel .sub-menu a:hover,
.depilart-menu__megapanel .sub-menu a:focus-visible {
	color: var(--wp--preset--color--primary, #614d76);
	outline: none;
}

/* =========================================
   Drawer mobile (oculto por padrão)
   ========================================= */
.depilart-menu__overlay,
.depilart-menu__drawer {
	display: none;
}

/* =========================================
   Breakpoint mobile
   ========================================= */
@media (max-width: 860px) {

	.depilart-menu__burger {
		display: inline-flex;
	}

	.depilart-menu__desktop {
		display: none;
	}

	.depilart-menu__overlay {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(17, 24, 39, 0.45);
		opacity: 0;
		transition: opacity 0.25s ease;
		z-index: 998;
	}

	.depilart-menu__overlay[hidden] {
		display: none;
	}

	.depilart-menu.is-open .depilart-menu__overlay {
		opacity: 1;
	}

	.depilart-menu__drawer {
		display: flex;
		flex-direction: column;
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: min(340px, 88vw);
		background: #ffffff;
		box-shadow: 12px 0 32px rgba(17, 24, 39, 0.12);
		transform: translateX(-100%);
		transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
		z-index: 999;
		overflow: hidden;
	}

	.admin-bar .depilart-menu__overlay {
		top: 46px;
	}

	.admin-bar .depilart-menu__drawer {
		top: 46px;
	}

	.depilart-menu__drawer[hidden] {
		display: none;
	}

	.depilart-menu.is-open .depilart-menu__drawer {
		transform: translateX(0);
	}

	/* Header do drawer */
	.depilart-menu__drawer-header {
		padding: 16px 18px 14px;
		border-bottom: 1px solid #ececef;
		background: #ffffff;
	}

	.depilart-menu__drawer-row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
	}

	.depilart-menu__drawer-row--top {
		margin-bottom: 14px;
	}

	.depilart-menu__drawer-row--bottom {
		align-items: flex-start;
		flex-direction: column;
	}

	.depilart-menu__drawer-logo {
		display: flex;
		align-items: center;
		min-width: 0;
	}

	.depilart-menu__drawer-logo img,
	.depilart-menu__drawer-logo .custom-logo {
		max-width: 140px;
		height: auto;
	}

	.depilart-menu__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
		color: #111827;
		background: #f3f4f6;
		border: 0;
		border-radius: 9999px;
		cursor: pointer;
		transition: background-color 0.18s ease, color 0.18s ease;
	}

	.depilart-menu__close:hover {
		background: #e5e7eb;
		color: var(--wp--preset--color--primary, #614d76);
	}

	.depilart-menu__close:focus-visible {
		outline: none;
		box-shadow: 0 0 0 4px rgba(97, 77, 118, 0.12);
	}

	.depilart-menu__drawer-title {
		font-size: 0.8rem;
		font-weight: 700;
		letter-spacing: 0.08em;
		color: #6b7280;
	}

	.depilart-menu__drawer-login {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		min-height: 40px;
		padding: 0 16px;
		font-size: 0.9rem;
		font-weight: 700;
		color: var(--wp--preset--color--primary, #614d76);
		text-decoration: none;
		background: #ffffff;
		border: 1px solid currentColor;
		border-radius: 9999px;
		transition: background-color 0.18s ease, color 0.18s ease;
	}

	.depilart-menu__drawer-login:hover,
	.depilart-menu__drawer-login:focus-visible {
		background: var(--wp--preset--color--primary, #614d76);
		color: #ffffff;
		outline: none;
	}

	/* Lista mobile */
	.depilart-menu__drawer-body {
		flex: 1 1 auto;
		overflow-y: auto;
		padding: 8px 10px 24px;
	}

	.depilart-menu__mobile-list,
	.depilart-menu__mobile-list .sub-menu {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.depilart-menu__mobile-list li {
		margin: 0;
		border-bottom: 1px solid #f3f4f6;
	}

	.depilart-menu__mobile-list li:last-child {
		border-bottom: 0;
	}

	.depilart-menu__mobile-row {
		display: flex;
		align-items: center;
		gap: 8px;
	}

	.depilart-menu__mobile-list a,
	.depilart-menu__mobile-list button {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex: 1 1 auto;
		width: 100%;
		padding: 14px 12px;
		font-size: 0.9rem;
		font-weight: 600;
		color: #111827;
		background: transparent;
		border: 0;
		text-decoration: none;
		border-radius: 10px;
		cursor: pointer;
		transition: color 0.14s ease;
	}

	.depilart-menu__mobile-list a:hover,
	.depilart-menu__mobile-list a:focus-visible,
	.depilart-menu__mobile-list button:hover,
	.depilart-menu__mobile-list button:focus-visible {
		color: var(--wp--preset--color--primary, #614d76);
		outline: none;
	}

	.depilart-menu__mobile-list .sub-menu {
		display: none;
		padding-left: 14px;
		margin-bottom: 6px;
	}

	.depilart-menu__mobile-item--has-children.is-open > .sub-menu {
		display: block;
	}

	.depilart-menu__mobile-list .sub-menu a {
		font-size: 0.855rem;
		font-weight: 500;
		color: #374151;
	}

	.depilart-menu__mobile-expand:hover .depilart-menu__toggle,
	.depilart-menu__mobile-expand:focus-visible .depilart-menu__toggle,
	.depilart-menu__mobile-expand[aria-expanded="true"] .depilart-menu__toggle {
		color: var(--wp--preset--color--primary, #614d76);
	}

	.depilart-menu__mobile-item--has-children.is-open > .depilart-menu__mobile-row .depilart-menu__toggle svg,
	.depilart-menu__mobile-expand[aria-expanded="true"] .depilart-menu__toggle svg {
		transform: rotate(180deg);
	}

	/* Trava o scroll do body quando o drawer está aberto */
	body.depilart-menu-open {
		overflow: hidden;
	}
}

@media (min-width: 783px) {
	.admin-bar .depilart-menu__overlay,
	.admin-bar .depilart-menu__drawer {
		top: 32px;
	}
}
