/* Marco del sitio: header (barra superior, fila principal, categorías, beneficios) y footer. */
.nm-skip {
	position: absolute;
	top: -60px;
	left: 8px;
	z-index: 100;
	padding: 8px 12px;
	border-radius: var(--nm-radius);
	background: var(--nm-navy);
	color: var(--nm-white);
}

.nm-skip:focus {
	top: 8px;
}

.nm-content:focus {
	outline: none;
}

.nm-icon {
	flex: none;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Barra superior */
.nm-topbar {
	background: var(--nm-soft);
	color: var(--nm-navy);
	font-size: var(--nm-fs-12);
	font-weight: 700;
}

.nm-topbar-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 24px;
	padding-block: 7px;
}

/* Franja de campaña (Cyber): fondo negro, texto blanco y el primer mensaje en amarillo. */
.nm-topbar--campaign {
	background: var(--nm-campaign);
	color: var(--nm-white);
}

.nm-topbar--campaign .nm-topbar-inner span:first-child {
	color: var(--nm-campaign-accent);
	letter-spacing: 0.04em;
}

/* Fila principal */
.nm-header-main-inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 24px;
	padding-block: 14px;
}

.nm-logo img {
	width: 118px;
	height: auto;
}

.nm-search {
	display: flex;
	align-items: center;
	height: 42px;
	border: 1.5px solid var(--nm-navy);
	border-radius: 5px;
	background: var(--nm-white);
}

.nm-search:focus-within {
	box-shadow: 0 0 0 3px rgba(27, 29, 104, 0.18);
}

.nm-search-input {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0 14px;
	border: 0;
	background: transparent;
	color: var(--nm-ink);
	font: inherit;
}

.nm-search-input::placeholder {
	color: var(--nm-muted);
}

.nm-search-input:focus {
	outline: none;
}

.nm-search-btn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 100%;
	border: 0;
	background: transparent;
	color: var(--nm-ink);
	cursor: pointer;
}

.nm-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.nm-header-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	min-height: 44px;
	color: var(--nm-navy);
	font-size: var(--nm-fs-13);
	font-weight: 700;
	text-decoration: none;
}

.nm-cart-count {
	display: inline-grid;
	place-items: center;
	min-width: 18px;
	height: 18px;
	padding-inline: 5px;
	border-radius: 9px;
	background: var(--nm-red);
	color: var(--nm-white);
	font-size: 11px;
	font-weight: 800;
}

/* Barra de categorías */
.nm-nav {
	--nm-nav-bg: var(--nm-navy);
	background: var(--nm-nav-bg);
}

.nm-nav-list {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 7px 0;
	list-style: none;
}

.nm-nav-link {
	display: block;
	padding: 4px 11px;
	border-radius: var(--nm-radius);
	color: var(--nm-white);
	font: 600 var(--nm-fs-14) / 1.4 var(--nm-font-display);
	text-decoration: none;
	white-space: nowrap;
}

/* Subrayado amarillo en vez de píldora blanca: la píldora no incluía el ▲ del mega menú,
   que quedaba suelto al lado. */
.nm-nav-link:hover,
.nm-nav-item.is-open > .nm-nav-link {
	border-radius: 0;
	box-shadow: inset 0 -3px 0 var(--nm-yellow);
}

.nm-nav-link:focus-visible,
.nm-nav-toggle:focus-visible,
.nm-footer a:focus-visible {
	outline-color: var(--nm-yellow);
}

/* Botón de la campaña (Cyber): píldora amarilla con rayo, latido suave y "hasta -X%" en rojo. */
.nm-nav-item--campaign > .nm-nav-link,
.nm-nav-item--campaign > .nm-nav-link:hover,
.nm-nav-item--campaign.is-open > .nm-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px 4px 12px;
	border-radius: 999px;
	background: var(--nm-campaign-accent);
	color: #0b0b12;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	box-shadow: 0 0 0 0 rgb(var(--nm-campaign-glow) / 0.7);
	animation: nm-cyber-pulse 1.8s ease-out infinite;
}

.nm-nav-item--campaign > .nm-nav-link:hover {
	background: var(--nm-white);
}

.nm-nav-hot {
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--nm-red);
	color: var(--nm-white);
	font-size: var(--nm-fs-12);
	letter-spacing: 0;
	text-transform: none;
}

.nm-nav-item--campaign .nm-nav-toggle {
	color: var(--nm-campaign-accent);
}

@keyframes nm-cyber-pulse {
	70% { box-shadow: 0 0 0 8px rgb(var(--nm-campaign-glow) / 0); }
	100% { box-shadow: 0 0 0 0 rgb(var(--nm-campaign-glow) / 0); }
}

