/**
 * AV Product Family — swatches of the other products of the family.
 * Site palette: dark #19434c, accent #ddcb44, borders #e0e0e0.
 */

.avpf {
	margin: 0 0 20px;
	font: inherit;
	max-width: 100%;
}

/* "Color : Dark green" — like the woo-variation-swatches heading on the site */
.avpf .avpf__head {
	margin: 0 0 10px;
	padding: 0;
	font: inherit;
	line-height: 1.4;
	text-align: var(--avpf-align);
	/* One line whatever label is shown on hover: a wrapping heading would move the
	   swatches under the pointer (endless enter/leave flicker). The full label is in the tooltip. */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.avpf .avpf__axis {
	font-weight: 400;
}

.avpf .avpf__sep {
	margin: 0 0.3em;
}

.avpf .avpf__value {
	font-weight: 600;
}

/* List: reset theme styles for ul/li */
.avpf ul.avpf__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: var(--avpf-justify, flex-start);
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.avpf ul.avpf__list > li.avpf__item {
	position: relative;
	list-style: none;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
}

.avpf ul.avpf__list > li.avpf__item::before,
.avpf ul.avpf__list > li.avpf__item::after {
	content: none;
	display: none;
}

/* Swatch */
.avpf .avpf__swatch {
	position: relative;
	display: block;
	box-sizing: border-box;
	width: 64px;
	height: 64px;
	margin: 0;
	padding: 2px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: border-color 150ms ease, box-shadow 150ms ease;
}

.avpf .avpf__swatch img,
.avpf .avpf__swatch .avpf__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 2px;
	object-fit: cover;
	box-shadow: none;
}

.avpf a.avpf__swatch:hover,
.avpf a.avpf__swatch:focus {
	border-color: #19434c;
	text-decoration: none;
	z-index: 2;
}

.avpf a.avpf__swatch:focus:not(:focus-visible) {
	outline: none;
}

.avpf a.avpf__swatch:focus-visible {
	outline: 2px solid #ddcb44;
	outline-offset: 2px;
}

/* Current product: 2px frame without changing the size */
.avpf .avpf__item.is-current .avpf__swatch {
	border-color: #19434c;
	box-shadow: inset 0 0 0 1px #19434c;
	cursor: default;
}

/* Out of stock: faded photo + diagonal line, still clickable */
.avpf .avpf__item.is-out-of-stock .avpf__img {
	opacity: 0.45;
}

.avpf .avpf__item.is-out-of-stock .avpf__swatch::after {
	content: "";
	position: absolute;
	top: 2px;
	right: 2px;
	bottom: 2px;
	left: 2px;
	border-radius: 2px;
	background: linear-gradient(
		to top right,
		transparent calc(50% - 1px),
		rgba(25, 67, 76, 0.6) calc(50% - 1px),
		rgba(25, 67, 76, 0.6) calc(50% + 1px),
		transparent calc(50% + 1px)
	);
	pointer-events: none;
}

/* Tooltip: label, price, stock — only on devices that can hover */
.avpf .avpf__tip {
	display: none;
}

@media (hover: hover) {
	.avpf .avpf__tip {
		display: block;
		position: absolute;
		bottom: calc(100% + 8px);
		left: 50%;
		z-index: 20;
		box-sizing: border-box;
		width: max-content;
		max-width: calc(100vw - 32px); /* very long labels wrap instead of leaving the screen */
		margin: 0;
		padding: 6px 10px;
		border-radius: 4px;
		background: #19434c;
		color: #fff;
		font-size: 12px;
		font-weight: 400;
		line-height: 1.35;
		text-align: center;
		white-space: normal;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		/* --avpf-tip-shift: set by avpf-frontend.js to keep the tooltip inside the window */
		transform: translateX(calc(-50% + var(--avpf-tip-shift, 0px)));
		transition: opacity 150ms ease, visibility 150ms ease;
	}

	/* Arrow under the tooltip, centred on the swatch */
	.avpf a.avpf__swatch::before {
		content: "";
		position: absolute;
		bottom: calc(100% + 3px);
		left: 50%;
		z-index: 21;
		margin-left: -5px;
		border: 5px solid transparent;
		border-bottom-width: 0;
		border-top-color: #19434c;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 150ms ease, visibility 150ms ease;
	}

	/* Edge swatches: align the tooltip to the edge (no horizontal overflow) */
	.avpf .avpf__item:first-child .avpf__tip {
		left: 0;
		right: auto;
		transform: translateX(var(--avpf-tip-shift, 0px));
	}

	.avpf .avpf__item:last-child .avpf__tip {
		left: auto;
		right: 0;
		transform: translateX(var(--avpf-tip-shift, 0px));
	}

	.avpf a.avpf__swatch:hover .avpf__tip,
	.avpf a.avpf__swatch:focus-visible .avpf__tip,
	.avpf a.avpf__swatch:hover::before,
	.avpf a.avpf__swatch:focus-visible::before {
		opacity: 1;
		visibility: visible;
	}

	/* The shown tooltip can be hovered (it is inside the link, so the link keeps :hover);
	   the transparent bridge covers the gap between the tooltip and the swatch. */
	.avpf a.avpf__swatch:hover .avpf__tip,
	.avpf a.avpf__swatch:focus-visible .avpf__tip {
		pointer-events: auto;
	}

	.avpf .avpf__tip::after {
		content: "";
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		height: 8px;
	}

	/* Esc closes the tooltip until the pointer/focus moves to a swatch again (avpf-frontend.js) */
	.avpf.avpf--tip-off .avpf__item a.avpf__swatch .avpf__tip,
	.avpf.avpf--tip-off .avpf__item a.avpf__swatch::before {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}
}

.avpf .avpf__tip-label,
.avpf .avpf__tip-price,
.avpf .avpf__tip-stock {
	display: block;
}

.avpf .avpf__tip-label {
	font-weight: 600;
}

.avpf .avpf__tip-price,
.avpf .avpf__tip-stock {
	white-space: nowrap;
}

.avpf .avpf__tip-stock {
	opacity: 0.85;
}

/* Price inside the tooltip: white, whatever the theme does with .amount/del/ins */
.avpf .avpf__tip .avpf__tip-price,
.avpf .avpf__tip .avpf__tip-price * {
	color: #fff;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	background: none;
}

.avpf .avpf__tip .avpf__tip-price del {
	opacity: 0.7;
	margin-right: 4px;
	text-decoration: line-through;
}

.avpf .avpf__tip .avpf__tip-price ins {
	text-decoration: none;
}

.avpf .avpf__tip .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 480px) {
	.avpf .avpf__swatch {
		width: 56px;
		height: 56px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.avpf .avpf__swatch,
	.avpf .avpf__tip,
	.avpf a.avpf__swatch::before {
		transition: none;
	}
}

/* Elementor editor hint (shown only inside the editor) */
.avpf-editor-placeholder {
	padding: 12px 16px;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	background: #f6f7f7;
	color: #50575e;
	font-size: 13px;
	line-height: 1.5;
}
