/**
 * Guía de tallas: enlace en la ficha y modal.
 */

.peletines-talla {
	margin: 0 0 1rem;
}

.peletines-talla__abrir {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--pel-ink, #2b2520);
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.peletines-talla__abrir::before {
	content: "";
	width: 1.1em;
	height: 1.1em;
	background: currentColor;
	/* Regla de medir. */
	-webkit-mask: no-repeat center / contain url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 15.5 15.5 3 21 8.5 8.5 21z"/><path d="M7 11.5 8.5 13M10 8.5 11.5 10M13 5.5 14.5 7"/></svg>');
	mask: no-repeat center / contain url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 15.5 15.5 3 21 8.5 8.5 21z"/><path d="M7 11.5 8.5 13M10 8.5 11.5 10M13 5.5 14.5 7"/></svg>');
}

/* Modal -------------------------------------------------------------------- */

body.peletines-talla-abierta {
	overflow: hidden;
}

.peletines-talla__fondo {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(20, 16, 12, 0.55);
}

.peletines-talla__caja {
	position: relative;
	display: flex;
	width: min(46rem, 100%);
	max-height: min(86vh, 48rem);
	flex-direction: column;
	padding: clamp(1.25rem, 4vw, 2rem);
	border-radius: 24px;
	background: var(--pel-white, #fff);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.peletines-talla__cerrar {
	position: absolute;
	top: 0.6rem;
	right: 0.8rem;
	width: 2.2rem;
	height: 2.2rem;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--pel-ink-soft, #6b6257);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.peletines-talla__cerrar:hover {
	background: var(--pel-cream, #fdf8f1);
}

.peletines-talla__titulo {
	margin: 0 2rem 1rem 0;
	font-family: var(--wp--preset--font-family--fredoka, inherit);
	font-size: clamp(1.15rem, 3vw, 1.5rem);
}

.peletines-talla__cuerpo {
	overflow-y: auto;
	min-height: 0;
}

/* La imagen es un botón: abre la pantalla completa. */
.peletines-talla__lupa {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	margin: 0 0 1rem;
	background: none;
	cursor: zoom-in;
}

.peletines-talla__img {
	display: block;
	max-width: 100%;
	max-height: 38vh;
	width: auto;
	height: auto;
	margin: 0 auto;
	border-radius: 14px;
}

/* Pantalla completa ------------------------------------------------------- */

.peletines-talla__zoom {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	flex-direction: column;
	background: rgba(12, 10, 8, 0.94);
}

.peletines-talla__zoom-cerrar {
	position: absolute;
	top: max(0.5rem, env(safe-area-inset-top));
	right: 0.7rem;
	z-index: 2;
	width: 2.8rem;
	height: 2.8rem;
	border: 0;
	border-radius: 50%;
	/* Oscuro y con borde: tiene que leerse igual sobre un diagrama en fondo
	   claro que sobre una foto oscura. */
	background: rgba(18, 14, 10, 0.78);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
	color: #fff;
	font-size: 1.9rem;
	line-height: 1;
	cursor: pointer;
}

.peletines-talla__zoom-lienzo {
	display: grid;
	flex: 1;
	min-height: 0;
	place-items: center;
	overflow: auto;
	padding: 1rem;
	/* El pellizco se permite donde el navegador lo deje; el toque para
	   acercar es el camino que sí funciona en todos. */
	touch-action: pinch-zoom pan-x pan-y;
	-webkit-overflow-scrolling: touch;
}

.peletines-talla__zoom-img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	cursor: zoom-in;
}

/* Acercada: tamaño real y el lienzo se recorre. */
.peletines-talla__zoom.es-grande .peletines-talla__zoom-img {
	max-width: none;
	max-height: none;
	width: auto;
	height: auto;
	cursor: zoom-out;
}

.peletines-talla__zoom-pista {
	margin: 0;
	padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
	color: rgba(255, 255, 255, 0.75);
	font-size: 0.85rem;
	text-align: center;
}

/* La tabla puede traer muchas columnas: se desplaza sola en celular. */
.peletines-talla__scroll {
	overflow-x: auto;
}

.peletines-talla__tabla {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.peletines-talla__tabla th,
.peletines-talla__tabla td {
	padding: 0.5rem 0.7rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	text-align: left;
	white-space: nowrap;
}

.peletines-talla__tabla thead th {
	position: sticky;
	top: 0;
	background: var(--pel-cream, #fdf8f1);
	font-family: var(--wp--preset--font-family--fredoka, inherit);
	font-size: 0.82rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.peletines-talla__tabla tbody th {
	font-weight: 700;
}

.peletines-talla__tabla .es-tuya th,
.peletines-talla__tabla .es-tuya td {
	background: var(--pel-mint, #dff0e4);
}

.peletines-talla__nota {
	margin: 1rem 0 0;
	color: var(--pel-ink-soft, #6b6257);
	font-size: 0.9rem;
	white-space: pre-line;
}

.peletines-talla__aviso {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border: 1px dashed var(--pel-line, rgba(0, 0, 0, 0.25));
	border-radius: 12px;
	color: var(--pel-ink-soft, #6b6257);
	font-size: 0.88rem;
}