@media (prefers-reduced-motion: reduce) {
	.nm-nav-item--campaign > .nm-nav-link {
		animation: none;
		box-shadow: 0 0 0 2px rgb(var(--nm-campaign-glow) / 0.45);
	}
}

/* Halloween: barra de categorías morada y murciélagos naranjos en la franja superior. */
.nm-campaign-halloween .nm-nav {
	--nm-nav-bg: var(--nm-campaign-nav);
}

.nm-campaign-halloween .nm-topbar--campaign .nm-topbar-inner span:first-child::before {
	content: "";
	display: inline-block;
	width: 22px;
	height: 11px;
	margin-right: 8px;
	vertical-align: -1px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 50'%3E%3Cpath fill='%23FF7A00' d='M50 18c3-6 4-10 4-14 2 3 3 6 3 9 6-6 14-9 24-8-5 3-7 8-7 13 6-1 13 1 20 6-9-1-16 2-20 8-3-4-9-6-15-4-4 1-8 5-9 10-1-5-5-9-9-10-6-2-12 0-15 4-4-6-11-9-20-8 7-5 14-7 20-6 0-5-2-10-7-13 10-1 18 2 24 8 0-3 1-6 3-9 0 4 1 8 4 14z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Navidad: barra de categorías roja y copo de nieve dorado en la franja superior. */
.nm-campaign-navidad .nm-nav {
	--nm-nav-bg: var(--nm-campaign-nav);
}

.nm-campaign-navidad .nm-topbar--campaign .nm-topbar-inner span:first-child::before {
	content: "";
	display: inline-block;
	width: 13px;
	height: 13px;
	margin-right: 8px;
	vertical-align: -1px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F4D27A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M3.3 17l17.4-10M9 3.5l3 2.5 3-2.5M9 20.5l3-2.5 3 2.5'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Beneficios */
.nm-benefits {
	border-bottom: 1px solid var(--nm-soft);
}

.nm-benefits-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 6px 20px;
	margin: 0 auto;
	padding-block: 8px;
	list-style: none;
	color: var(--nm-muted);
	font-size: var(--nm-fs-12);
}

.nm-benefits-list strong {
	color: var(--nm-ink);
}

/* Footer */
.nm-footer {
	margin-top: 48px;
	background: var(--nm-navy);
	color: rgba(255, 255, 255, 0.86);
	font-size: var(--nm-fs-13);
}

.nm-footer a {
	color: var(--nm-white);
	text-decoration: none;
}

.nm-footer a:hover {
	text-decoration: underline;
}

.nm-footer-grid {
	display: grid;
	grid-template-columns: 1fr 1.4fr 1fr 1.1fr;
	gap: 32px;
	padding-block: 40px;
}

.nm-footer-logo {
	width: 150px;
	height: auto;
	margin-bottom: 16px;
}

.nm-footer-title {
	margin: 0 0 12px;
	color: var(--nm-white);
	font-size: var(--nm-fs-16);
	font-weight: 700;
	text-transform: none;
}

.nm-footer-list,
.nm-footer-social {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nm-footer-list--cols {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 16px;
}

.nm-footer-social {
	grid-auto-flow: column;
	justify-content: start;
	gap: 8px;
	margin: 8px 0 0 -10px; /* el glifo (24px) queda alineado con el borde del logo */
}

.nm-footer-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var(--nm-white);
	transition: background-color 0.15s, color 0.15s;
}

.nm-footer-social a:hover,
.nm-footer-social a:focus-visible {
	background: rgba(255, 255, 255, 0.14);
	color: var(--nm-yellow);
}

.nm-footer-social .nm-icon {
	width: 24px;
	height: 24px;
	fill: currentColor;
	stroke: none;
}

.nm-footer-webpay {
	width: 120px;
	height: auto;
	margin-top: 16px;
}

.nm-footer-bottom {
	padding-block: 14px;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	font-size: var(--nm-fs-12);
}

@media (max-width: 820px) {
	.nm-footer-list a {
		display: inline-flex;
		align-items: center;
		min-height: 36px;
	}

	.nm-footer-list {
		gap: 2px 16px;
	}

	.nm-topbar-inner {
		justify-content: center;
		text-align: center;
	}

	.nm-topbar-inner span:not(:first-child) {
		display: none;
	}

	.nm-header-main-inner {
		grid-template-columns: auto auto 1fr;
		gap: 12px 12px;
	}

	.nm-header-actions {
		justify-self: end;
	}

	.nm-header-link-text {
		display: none;
	}

	.nm-search {
		grid-column: 1 / -1;
		order: 3;
	}

	/* Objetivo táctil de 40px (sobre el mínimo de 24px de WCAG 2.5.8): el link medía 28px. */
	.nm-nav-link {
		display: flex;
		align-items: center;
		min-height: 40px;
		padding-inline: 10px;
	}

	/* Todas las categorías a la vista, en dos filas si hace falta (Clarity, nov 2026: en una fila
	   que se deslizaba de lado, Equipos de Fútbol, Escolar y Hogar quedaban escondidos tras Marvel). */
	.nm-nav-list {
		flex-wrap: wrap;
		justify-content: center;
		gap: 0 4px;
		padding: 4px 0;
	}

	/* Beneficios: una sola línea que rota los cuatro mensajes (antes se ocultaban los dos
	   últimos, justo el mayorista y Webpay). Sin movimiento se ve solo el primero. */
	.nm-benefits-list {
		display: grid;
		justify-content: center;
		justify-items: center;
		padding-block: 0;
	}

	.nm-benefits-list li {
		grid-area: 1 / 1;
		display: flex;
		align-items: center;
		gap: 0.3em;
		min-height: 34px;
		opacity: 0;
		animation: nm-benefit-rota 12s infinite;
	}

	.nm-benefits-list li:nth-child(2) { animation-delay: 3s; }
	.nm-benefits-list li:nth-child(3) { animation-delay: 6s; }
	.nm-benefits-list li:nth-child(4) { animation-delay: 9s; }

	/* La franja superior repite el mensaje de envíos: fuera de la portada se oculta para que el
	   header móvil no pase de ~200px. */
	body:not(.home) .nm-topbar {
		display: none;
	}

	.nm-footer-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 480px) {
	.nm-footer-grid {
		grid-template-columns: 1fr;
	}
}

@keyframes nm-benefit-rota {
	0%, 2% { opacity: 0; }
	6%, 22% { opacity: 1; }
	26%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.nm-benefits-list li {
		animation: none;
	}

	.nm-benefits-list li:first-child {
		opacity: 1;
	}
}

/* Newsletter del footer */
.nm-newsletter {
	border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.nm-newsletter-inner {
	display: grid;
	grid-template-columns: 1fr 1.4fr;
	gap: 32px;
	align-items: center;
	padding-block: 28px;
}

.nm-newsletter-copy .nm-footer-title { margin-bottom: 4px; font-size: var(--nm-fs-18); }
.nm-newsletter-copy p { margin: 0; }
.nm-newsletter-form p { margin: 0; }

.nm-newsletter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.nm-newsletter-row label {
	flex: 0 0 100%;
	margin-bottom: 2px;
	color: var(--nm-white);
	font-weight: 700;
}

.nm-newsletter-row input[type="email"] {
	flex: 1 1 220px;
	min-width: 0;
	min-height: 44px;
	padding: 0 16px;
	border: 2px solid transparent;
	border-radius: var(--nm-radius-pill);
	background: var(--nm-white);
	color: var(--nm-ink);
	font: inherit;
	font-size: var(--nm-fs-16);
}

.nm-newsletter-row input[type="email"]:focus-visible,
.nm-newsletter-btn:focus-visible {
	outline: 3px solid var(--nm-yellow);
	outline-offset: 2px;
}

.nm-newsletter-btn {
	min-height: 44px;
	padding: 0 24px;
	border: 0;
	border-radius: var(--nm-radius-pill);
	background: var(--nm-yellow); /* navy sobre amarillo: 11:1 */
	color: var(--nm-navy);
	font-family: var(--nm-font-display);
	font-size: var(--nm-fs-14);
	font-weight: 700;
	cursor: pointer;
}

.nm-newsletter-btn:hover { background: var(--nm-white); }

.nm-newsletter-check { margin-top: 10px !important; }
.nm-newsletter-check label { display: flex; gap: 10px; align-items: flex-start; }
.nm-newsletter-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--nm-yellow); }

.nm-newsletter-aviso {
	margin-top: 10px !important;
	padding: 10px 14px !important;
	border-radius: var(--nm-radius);
	background: var(--nm-white);
	font-weight: 700;
}
.nm-newsletter-aviso--ok { color: var(--nm-green-dark); }
.nm-newsletter-aviso--error { color: var(--nm-red); }

/* El campo trampa también debe estar oculto donde page.css no se carga. */
.nm-newsletter .nm-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; visibility: hidden; }

@media (max-width: 820px) {
	.nm-newsletter-inner { grid-template-columns: 1fr; gap: 16px; }
}
