/**
 * Tutorial guiado de Mi cuenta (nito-tour.js). Colores y tipografía de la web:
 * azul #0018a9, oscuro #0a0f2c, Montserrat (la de Kadence). Por encima de la
 * cabecera fija (9999) y de los cajones de Kadence (99999 / 100000).
 */
.nito-tour {
	position: fixed;
	inset: 0;
	z-index: 100050;
	font-family: Montserrat, sans-serif;
}

/* Capa que recoge los clics: durante el tour no se navega sin querer. */
.nito-tour__fondo {
	position: absolute;
	inset: 0;
}

/* El foco: un recuadro transparente con una sombra enorme que oscurece el resto. */
.nito-tour__foco {
	position: fixed;
	border-radius: 12px;
	box-shadow: 0 0 0 9999px rgba(10, 15, 44, .62), 0 0 0 3px #0018a9;
	pointer-events: none;
	transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
}

.nito-tour__caja {
	position: fixed;
	width: 340px;
	max-width: calc(100vw - 32px);
	padding: 20px 20px 16px;
	border-radius: 14px;
	background: #ffffff;
	box-shadow: 0 20px 50px -12px rgba(10, 15, 44, .45);
	color: #3d3d3d;
	transition: top .25s ease, left .25s ease;
}

.nito-tour__caja:focus {
	outline: none;
}

.nito-tour__caja:focus-visible {
	outline: 2px solid #0018a9;
	outline-offset: 3px;
}

.nito-tour .nito-tour__cerrar {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #6b7280;
	font-size: 22px;
	line-height: 32px;
	cursor: pointer;
}

/* Restados en :focus para ganar al button:focus de Kadence (ver CLAUDE.md). */
.nito-tour .nito-tour__cerrar:focus {
	background: transparent;
	color: #6b7280;
	box-shadow: none;
}

.nito-tour .nito-tour__cerrar:hover {
	background: #f1f5f9;
	color: #0a0f2c;
}

.nito-tour__paso {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #0018a9;
}

.nito-tour__progreso {
	height: 4px;
	margin: 0 0 14px;
	border-radius: 2px;
	background: #e5e7eb;
	overflow: hidden;
}

.nito-tour__progreso span {
	display: block;
	height: 100%;
	border-radius: 2px;
	background: #0018a9;
	transition: width .25s ease;
}

.nito-tour .nito-tour__titulo {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.3;
	color: #0a0f2c;
}

.nito-tour .nito-tour__texto {
	margin: 0 0 18px;
	font-size: 14.4px;
	line-height: 1.55;
}

