/**
 * WooCommerce Variation Cards Pro — frontend styles.
 *
 * Every color/size value below reads from a CSS custom property that the
 * plugin sets dynamically (see includes/class-wvcp-frontend.php) from the
 * WooCommerce > Settings > Variation Cards admin screen, so store owners
 * never need to edit this file directly.
 */

:root {
	--wvcp-radius: 12px;
	--wvcp-gap: 12px;
	--wvcp-border-color: #7f54b3;
	--wvcp-primary-color: #7f54b3;
	--wvcp-image-height: 140px;
	--wvcp-card-width: 110px;
	--wvcp-shadow: 0 2px 10px rgba(0, 0, 0, .08);
	--wvcp-image-ratio: 1 / 1;
	--wvcp-card-bg: #ffffff;
	--wvcp-card-blur: none;
}

/* Hide WooCommerce's native <select> once cards have taken over, but keep
   it in the DOM, focusable-equivalent, and fully functional for screen
   readers and no-JS fallback (progressive enhancement). */
.variations_form.wvcp-enhanced select {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wvcp-cards-container {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wvcp-gap);
	margin: 6px 0 4px;
	padding: 2px 0;
}

.wvcp-cards-container.wvcp-scroll {
	flex-wrap: nowrap;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	padding-bottom: 8px;
}

.wvcp-cards-container.wvcp-scroll::-webkit-scrollbar {
	height: 6px;
}

.wvcp-cards-container.wvcp-scroll::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, .15);
	border-radius: 10px;
}

/* ---------- Shared card base ---------- */

.wvcp-card {
	position: relative;
	cursor: pointer;
	border: 2px solid transparent;
	border-radius: var(--wvcp-radius);
	background: var(--wvcp-card-bg);
	backdrop-filter: var(--wvcp-card-blur);
	box-shadow: var(--wvcp-shadow);
	outline: 1px solid rgba(0, 0, 0, .08);
	outline-offset: -1px;
	scroll-snap-align: start;
	flex: 0 0 auto;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.wvcp-animations .wvcp-card {
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .18s ease;
}

.wvcp-animations .wvcp-card:hover:not(.wvcp-card--disabled) {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.wvcp-card:focus-visible {
	outline: 2px solid var(--wvcp-primary-color);
	outline-offset: 2px;
}

.wvcp-card--selected {
	border-color: var(--wvcp-border-color);
}

.wvcp-card--selected::after {
	content: "";
	position: absolute;
	top: 6px;
	right: 6px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--wvcp-border-color) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'></polyline></svg>") center / 11px no-repeat;
}

.wvcp-card--disabled {
	cursor: not-allowed;
	opacity: .38;
	filter: grayscale(35%);
}

.wvcp-card--disabled::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--wvcp-radius);
}

/* ---------- Image (Design/Color) cards ---------- */

.wvcp-card--image {
	width: var(--wvcp-card-width);
	overflow: hidden;
	text-align: center;
	padding-bottom: 8px;
}

.wvcp-card__image-wrap {
	width: 100%;
	aspect-ratio: var(--wvcp-image-ratio);
	height: var(--wvcp-image-height);
	overflow: hidden;
	border-radius: calc(var(--wvcp-radius) - 2px) calc(var(--wvcp-radius) - 2px) 0 0;
	background: #f5f5f5;
}

.wvcp-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wvcp-animations .wvcp-card--image:hover:not(.wvcp-card--disabled) .wvcp-card__image {
	transform: scale(1.06);
}

.wvcp-card__image {
	transition: transform .25s ease;
}

.wvcp-card__label {
	display: block;
	margin-top: 8px;
	padding: 0 6px;
	font-size: 12.5px;
	line-height: 1.3;
	font-weight: 500;
	color: #1e1e1e;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- Button (Size) cards ---------- */

.wvcp-card--button {
	padding: 10px 18px;
	min-width: 56px;
	text-align: center;
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: .01em;
	color: #1e1e1e;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wvcp-animations .wvcp-card--button:hover:not(.wvcp-card--disabled) {
	border-color: var(--wvcp-primary-color);
	color: var(--wvcp-primary-color);
}

.wvcp-card--button.wvcp-card--selected {
	background: var(--wvcp-border-color);
	color: #fff;
}

.wvcp-card--button.wvcp-card--selected::after {
	display: none;
}

/* ---------- Attribute group heading (reuses theme's existing label if present) ---------- */

.wvcp-attribute-label {
	font-weight: 600;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #444;
	margin: 4px 0 2px;
}

/* ---------- Mobile ---------- */

@media (max-width: 480px) {
	.wvcp-card--image {
		width: calc(var(--wvcp-card-width) * 0.9);
	}
}

/* Respect users who've asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.wvcp-card,
	.wvcp-card__image {
		transition: none !important;
	}

	.wvcp-animations .wvcp-card:hover:not(.wvcp-card--disabled) {
		transform: none;
	}
}
