/**
 * Frontend Swatches Stylesheet
 * Responsive and WoodMart compatible
 */

.bru-color-swatches-container {
	margin: 15px 0 20px 0;
	padding: 0;
	clear: both;
}

.bru-swatches-header {
	margin-bottom: 10px;
	font-size: 14px;
	color: #333333;
	display: flex;
	align-items: center;
	gap: 6px;
}

.bru-swatches-heading {
	font-weight: 600;
}

.bru-selected-color-name {
	font-weight: 700;
	color: var(--bru-swatch-sel-border, #2271b1);
}

.bru-swatches-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bru-swatch-gap, 8px);
	align-items: center;
}

.bru-swatch-item {
	position: relative;
	width: var(--bru-swatch-w, 60px);
	height: var(--bru-swatch-h, 60px);
	border-radius: var(--bru-swatch-radius, 4px);
	border: 1px solid var(--bru-swatch-border, #e1e1e1);
	box-sizing: border-box;
	cursor: pointer;
	overflow: hidden;
	transition: all 0.2s ease-in-out;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	outline: none;
}

.bru-swatch-item:hover {
	border-color: #999999;
	transform: translateY(-2px);
}

.bru-swatch-item:focus-visible {
	box-shadow: 0 0 0 2px var(--bru-swatch-sel-border, #2271b1);
}

.bru-swatch-item.bru-active {
	border: 2px solid var(--bru-swatch-sel-border, #2271b1);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	transform: scale(1.05);
}

.bru-swatch-thumb {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.bru-swatch-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

/* Out of stock styles */
.bru-swatch-item.bru-out-of-stock {
	opacity: 0.65;
}

.bru-swatch-item.bru-disabled {
	cursor: not-allowed;
	opacity: 0.4;
	filter: grayscale(70%);
}

.bru-swatch-item.bru-disabled:hover {
	transform: none;
	border-color: var(--bru-swatch-border, #e1e1e1);
}

.bru-oos-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 24px;
	line-height: 1;
	color: #d63638;
	font-weight: 700;
	pointer-events: none;
	text-shadow: 0 0 4px #ffffff;
}

/* Dynamic Stock Notice */
.bru-color-stock-notice {
	margin-top: 10px;
	font-size: 13px;
	line-height: 1.4;
}

.bru-color-stock-notice.bru-in-stock {
	color: #007017;
	font-weight: 600;
}

.bru-color-stock-notice.bru-out-of-stock {
	color: #d63638;
	font-weight: 600;
}

/* Validation Shake Animation */
@keyframes bruShake {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-6px); }
	40%, 80% { transform: translateX(6px); }
}

.bru-shake {
	animation: bruShake 0.4s ease-in-out;
}