.nito-tour__botones {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

/* Ningún botón parte su texto en dos líneas: si no caben, bajan de fila. */
.nito-tour .nito-tour__botones button {
	white-space: nowrap;
}

.nito-tour__nav {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

.nito-tour .nito-tour__boton,
.nito-tour .nito-tour__boton:focus {
	padding: 9px 14px;
	border: 2px solid #0018a9;
	border-radius: 8px;
	background: #0018a9;
	box-shadow: none;
	color: #ffffff;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
}

.nito-tour .nito-tour__boton:hover {
	background: #ffffff;
	color: #0018a9;
}

.nito-tour .nito-tour__boton--borde,
.nito-tour .nito-tour__boton--borde:focus {
	background: #ffffff;
	color: #0018a9;
}

.nito-tour .nito-tour__boton--borde:hover {
	background: #eef1ff;
}

.nito-tour .nito-tour__saltar,
.nito-tour .nito-tour__saltar:focus {
	padding: 4px 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: #6b7280;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.nito-tour .nito-tour__saltar:hover {
	color: #0a0f2c;
}

.nito-tour button:focus-visible {
	outline: 2px solid #0018a9;
	outline-offset: 2px;
}

.nito-tour [hidden] {
	display: none;
}

/* Móvil: el tooltip, abajo a todo el ancho. */
@media (max-width: 767px) {
	.nito-tour__caja {
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		max-width: none;
		padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
		border-radius: 16px 16px 0 0;
	}

}

@media (prefers-reduced-motion: reduce) {
	.nito-tour__foco,
	.nito-tour__caja,
	.nito-tour__progreso span {
		transition: none;
	}
}

/*
 * Los tutoriales en Mi panel: una fila de dos píldoras bajo el saludo, con un
 * icono de «play». Se parten en dos líneas solo si no caben (móvil).
 */
.nito-panel .nito-tour-lanzadores {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: -10px 0 22px; /* .nito-panel__sub ya deja 22px debajo: quedan 12px */
}

.nito-panel .nito-tour-lanzar {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 7px 14px 7px 8px;
	border: 1px solid #d6ddf5;
	border-radius: 999px;
	background: #f3f5fd;
	box-shadow: none;
	color: #0018a9;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, border-color .15s;
}

/* El círculo azul con el triángulo de «play», dibujado en CSS. */
.nito-panel .nito-tour-lanzar::before {
	content: '';
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #0018a9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M8 6.2v7.6L14 10z' fill='%23ffffff'/%3E%3C/svg%3E") center / 20px no-repeat;
}

/* :focus antes que :hover (Kadence pinta button:focus en blanco; ver CLAUDE.md). */
.nito-panel .nito-tour-lanzar:focus {
	background: #f3f5fd;
	color: #0018a9;
	box-shadow: none;
}

.nito-panel .nito-tour-lanzar:hover,
.nito-panel .nito-tour-lanzar:active {
	border-color: #0018a9;
	background: #e6ebfb;
	color: #0018a9;
}

.nito-panel .nito-tour-lanzar:focus-visible {
	outline: 2px solid #0018a9;
	outline-offset: 2px;
}

/* Pedidos de ejemplo del tour (solo si el cliente no tiene): etiqueta visible. */
.nito-tour-ejemplo__marca {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 8px;
	border-radius: 999px;
	background: #fff3d6;
	color: #8a5a00;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .03em;
	text-transform: uppercase;
	vertical-align: middle;
}

.nito-tour-ejemplo__fila td {
	background: #fffcf3;
}

/* Seguimiento de ejemplo (paso «Proceso de reparación»), dentro de Pedidos en curso. */
.nito-tour-seguimiento {
	margin: 16px 0 0;
	padding: 16px;
	border: 1px dashed #f5c78a;
	border-radius: 10px;
	background: #fffcf3;
}

.nito-tour-seguimiento .nito-tour-seguimiento__titulo {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 800;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: #0a0f2c;
}

/* Pasos informativos (sin elemento) y modal de oferta: fondo oscuro entero, sin
   recorte, y el tooltip en el centro. En móvil sigue siendo la hoja de abajo. */
.nito-tour--centro .nito-tour__foco {
	display: none;
}

.nito-tour--centro .nito-tour__fondo {
	background: rgba(10, 15, 44, .62);
}

@media (min-width: 768px) {
	.nito-tour--centro .nito-tour__caja {
		top: 50%;
		left: 50%;
		width: 400px;
		transform: translate(-50%, -50%);
	}
}

.nito-tour--oferta .nito-tour__titulo {
	padding-right: 28px; /* sitio para la × */
	font-size: 19px;
}

/* paso.destacar: dentro de la zona del paso, el elemento que hay que pulsar
   (Solicitar reparación en la sección del producto) lleva un anillo que late.
   box-shadow y no outline, para no pisar el foco del teclado del botón. */
.nito-tour-destacado {
	box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #0018a9 !important;
	animation: nito-tour-latido 1.6s ease-in-out infinite;
}

@keyframes nito-tour-latido {
	0%, 100% { box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #0018a9; }
	50%      { box-shadow: 0 0 0 3px #ffffff, 0 0 0 11px rgba(0, 24, 169, .35); }
}

@media (prefers-reduced-motion: reduce) {
	.nito-tour-destacado {
		animation: none;
	}
}
