/* ============================================
   WEBUP VARIATION SWATCHES - PRODUCT PAGE
   ============================================ */

.webup-variation-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 10px 0 20px 0;
}

.webup-swatch-item {
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
}

.webup-swatch-item.disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

/* Color Swatches */
.webup-swatch-type-color .webup-swatch-item {
	width: 44px;
	height: 44px;
}

.webup-swatch-color {
	display: block;
	width: 100%;
	height: 100%;
	border: 3px solid #e0e0e0;
	border-radius: 50%;
	transition: all 0.2s ease;
}

.webup-swatch-item:hover .webup-swatch-color {
	border-color: #999;
	transform: scale(1.05);
}

.webup-swatch-item.selected .webup-swatch-color {
	border-color: #4CAF50;
	border-width: 4px;
	box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Image Swatches */
.webup-swatch-type-image .webup-swatch-item {
	width: 50px;
	height: 50px;
}

.webup-swatch-image {
	display: block;
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	border: 3px solid #e0e0e0;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.webup-swatch-item:hover .webup-swatch-image {
	border-color: #999;
	transform: scale(1.05);
}

.webup-swatch-item.selected .webup-swatch-image {
	border-color: #4CAF50;
	border-width: 4px;
	box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Button/Text Swatches */
.webup-swatch-type-button .webup-swatch-item {
	min-width: 50px;
}

.webup-swatch-button,
.webup-swatch-text {
	display: inline-block;
	padding: 10px 16px;
	background: #f5f5f5;
	border: 2px solid #e0e0e0;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.webup-swatch-item:hover .webup-swatch-button,
.webup-swatch-item:hover .webup-swatch-text {
	border-color: #999;
	background: #fff;
}

.webup-swatch-item.selected .webup-swatch-button,
.webup-swatch-item.selected .webup-swatch-text {
	background: #4CAF50;
	border-color: #4CAF50;
	color: white;
}

/* Selected indicator for color/image swatches */
.webup-swatch-item.selected::after {
	content: '✓';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: white;
	font-weight: bold;
	font-size: 18px;
	text-shadow: 0 0 3px rgba(0,0,0,0.5);
	pointer-events: none;
}

.webup-swatch-type-button .webup-swatch-item.selected::after {
	display: none;
}

/* Tooltip */
.webup-swatch-item::before {
	content: attr(title);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	padding: 6px 10px;
	background: #333;
	color: white;
	font-size: 12px;
	border-radius: 4px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	z-index: 10;
}

.webup-swatch-item:hover::before {
	opacity: 1;
}

/* Hide tooltip for button type (already shows text) */
.webup-swatch-type-button .webup-swatch-item::before {
	display: none;
}

/* Out of stock styling */
.webup-swatch-item.out-of-stock {
	opacity: 0.4;
	position: relative;
}

.webup-swatch-item.out-of-stock::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 2px;
	background: #e74c3c;
	transform: translateY(-50%) rotate(-45deg);
}

/* WooCommerce reset notice (shown by default) */
.reset_variations {
	margin-top: 10px;
	font-size: 13px;
}

/* Mobile responsive */
@media (max-width: 768px) {
	.webup-variation-swatches {
		gap: 8px;
	}

	.webup-swatch-type-color .webup-swatch-item {
		width: 40px;
		height: 40px;
	}

	.webup-swatch-type-image .webup-swatch-item {
		width: 45px;
		height: 45px;
	}

	.webup-swatch-button,
	.webup-swatch-text {
		padding: 8px 12px;
		font-size: 13px;
	}
}

/* Loading state */
.webup-variation-swatches.loading {
	opacity: 0.5;
	pointer-events: none;
}