/*
 * Y&P Catálogo — botones de WhatsApp, precio, opciones de la ficha y datos de
 * contacto. Colores y fuentes de IDENTIDAD.md: se leen de los presets del
 * tema (theme.json) cuando existen y, si no, del valor fijo.
 *
 * Todas las clases llevan el prefijo yp-. El tema puede sobrescribir las
 * variables --yp-* en :root o en un contenedor.
 */

:root {
	--yp-tinta: var(--wp--preset--color--tinta, #0e0f12);
	--yp-grafito: var(--wp--preset--color--grafito, #3a3d45);
	--yp-gris: var(--wp--preset--color--gris, #6b7080);
	--yp-linea: var(--wp--preset--color--linea, #e3e6ec);
	--yp-papel: var(--wp--preset--color--papel, #ffffff);
	--yp-magenta: var(--wp--preset--color--magenta, #ec008c);
	--yp-whatsapp: var(--wp--preset--color--whatsapp, #25d366);
	--yp-whatsapp-hover: #1ebe5d;
	--yp-foco: var(--yp-magenta);
	--yp-radio: 6px;
	--yp-fuente-mono: var(--wp--preset--font-family--mono, var(--wp--preset--font-family--jetbrains-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace));
}

/* Solo para lectores de pantalla. */
.yp-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.yp-icono {
	width: 1.25em;
	height: 1.25em;
	flex: none;
	display: inline-block;
	vertical-align: middle;
}

/* ---------- Botón de WhatsApp ---------- */

.yp-wa {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55em;
	min-height: 48px;
	padding: 0.75em 1.35em;
	border: 0;
	border-radius: var(--yp-radio);
	background: var(--yp-whatsapp);
	color: var(--yp-tinta);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

.yp-wa:visited {
	color: var(--yp-tinta);
}

.yp-wa:hover {
	background: var(--yp-whatsapp-hover);
	color: var(--yp-tinta);
	text-decoration: none;
	transform: translateY(-1px);
}

.yp-wa:focus {
	outline: none;
}

.yp-wa:focus-visible,
.yp-contacto:focus-visible,
.yp-red:focus-visible {
	outline: 3px solid var(--yp-foco);
	outline-offset: 3px;
}

/* Sin número: lleva a la página de contacto con el botón principal (tinta). */
.yp-wa--sin-numero,
.yp-wa--sin-numero:visited {
	background: var(--yp-tinta);
	color: var(--yp-papel);
}

.yp-wa--sin-numero:hover {
	background: var(--yp-grafito);
	color: var(--yp-papel);
}

/* Estilo enlace: texto tinta con subrayado magenta que crece. */
.yp-wa--enlace,
.yp-wa--enlace:visited,
.yp-wa--enlace:hover,
.yp-wa--enlace.yp-wa--sin-numero {
	display: inline;
	min-height: 0;
	padding: 0 0 0.1em;
	border-radius: 0;
	background: linear-gradient(var(--yp-magenta), var(--yp-magenta)) no-repeat 0 100% / 100% 2px;
	color: inherit;
	font-size: inherit;
	font-weight: 600;
	transform: none;
	transition: background-size 0.2s ease;
}

.yp-wa--enlace:hover {
	background-size: 100% 0.45em;
}

.yp-wa--enlace .yp-icono {
	width: 1.1em;
	height: 1.1em;
	margin-right: 0.3em;
	vertical-align: -0.2em;
}

/* En las tarjetas ocupa el ancho de la tarjeta. */
.yp-tarjeta-wa {
	margin-top: 0.75rem;
}

.yp-wa--tarjeta {
	width: 100%;
}

/* ---------- Botón flotante ---------- */

.yp-wa--flotante {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 90;
	width: 56px;
	height: 56px;
	min-height: 0;
	padding: 0;
	box-shadow: 0 2px 10px rgba(14, 15, 18, 0.22);
}

.yp-wa--flotante .yp-icono {
	width: 28px;
	height: 28px;
}

.yp-wa--flotante .yp-wa__texto {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

@media (min-width: 782px) {
	.yp-wa--flotante {
		right: 24px;
		bottom: 24px;
	}
}

@media print {
	.yp-wa--flotante {
		display: none;
	}
}

/* ---------- Precio ---------- */

.yp-precio {
	font-variant-numeric: tabular-nums;
}

.yp-precio__desde {
	font-family: var(--yp-fuente-mono);
	font-size: 0.8em;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--yp-gris);
}

.yp-precio__valor {
	font-weight: 600;
}

.yp-precio--cotiza {
	font-family: var(--yp-fuente-mono);
	font-size: 0.8em;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* ---------- Ficha: opciones, cantidad y botón ---------- */

.yp-ficha-wa {
	display: grid;
	gap: 1.25rem;
	margin-block: 1.5rem;
	justify-items: start;
}

.yp-etiqueta {
	display: block;
	margin: 0 0 0.5rem;
	padding: 0;
	font-family: var(--yp-fuente-mono);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--yp-grafito);
}

.yp-opciones {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.yp-opciones__lista {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.yp-chip {
	position: relative;
	display: inline-flex;
	cursor: pointer;
}

.yp-chip input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.yp-chip span {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0.4em 1em;
	/* Gris y no línea: el borde es lo que dibuja la opción y necesita 3:1. */
	border: 1px solid var(--yp-gris);
	border-radius: 999px;
	background: var(--yp-papel);
	color: var(--yp-tinta);
	font-size: 0.9375rem;
	line-height: 1.2;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.yp-chip:hover span {
	border-color: var(--yp-tinta);
}

.yp-chip input:checked + span {
	border-color: var(--yp-tinta);
	background: var(--yp-tinta);
	color: var(--yp-papel);
}

.yp-chip input:focus-visible + span {
	outline: 3px solid var(--yp-foco);
	outline-offset: 2px;
}

.yp-cantidad {
	display: grid;
}

.yp-cantidad__campo {
	box-sizing: border-box;
	width: 8rem;
	min-height: 44px;
	padding: 0.5em 0.75em;
	border: 1px solid var(--yp-gris);
	border-radius: var(--yp-radio);
	background: var(--yp-papel);
	color: var(--yp-tinta);
	font: inherit;
}

.yp-cantidad__campo:focus-visible {
	outline: 3px solid var(--yp-foco);
	outline-offset: 2px;
}

.yp-cantidad__ayuda,
.yp-ficha-wa__nota {
	margin: 0.4rem 0 0;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--yp-grafito);
}

.yp-ficha-wa__nota {
	margin: 0;
}

/* ---------- Datos de contacto y redes ---------- */

.yp-contacto--whatsapp {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.yp-redes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.yp-redes li {
	margin: 0;
}

.yp-red {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	color: inherit;
	text-decoration: none;
}

.yp-redes .yp-red {
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid currentColor;
	border-radius: var(--yp-radio);
	transition: color 0.15s ease, border-color 0.15s ease;
}

.yp-redes .yp-red:hover {
	color: var(--yp-magenta);
}

.yp-red .yp-icono {
	width: 20px;
	height: 20px;
}

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
	.yp-wa,
	.yp-chip span,
	.yp-red {
		transition: none;
	}

	.yp-wa:hover {
		transform: none;
	}
}
