.nmew-levels,
.nmew-levels * {
	box-sizing: border-box;
}

.nmew-levels {
	width: 100%;
	margin-inline: auto;
	padding: 22px 58px;
	background-color: #fff;
	font-family: "Century Gothic", Montserrat, Arial, sans-serif;
}

.nmew-levels__header {
	display: flex;
	align-items: center;
	flex-direction: column;
	margin-bottom: 27px;
	gap: 13px;
	text-align: center;
}

.nmew-levels__heading {
	--nmew-heading-x: 0px;
	--nmew-heading-y: 0px;
	margin: 0;
	color: #f8690e;
	font-family: inherit;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.1;
	transform: translate(var(--nmew-heading-x), var(--nmew-heading-y));
}

.nmew-levels__subheading {
	--nmew-subheading-x: 0px;
	--nmew-subheading-y: 0px;
	margin: 0;
	color: #111;
	font-family: inherit;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.2;
	transform: translate(var(--nmew-subheading-x), var(--nmew-subheading-y));
}

.nmew-levels__grid {
	--nmew-columns: 4;
	--nmew-grid-x: 0px;
	--nmew-grid-y: 0px;
	display: grid;
	grid-template-columns: repeat(var(--nmew-columns), minmax(0, 1fr));
	gap: 20px;
	transform: translate(var(--nmew-grid-x), var(--nmew-grid-y));
}

.nmew-level {
	--nmew-card-x: 0px;
	--nmew-card-y: 0px;
	position: relative;
	display: flex;
	min-width: 0;
	min-height: 264px;
	flex-direction: column;
	padding: 15px 18px 10px;
	overflow: visible;
	background-color: #005c46;
	border: 1px solid #7b7b7b;
	border-radius: 30px;
	transform: translate(var(--nmew-card-x), var(--nmew-card-y));
}

.nmew-level.is-popup-open {
	z-index: 20;
}

.nmew-level__top {
	display: grid;
	grid-template-columns: 68px minmax(0, 1fr);
	align-items: center;
	gap: 32px;
}

.nmew-level__icon {
	--nmew-icon-x: 0px;
	--nmew-icon-y: 0px;
	display: inline-flex;
	width: 68px;
	height: 68px;
	flex: 0 0 68px;
	align-items: center;
	justify-content: center;
	color: #111;
	font-size: 37px;
	line-height: 1;
	background-color: #e5e5e5;
	border-radius: 50%;
	transform: translate(var(--nmew-icon-x), var(--nmew-icon-y));
}

