/* Shared by the homepage variation carousel, shop archive and related cards. */
.wc-vc-card {
	--aj-card-ink: #25282d;
	--aj-card-muted: #74777d;
	--aj-card-line: #e4e4e1;
	font-family: inherit;
	color: var(--aj-card-ink);
}

.wc-vc-card-image {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #fff;
}

.wc-vc-card-image > a,
.wc-vc-card-image > picture,
.wc-vc-card-image img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	min-width: 0;
	min-height: 0;
	object-fit: contain;
	transition: opacity .18s ease, transform .28s ease;
}

.wc-vc-card-image > a {
	display: flex;
	align-items: center;
	justify-content: center;
}

.wc-vc-card-image > picture {
	position: absolute;
	inset: 0;
}

.wc-vc-card-image > picture img {
	object-fit: contain;
}

.wc-vc-card-image img.is-changing {
	opacity: .35;
}

.wc-vc-card:hover .wc-vc-card-image img {
	transform: scale(1.015);
}

/* Product names follow the storefront font and occupy one predictable row. */
.wc-vc-card .wc-vc-title,
.wc-vc-card .wc-vc-title a {
	display: block;
	overflow: hidden;
	margin: 16px 0 8px;
	color: var(--aj-card-ink);
	font-family: inherit;
	font-size: clamp(17px, 1.25vw, 21px);
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aj-carousel-shop-cards .wc-vc-title {
	min-height: 1.3em !important;
}

.wc-vc-card .wc-vc-price,
.wc-vc-card .wc-vc-price .price {
	font-family: inherit;
}

/* Hide wholesale/carton attributes from the retail-facing card. */
.wc-vc-card .wc-vc-attr-row[data-attribute-name*="pack"],
.wc-vc-card .wc-vc-attr-row[data-attribute-name*="carton"],
.wc-vc-card .wc-vc-attr-row[data-attribute-name*="unit"] {
	display: none !important;
}

/* Color options are compact swatches, never large text pills. */
.wc-vc-card .wc-vc-attr-row[data-attribute-name*="color"] .wc-vc-swatch,
.wc-vc-card .wc-vc-attr-row[data-attribute-name*="colour"] .wc-vc-swatch {
	box-sizing: border-box;
	width: 30px;
	height: 30px;
	min-width: 30px;
	padding: 0;
	border: 2px solid rgba(37, 40, 45, .16);
	border-radius: 50%;
	font-size: 0;
	line-height: 0;
}

.wc-vc-card .wc-vc-attr-row[data-attribute-name*="color"] .wc-vc-swatch.selected,
.wc-vc-card .wc-vc-attr-row[data-attribute-name*="colour"] .wc-vc-swatch.selected {
	border-color: var(--aj-card-ink);
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--aj-card-ink);
}

/* The renderer may give a named color button its normal text-button rules.
 * Keep the accessible label, but show only the color circle. */
.wc-vc-card .wc-vc-attr-row.aj-color-attr-row .wc-vc-swatch {
	box-sizing: border-box !important;
	width: 30px !important;
	height: 30px !important;
	min-width: 30px !important;
	max-width: 30px !important;
	padding: 0 !important;
	overflow: hidden !important;
	border-radius: 50% !important;
	color: transparent !important;
	font-size: 0 !important;
	line-height: 0 !important;
	text-indent: -9999px !important;
	white-space: nowrap !important;
}

.wc-vc-card .wc-vc-attr-row.aj-color-attr-row .wc-vc-swatch * {
	color: transparent !important;
	font-size: 0 !important;
	line-height: 0 !important;
}

.wc-vc-card .wc-vc-attr-row.aj-color-attr-row .wc-vc-swatch.selected {
	border-color: var(--aj-card-ink) !important;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--aj-card-ink) !important;
}

.wc-vc-card .wc-vc-attr-row[data-attribute-name*="size"] .wc-vc-swatch {
	min-height: 34px;
	padding: 6px 12px;
	border: 1px solid var(--aj-card-line);
	border-radius: 4px;
	font-size: 13px;
	line-height: 1.2;
}

.wc-vc-card .wc-vc-attr-row[data-attribute-name*="size"] .wc-vc-swatch.selected {
	color: #fff;
	border-color: var(--aj-card-ink);
	background: var(--aj-card-ink);
}

/* Keep larger size sets compact on every variation-card placement. */
.wc-vc-card .wc-vc-attr-row.aj-size-dropdown-row .aj-size-option-hidden {
	display: none !important;
}

.wc-vc-card .aj-size-dropdown {
	box-sizing: border-box;
	width: min(150px, 100%);
	min-height: 34px;
	margin: 0;
	padding: 6px 30px 6px 10px;
	color: var(--aj-card-ink);
	border: 1px solid var(--aj-card-line);
	border-radius: 4px;
	background-color: #fff;
	font: inherit;
	font-size: 13px;
	line-height: 1.2;
}

.aj-card-badges {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	max-width: calc(100% - 28px);
	pointer-events: none;
}

.aj-card-badge {
	display: inline-flex;
	align-items: center;
	min-height: 25px;
	padding: 4px 9px;
	border-radius: 4px;
	color: #fff;
	background: #25282d;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
}

.aj-card-badge--sale { background: #e85d4a; }
.aj-card-badge--shipping { background: #198754; }
.aj-card-badge--seller { background: #ef493c; }

@media (max-width: 560px) {
	.wc-vc-card .wc-vc-title,
	.wc-vc-card .wc-vc-title a {
		font-size: 17px;
	}
}
