/* Halley Variation Price Builder 1.5.2 — opciones de fabricación y textos libres.
   El aspecto final lo dan Variation Swatches y el tema (las filas usan su mismo marcado y el JS
   presta la clase variable-items-wrapper). Aquí solo hay:
   1) lo imprescindible para que los radios reales no se vean cuando hay aspecto de swatches;
   2) un aspecto básico y funcional para cuando no hay JavaScript o Swatches no está activo. */

/* 1) Con aspecto de swatches: radio oculto visualmente pero accesible y validable. */
.hvpb-items.variable-items-wrapper .hvpb-radio,
.hvpb-items.variable-items-wrapper .hvpb-text:not(.hvpb-color-name) {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.hvpb-items.variable-items-wrapper label.variable-item-contents {
	margin: 0;
	cursor: pointer;
	font: inherit;
	color: inherit;
}

.hvpb-items.variable-items-wrapper .variable-item:focus-within {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* 2) Aspecto básico (sin JS o sin Swatches): lista de opciones con su radio visible. */
.hvpb-items:not(.variable-items-wrapper) {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hvpb-items:not(.variable-items-wrapper) label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	cursor: pointer;
}

.hvpb-items:not(.variable-items-wrapper) .variable-item-span-color {
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 1px solid rgba(0, 0, 0, 0.3);
}

/* Aviso de opción sin elegir (lo pinta el JS al intentar añadir al carrito). */
.hvpb-error {
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: #c0392b;
}

/* 1.4.0 — Texto libre que pide un valor (p. ej. diseño del acabado personalizado). */
.hvpb-note {
	margin: 10px 0 4px;
}

.hvpb-note[hidden] {
	display: none !important;
}

.hvpb-note-label {
	display: block;
	margin: 0 0 4px;
	font-size: 12px !important; /* el tema fija el tamaño de los <label> del formulario */
	font-weight: 400;
	line-height: 1.4;
	color: var(--halley-grey-text, #777777);
}

.hvpb-note-text {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-height: 72px;
	resize: vertical;
}

.hvpb-note-help {
	margin: 4px 0 0;
	font-size: 11px;
	line-height: 1.4;
	color: var(--halley-pink, #E13685);
}

.hvpb-note-help[hidden] {
	display: none;
}

/* La fila auxiliar solo existe hasta que el JS lleva el campo a la fila de su atributo. */
.hvpb-note-row td {
	padding-top: 0;
}

/* ─────────────────────────────────────────────────────────────
   1.5.0 — Textos de atributo, nombres de color y precio final.
   Colores con las variables del tema hijo (con respaldo).
   ───────────────────────────────────────────────────────────── */

/* Texto junto a la etiqueta («Included in price», «+80 €»…). En pantallas estrechas baja de línea solo. */
.hvpb-label-note {
	display: inline-block;
	text-transform: none !important; /* el tema pone la etiqueta de la fila en mayúsculas */
	letter-spacing: normal !important;
	margin-left: 12px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--halley-grey-text, #777777);
	vertical-align: baseline;
}

/* Texto al final del atributo. */
.hvpb-footer-note {
	margin: 8px 0 0;
	font-size: 11px;
	line-height: 1.4;
	color: var(--halley-grey-text, #777777);
}

/* 1.5.2 — El color llega hasta el borde de la muestra (Swatches deja 2px de padding y margen en el label). */
.hvpb-items.variable-items-wrapper li.color-variable-item.hvpb-item {
	padding: 0 !important;
}

.hvpb-items.variable-items-wrapper li.color-variable-item.hvpb-item .variable-item-contents {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	padding: 0;
}

.hvpb-items.variable-items-wrapper li.color-variable-item.hvpb-item .variable-item-span-color {
	display: block;
	width: 100% !important;
	height: 100% !important;
}

/* Nombre del color bajo cada muestra (una o dos líneas). */
.hvpb-items.variable-items-wrapper li.color-variable-item.hvpb-item {
	position: relative;
	margin-bottom: 32px !important; /* Swatches fija margin: 4px; hueco para dos líneas de nombre */
	overflow: visible;
}

.hvpb-items .hvpb-color-name {
	display: block;
	font-size: 9px;
	line-height: 1.3;
	font-weight: 400;
	text-align: left;
	color: var(--halley-grey-text, #777777);
	white-space: normal;
}

.hvpb-items.variable-items-wrapper .hvpb-color-name {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	margin-top: 4px;
	pointer-events: none;
}

/* Precio final bajo todos los atributos. */
.hvpb-total {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0 16px;
	margin: 16px 0;
	padding-top: 16px;
	border-top: 1px solid #ddd; /* mismo separador que las filas (hr de producto del Customizer) */
}

.hvpb-total[hidden] {
	display: none !important;
}

.hvpb-total-price {
	font-weight: 600;
}

.hvpb-total-price .price {
	margin: 0;
	font-size: inherit;
}