.nmew-level__icon i,
.nmew-level__icon svg {
	display: block;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.nmew-level__title {
	--nmew-title-x: 0px;
	--nmew-title-y: 0px;
	margin: 0;
	color: #fff;
	font-family: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.1;
	transform: translate(var(--nmew-title-x), var(--nmew-title-y));
}

.nmew-level__subjects {
	--nmew-list-x: 0px;
	--nmew-list-y: 0px;
	margin: 9px 0 8px 23px;
	padding: 0;
	color: #fff;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 400;
	line-height: 1.12;
	transform: translate(var(--nmew-list-x), var(--nmew-list-y));
}

.nmew-level__subjects li {
	margin: 0;
	padding: 0;
}

.nmew-level__button-wrap {
	--nmew-button-x: 0px;
	--nmew-button-y: 0px;
	display: flex;
	justify-content: center;
	margin-top: auto;
	transform: translate(var(--nmew-button-x), var(--nmew-button-y));
}

.nmew-level__button {
	appearance: none;
	display: inline-flex;
	width: 160px;
	min-height: 30px;
	align-items: center;
	justify-content: center;
	padding: 5px 14px;
	color: #fff;
	font-family: Arial, sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	background-color: #ff6507;
	border: 0;
	border-radius: 18px;
	cursor: pointer;
	gap: 10px;
	transition: color 180ms ease, background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.nmew-level__button-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	line-height: 1;
	transition: transform 180ms ease;
}

.nmew-level__button-icon i,
.nmew-level__button-icon svg {
	display: block;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.nmew-level__button:hover,
.nmew-level__button:focus-visible {
	color: #fff;
	text-decoration: none;
	background-color: #e75412;
	box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
	transform: translateY(-1px);
}

.nmew-level__button:hover .nmew-level__button-icon,
.nmew-level__button:focus-visible .nmew-level__button-icon {
	transform: translateX(3px);
}

.nmew-level__button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.nmew-level__button:active {
	transform: translateY(0) scale(0.98);
}

.nmew-level__popup {
	--nmew-popup-x: 0px;
	--nmew-popup-y: 0px;
	position: absolute;
	z-index: 30;
	bottom: 52px;
	left: 50%;
	width: 220px;
	padding: 15px 34px 15px 16px;
	visibility: hidden;
	color: #fff;
	background-color: #ff6507;
	border-radius: 14px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
	opacity: 0;
	pointer-events: none;
	transform: translate(
		calc(-50% + var(--nmew-popup-x)),
		calc(var(--nmew-popup-y) + 8px)
	) scale(0.96);
	transform-origin: center bottom;
	transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.nmew-level__popup::after {
	position: absolute;
	top: 100%;
	left: 50%;
	width: 0;
	height: 0;
	border: 8px solid transparent;
	border-top-color: #ff6507;
	content: "";
	transform: translateX(-50%);
}

.nmew-level.is-popup-open .nmew-level__popup {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transform: translate(
		calc(-50% + var(--nmew-popup-x)),
		var(--nmew-popup-y)
	) scale(1);
}

.nmew-level__popup-title {
	display: block;
	margin: 0 0 6px;
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
}

.nmew-level__popup-text {
	margin: 0;
	color: #fff;
	font-family: inherit;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
}

.nmew-level__popup-close {
	appearance: none;
	position: absolute;
	top: 6px;
	right: 8px;
	display: inline-flex;
	width: 24px;
	height: 24px;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: #fff;
	font: 700 22px/1 Arial, sans-serif;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.nmew-level__popup-close:hover,
.nmew-level__popup-close:focus-visible {
	color: #fff;
	background-color: rgba(0, 0, 0, 0.18);
}

.nmew-level__popup-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 1px;
}

@media (max-width: 1024px) {
	.nmew-levels {
		padding-inline: 38px;
	}

	.nmew-levels__grid {
		--nmew-columns: 2;
	}
}

@media (max-width: 767px) {
	.nmew-levels {
		padding-inline: 22px;
	}

	.nmew-levels__subheading {
		font-size: 19px;
	}

	.nmew-levels__grid {
		--nmew-columns: 1;
	}

	.nmew-level {
		width: min(100%, 330px);
		margin-inline: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nmew-level__button,
	.nmew-level__button-icon,
	.nmew-level__popup {
		transition-duration: 0.01ms !important;
	}
}

/* Cuadrícula estable para tablet y móvil. */
@media (min-width: 768px) and (max-width: 1024px) {
	.nmew-levels__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.nmew-level,
	.nmew-level__top,
	.nmew-level__title {
		min-width: 0;
	}
}

@media (max-width: 767px) {
	.nmew-levels__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.nmew-level {
		width: min(100%, 380px);
	}

	.nmew-level__popup {
		width: calc(100% - 24px);
		max-width: 260px;
	}
}

@media (max-width: 420px) {
	.nmew-levels {
		padding-inline: 14px;
	}

	.nmew-level {
		padding-inline: 14px;
	}

	.nmew-level__top {
		grid-template-columns: 56px minmax(0, 1fr);
		gap: 16px;
	}

	.nmew-level__icon {
		width: 56px;
		height: 56px;
		flex-basis: 56px;
	}

	.nmew-level__subjects {
		margin-left: 18px;
	}
}

.nmew-levels__carousel-nav {
	display: none;
}

/* Carrusel móvil: dos niveles apilados en cada vista. */
@media (max-width: 767px) {
	.nmew-levels__grid {
		position: relative;
		display: grid;
		grid-template-columns: none;
		grid-template-rows: repeat(2, minmax(264px, auto));
		grid-auto-columns: 100%;
		grid-auto-flow: column;
		width: 100%;
		padding: 2px 0 4px;
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-inline: contain;
		scroll-behavior: smooth;
		scroll-snap-type: inline mandatory;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.nmew-levels__grid::-webkit-scrollbar {
		display: none;
	}

	.nmew-level {
		width: 100%;
		max-width: none;
		margin: 0;
		scroll-snap-align: none;
	}

	.nmew-level:nth-child(odd) {
		scroll-snap-align: start;
		scroll-snap-stop: always;
	}

	.nmew-levels__carousel-nav {
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 16px;
		gap: 9px;
	}

	.nmew-levels__carousel-dot {
		appearance: none;
		display: block;
		width: 11px;
		height: 11px;
		padding: 0;
		background-color: #d1d1d1;
		border: 0;
		border-radius: 50%;
		cursor: pointer;
		transition: background-color 180ms ease, transform 180ms ease;
	}

	.nmew-levels__carousel-dot:hover,
	.nmew-levels__carousel-dot:focus-visible,
	.nmew-levels__carousel-dot.is-active {
		background-color: #f8690e;
		transform: scale(1.18);
	}

	.nmew-levels__carousel-dot:focus-visible {
		outline: 2px solid #004c3f;
		outline-offset: 3px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nmew-levels__grid {
		scroll-behavior: auto;
	}

	.nmew-levels__carousel-dot {
		transition-duration: 0.01ms !important;
	}
}
