/*
 * serviNec: mega menú de «Productos» (inc/snec-megamenu.php)
 * assets/css/megamenu.css
 * Los selectores van con .snec-navbar / .snec-drawer delante para ganar a los estilos de enlaces de header.css.
 */

.snec-mm,
.snec-mm-m {
	--mm-blue: #1565e8;
	--mm-tint: #e8f0fd;
	--mm-tint-2: #d9e6fc;
	--mm-card: #eff2fa;
	--mm-ink: #111827;
	--mm-soft: #5b6270;
	--mm-line: #eeeff2;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.snec-mm-svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* ═══ Escritorio ═══════════════════════════════════════════════════════════ */
.snec-navbar .snec-mm {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 50;
	visibility: hidden;
	opacity: 0;
	transform: translateY(-6px);
	background: #ffffff;
	box-shadow: 0 18px 40px -12px rgba(17, 24, 39, .18);
	transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.snec-navbar .snec-mm-item.is-open > .snec-mm,
html:not(.snec-mm-js) .snec-navbar .snec-mm-item:hover > .snec-mm,
html:not(.snec-mm-js) .snec-navbar .snec-mm-item:focus-within > .snec-mm {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition: opacity .18s ease, transform .18s ease, visibility 0s;
}

/* Reset de los estilos de enlaces del menú azul dentro del panel. */
.snec-navbar .snec-mm a {
	display: block;
	padding: 0;
	border: 0;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: normal;
	text-decoration: none;
}

.snec-mm__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 378px;
	gap: 40px;
	max-width: 1280px;
	margin: 0 auto;
	padding: 22px clamp(16px, 4vw, 40px) 26px;
	box-sizing: border-box;
	color: var(--mm-ink);
}

.snec-mm__main {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 28px;
	padding-right: 40px;
	border-right: 1px solid var(--mm-line);
}

.snec-mm__cols {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0 clamp(20px, 4vw, 60px);
}

.snec-mm__col {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.snec-navbar .snec-mm .snec-mm__head {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	padding-bottom: 16px;
	margin-bottom: 8px;
	font-size: 15px;
	font-weight: 600;
	color: var(--mm-ink);
}

.snec-navbar .snec-mm .snec-mm__head::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 32px;
	height: 2px;
	border-radius: 2px;
	background: var(--mm-blue);
	transition: width .2s ease;
}

.snec-navbar .snec-mm .snec-mm__head:hover::after {
	width: 44px;
}

.snec-mm__ico {
	flex: none;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 12px;
	box-sizing: border-box;
	border-radius: 6px;
	background: var(--mm-tint);
	color: var(--mm-blue);
}

.snec-mm__name {
	display: -webkit-box;
	overflow: hidden;
	line-height: 1.25;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.snec-mm__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.snec-navbar .snec-mm .snec-mm__list a {
	overflow: hidden;
	padding: 13px 8px;
	border-bottom: 1px solid var(--mm-line);
	font-size: 13px;
	color: var(--mm-soft);
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: color .15s, background .15s;
}

.snec-navbar .snec-mm .snec-mm__list a:hover {
	background: #f7f9fe;
	color: var(--mm-blue);
}

.snec-navbar .snec-mm .snec-mm__more {
	align-self: flex-start;
	margin: 18px 0 0 8px;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--mm-blue);
}

.snec-navbar .snec-mm .snec-mm__more:hover {
	text-decoration: underline;
}

/* Franja «¿No encuentras lo que buscas?» */
.snec-mm__help {
	display: flex;
	align-items: center;
	gap: 8px 14px;
	padding: 9px 14px;
	border-radius: 8px;
	background: var(--mm-tint);
}

.snec-mm__help-ico {
	flex: none;
	width: 44px;
	height: 44px;
	padding: 12px;
	box-sizing: border-box;
	border-radius: 6px;
	background: var(--mm-tint-2);
	color: var(--mm-blue);
}

.snec-mm__help-txt {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
	min-width: 0;
}

.snec-mm__help-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--mm-ink);
}

