/* Attractive Product Variations - Frontend styles */

.apv-hidden-select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.apv-swatches {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 6px 0 12px;
	padding: 0;
}

.apv-swatch {
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	user-select: none;
	transition: all .15s ease-in-out;
	position: relative;
}

/* ---- نوع دکمه‌ای ---- */
.apv-swatches-button .apv-swatch {
	min-width: 42px;
	height: 40px;
	padding: 0 16px;
	border: 2px solid #d8d8d8;
	border-radius: 8px;
	background: #fff;
	font-size: 14px;
	color: #333;
}

.apv-swatches-button .apv-swatch:hover {
	border-color: #999;
}

.apv-swatches-button .apv-swatch.selected {
	border-color: var(--apv-accent, #2271b1);
	background: var(--apv-accent, #2271b1);
	color: #fff;
	box-shadow: 0 2px 6px rgba(34, 113, 177, .25);
}

.apv-swatches-button .apv-swatch.disabled {
	opacity: .35;
	cursor: not-allowed;
	text-decoration: line-through;
}

/* ---- نوع رنگی ---- */
.apv-swatches-color .apv-swatch {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	padding: 0;
	border: 2px solid transparent;
	box-shadow: 0 0 0 1px #ddd;
}

.apv-color-dot {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background-color: var(--apv-color, #eee);
	display: block;
	box-shadow: inset 0 0 0 2px #fff;
}

.apv-swatches-color .apv-swatch:hover {
	transform: scale(1.08);
}

.apv-swatches-color .apv-swatch.selected {
	border-color: var(--apv-accent, #2271b1);
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--apv-accent, #2271b1);
}

.apv-swatches-color .apv-swatch.disabled {
	opacity: .3;
	cursor: not-allowed;
}

.apv-swatches-color .apv-swatch.disabled::after {
	content: '';
	position: absolute;
	top: 50%;
	left: -4px;
	right: -4px;
	height: 2px;
	background: #999;
	transform: rotate(45deg);
}

.apv-swatch .apv-swatch-label {
	pointer-events: none;
}

.apv-swatches-color .apv-swatch-label {
	display: none;
}

/* ---- نوع تصویری ---- */
.apv-swatches-image .apv-swatch {
	width: 56px;
	height: 56px;
	padding: 0;
	border: 2px solid #d8d8d8;
	border-radius: 8px;
	overflow: hidden;
}

.apv-image-thumb {
	width: 100%;
	height: 100%;
	display: block;
}

.apv-image-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.apv-swatches-image .apv-swatch.selected {
	border-color: var(--apv-accent, #2271b1);
	box-shadow: 0 0 0 2px var(--apv-accent, #2271b1);
}

.apv-swatches-image .apv-swatch.disabled {
	opacity: .35;
	cursor: not-allowed;
}

.apv-swatches-image .apv-swatch-label {
	display: none;
}
