/* ==========================================================================
   Chau Long Quick Product Variations - Frontend Shopee Swatches & Specs
   ========================================================================== */

/* Swatches Container */
.clqv-swatches {
	width: 100%;
	margin: 12px 0 16px;
	box-sizing: border-box;
}

.clqv-swatches-label {
	margin: 0 0 8px;
	color: #504842;
	font-weight: 600;
	font-size: 13.5px;
	line-height: 1.3;
}

.clqv-swatches-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

/* Single Variant Button (Shopee Style) */
.clqv-swatch-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-height: 56px;
	padding: 6px 10px;
	border: 1px solid #ddd7d2;
	border-radius: 7px;
	background: #ffffff;
	color: #3f3a36;
	text-align: left;
	cursor: pointer;
	box-shadow: none;
	font-weight: 500;
	font-size: 12.5px;
	line-height: 1.3;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
	box-sizing: border-box;
}

.clqv-swatch-item:hover {
	border-color: #b95432;
}

.clqv-swatch-item.is-selected {
	border-color: #b95432;
	background: #fff9f6;
	color: #b95432;
	font-weight: 600;
}

/* Shopee Red Corner Checkmark */
.clqv-swatch-item.is-selected:after {
	content: "";
	position: absolute;
	right: -1px;
	bottom: -1px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 0 0 16px 16px;
	border-color: transparent transparent #b95432 transparent;
}

.clqv-swatch-item.is-disabled {
	opacity: 0.38;
	cursor: not-allowed;
}

/* Thumbnail */
.clqv-swatch-thumb {
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	border-radius: 4px;
	overflow: hidden;
	background: #f6f3f1;
	display: flex;
	align-items: center;
	justify-content: center;
}

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

/* Title text */
.clqv-swatch-text {
	min-width: 0;
	overflow-wrap: anywhere;
	flex: 1;
}

/* Hide native WooCommerce select dropdown when swatches are present */
.clqv-native-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	opacity: 0 !important;
	pointer-events: none !important;
	margin: -1px !important;
	padding: 0 !important;
	border: 0 !important;
}

/* Remove / Hide redundant bottom variation details (price, description, specs box) */
.woocommerce-variation.single_variation,
.woocommerce-variation-description,
.woocommerce-variation-price,
.woocommerce-variation-availability,
.single_variation .woocommerce-Price-amount,
.clqv-specs-box,
#clqv-variant-specs-box {
	display: none !important;
}

.clqv-specs-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.clqv-spec-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	line-height: 1.4;
	color: #3f3a36;
	background: #ffffff;
	padding: 4px 10px;
	border-radius: 5px;
	border: 1px solid #e7ded7;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.clqv-spec-item.is-hidden {
	display: none !important;
}

.clqv-spec-label {
	font-weight: 600;
	color: #8c4a2a;
	font-size: 12px;
}

.clqv-spec-val {
	font-weight: 600;
	color: #2c2724;
}

@media (max-width: 767px) {
	.clqv-swatches-list {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
	.clqv-swatch-item {
		min-height: 50px;
		padding: 5px 8px;
		font-size: 11.5px;
	}
	.clqv-swatch-thumb {
		width: 36px;
		height: 36px;
		flex-basis: 36px;
	}
	.clqv-specs-box {
		padding: 8px 10px;
		margin: 10px 0 14px;
	}
	.clqv-spec-item {
		font-size: 12px;
		padding: 3px 8px;
	}
}