.snec-mm__help-sub {
	font-size: 12px;
	color: var(--mm-soft);
}

.snec-navbar .snec-mm .snec-mm__help-link {
	flex: none;
	font-size: 13px;
	font-weight: 600;
	color: var(--mm-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Banner + botón */
.snec-mm__promo {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.snec-navbar .snec-mm .snec-mm__card {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1;
	min-height: 300px;
	overflow: hidden;
	border-radius: 10px;
	background: var(--mm-card);
}

.snec-mm__card-txt {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: 150px;
	padding: 0 0 18px 26px;
}

.snec-mm__card-title {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--mm-ink);
}

.snec-mm__card-bar {
	width: 20px;
	height: 2px;
	margin: 14px 0;
	border-radius: 2px;
	background: var(--mm-blue);
}

.snec-mm__card-sub {
	font-size: 11.5px;
	font-weight: 500;
	line-height: 1.7;
	color: #4b5563;
}

.snec-mm__card-img {
	position: absolute;
	right: 0;
	bottom: 0;
	height: 100%;
	width: auto;
	max-width: 74%;
	object-fit: contain;
	object-position: right bottom;
	transition: transform .35s ease;
}

.snec-navbar .snec-mm .snec-mm__card:hover .snec-mm__card-img {
	transform: scale(1.03);
}

.snec-navbar .snec-mm .snec-mm__cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 44px;
	padding: 0 22px;
	border-radius: 999px;
	background: var(--mm-blue);
	color: #ffffff;
	font-size: 14px;
	font-weight: 500;
	transition: background .15s;
}

.snec-navbar .snec-mm .snec-mm__cta:hover {
	background: #0f55c9;
}

.snec-mm__cta .snec-mm-svg {
	width: 16px;
	height: 16px;
}

.snec-navbar .snec-mm a:focus-visible {
	outline: 2px solid var(--mm-blue);
	outline-offset: 2px;
}

@media (max-width: 1180px) {
	.snec-mm__inner {
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 28px;
	}

	.snec-mm__main {
		padding-right: 28px;
	}

	.snec-mm__card-title {
		font-size: 22px;
	}
}

/* El panel de escritorio no existe en móvil (allí está el del cajón). */
@media (max-width: 900px) {
	.snec-navbar .snec-mm {
		display: none;
	}
}

/* ═══ Móvil (cajón) ════════════════════════════════════════════════════════ */
.snec-drawer .snec-mm-m__open {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 10px 4px;
	border: 0;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
	background: none;
	color: rgba(255, 255, 255, .9);
	font: 500 15px/1.6 'Inter', system-ui, sans-serif;
	text-align: left;
	cursor: pointer;
}

.snec-drawer .snec-mm-m__open .snec-mm-svg {
	width: 18px;
	height: 18px;
}

/* Panel abierto: el cajón se vuelve blanco y solo muestra «Categorías». */
.snec-drawer.is-mm {
	background: #ffffff;
	padding: 18px 20px 22px;
	max-height: calc(100vh - 120px);
	max-height: calc(100dvh - 120px);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.snec-drawer.is-mm .snec-drawer__list > li:not(.snec-mm-item),
.snec-drawer.is-mm .snec-mm-m__open {
	display: none;
}

.snec-mm-m[hidden] {
	display: none;
}

.snec-drawer .snec-mm-m a {
	display: block;
	padding: 0;
	border: 0;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	text-decoration: none;
}

.snec-drawer .snec-mm-m ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.snec-mm-m {
	color: var(--mm-ink);
}

.snec-mm-m__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
}

.snec-mm-m__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

.snec-mm-m__close {
	width: 34px;
	height: 34px;
	margin-right: -8px;
	padding: 8px;
	border: 0;
	background: none;
	color: var(--mm-blue);
	cursor: pointer;
}

.snec-mm-m__search {
	position: relative;
	margin-bottom: 14px;
}

.snec-mm-m__search input {
	width: 100%;
	height: 46px;
	padding: 0 52px 0 18px;
	box-sizing: border-box;
	border: 1px solid transparent;
	border-radius: 999px;
	background: #f2f2f2;
	font: 400 14px/1 'Inter', system-ui, sans-serif;
	color: var(--mm-ink);
}

.snec-mm-m__search input:focus {
	outline: none;
	border-color: #bcd2f8;
	background: #ffffff;
}

.snec-mm-m__search button {
	position: absolute;
	top: 50%;
	right: 10px;
	width: 34px;
	height: 34px;
	padding: 8px;
	border: 0;
	background: none;
	color: #555;
	transform: translateY(-50%);
	cursor: pointer;
}

.snec-drawer .snec-mm-m .snec-mm-m__row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid var(--mm-line);
	font-size: 15px;
	font-weight: 600;
	color: var(--mm-ink);
	cursor: pointer;
	list-style: none;
}

.snec-mm-m__row::-webkit-details-marker {
	display: none;
}

.snec-mm-m__row > .snec-mm-svg {
	flex: none;
	width: 16px;
	height: 16px;
	color: var(--mm-blue);
	transition: transform .2s ease;
}

.snec-mm-m__cat[open] > .snec-mm-m__row > .snec-mm-svg {
	transform: rotate(90deg);
}

.snec-mm-m__ico {
	flex: none;
	width: 42px;
	height: 42px;
	padding: 11px;
	box-sizing: border-box;
	border-radius: 6px;
	background: var(--mm-tint);
	color: var(--mm-blue);
}

.snec-mm-m__name {
	flex: 1;
	min-width: 0;
}

.snec-drawer .snec-mm-m .snec-mm-m__sub {
	padding: 4px 0 10px 56px;
	border-bottom: 1px solid var(--mm-line);
}

.snec-drawer .snec-mm-m .snec-mm-m__sub a {
	padding: 9px 0;
	font-size: 14px;
	color: var(--mm-soft);
}

.snec-drawer .snec-mm-m .snec-mm-m__sub .snec-mm-m__all {
	font-weight: 600;
	color: var(--mm-blue);
}

.snec-drawer .snec-mm-m .snec-mm-m__help {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 18px 0 14px;
	padding: 14px;
	border-radius: 10px;
	background: var(--mm-tint);
	font-size: 15px;
	font-weight: 600;
	color: var(--mm-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.snec-mm-m__help-ico {
	flex: none;
	width: 42px;
	height: 42px;
	padding: 11px;
	box-sizing: border-box;
	border-radius: 6px;
	background: var(--mm-tint-2);
}

.snec-drawer .snec-mm-m .snec-mm-m__promo {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 168px;
	overflow: hidden;
	border-radius: 10px;
	background: linear-gradient(120deg, #e9eef9, var(--mm-card));
}

.snec-mm-m__promo-txt {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 58%;
	padding: 18px;
}

.snec-mm-m__promo-title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
}

.snec-mm-m__promo-sub {
	font-size: 12px;
	line-height: 1.5;
	color: var(--mm-soft);
}

.snec-mm-m__promo-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--mm-blue);
}

.snec-mm-m__promo-cta .snec-mm-svg {
	width: 15px;
	height: 15px;
}

.snec-mm-m__promo-img {
	position: absolute;
	right: 0;
	bottom: 0;
	height: 100%;
	width: auto;
	max-width: 50%;
	object-fit: contain;
	object-position: right bottom;
}

.snec-drawer .snec-mm-m a:focus-visible,
.snec-mm-m summary:focus-visible,
.snec-mm-m button:focus-visible {
	outline: 2px solid var(--mm-blue);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.snec-navbar .snec-mm,
	.snec-mm__card-img,
	.snec-mm-m__row > .snec-mm-svg {
		transition: none;
	}
}
