/* ==========================================================================
   BikerDroid — product card (site-wide) and the default product grid.
   Markup comes from inc/product-card.php (WooCommerce loop hooks).
   Selectors start with `.bd-theme .bd-card` so they out-rank WooCommerce's
   `.woocommerce ul.products li.product …` rules without !important.
   ========================================================================== */

/* ---------- Default product grid (related, wishlist, shortcodes) ----------
   Shop archives refine this in shop.css. Rails (.bd-rail__track) are untouched. */
.bd-theme ul.products:not(.bd-rail__track) {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.bd-theme ul.products:not(.bd-rail__track)::before,
.bd-theme ul.products:not(.bd-rail__track)::after {
	content: none;
	display: none;
}
@media (min-width: 768px) {
	.bd-theme ul.products:not(.bd-rail__track) {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 40px 20px;
	}
}
@media (min-width: 1024px) {
	.bd-theme ul.products:not(.bd-rail__track) {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 44px 24px;
	}
	.bd-theme ul.products.columns-2:not(.bd-rail__track) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bd-theme ul.products.columns-3:not(.bd-rail__track) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
	.bd-theme ul.products.columns-5:not(.bd-rail__track) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.bd-theme ul.products.columns-6:not(.bd-rail__track) { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 40px 20px; }
}

/* ---------- Card shell ----------
   Cards often sit inside GeneratePress' .entry-content, which base.css styles as prose
   (list margins, gold-underlined links up to (0,5,1)). The card's own link rules below
   use matching specificity (`.product.bd-card …  a.…`) and win by source order. */
.bd-theme ul.products li.bd-card {
	--bd-card-r: 12px;
	--bd-card-pad: 7%;
	position: relative;
	display: flex;
	flex-direction: column;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	float: none;
	text-align: left;
	list-style: none;
}

/* ---------- Media frame ---------- */
.bd-theme ul.products li.bd-card .bd-card__media {
	position: relative;
	z-index: 2;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border: 1px solid var(--bd-line);
	border-radius: var(--bd-card-r);
	background: var(--bd-white);
	isolation: isolate;
	transition: transform var(--bd-dur-slow) var(--bd-ease-out), box-shadow var(--bd-dur-slow) var(--bd-ease-out), border-color var(--bd-dur) var(--bd-ease);
}
.bd-theme ul.products li.bd-card .bd-card__link {
	position: absolute;
	inset: 0;
	display: block;
	text-decoration: none;
}
.bd-theme ul.products li.bd-card .bd-card__img,
.bd-theme ul.products li.bd-card .bd-card__img-alt {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: var(--bd-card-pad);
	box-sizing: border-box;
	object-fit: contain;
	object-position: center;
	box-shadow: none;
	transform-origin: 50% 55%;
	transition: transform 0.7s var(--bd-ease-out), opacity 0.45s var(--bd-ease);
}
.bd-theme ul.products li.bd-card .bd-card__alt {
	position: absolute;
	inset: 0;
	display: block;
}
.bd-theme ul.products li.bd-card .bd-card__img-alt {
	opacity: 0;
}
.bd-theme ul.products li.bd-card.outofstock .bd-card__img {
	opacity: 0.55;
}

/* ---------- Badges ---------- */
.bd-theme ul.products li.bd-card .bd-card__badges {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	pointer-events: none;
}
.bd-theme ul.products li.bd-card .bd-badge {
	padding: 4px 8px;
	font-size: 10.5px;
	letter-spacing: 0.08em;
	font-variant-numeric: tabular-nums;
}

/* ---------- Wishlist heart (behaviour: wishlist.js) ---------- */
.bd-theme ul.products li.bd-card .bd-wish {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 4;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: var(--bd-r-pill);
	background: var(--bd-white);
	color: var(--bd-text);
	box-shadow: var(--bd-shadow-xs), inset 0 0 0 1px var(--bd-line);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform var(--bd-dur) var(--bd-ease), background-color var(--bd-dur) var(--bd-ease), color var(--bd-dur) var(--bd-ease);
}
.bd-theme ul.products li.bd-card .bd-wish::before {
	/* 44px touch target around the 38px visual */
	content: "";
	position: absolute;
	inset: -3px;
	border-radius: inherit;
}
.bd-theme ul.products li.bd-card .bd-wish .bd-icon {
	transition: fill var(--bd-dur) var(--bd-ease), transform var(--bd-dur) var(--bd-ease);
}
.bd-theme ul.products li.bd-card .bd-wish:hover {
	background: var(--bd-white);
	color: var(--bd-black);
}
.bd-theme ul.products li.bd-card .bd-wish:hover .bd-icon {
	transform: scale(1.1);
}
.bd-theme ul.products li.bd-card .bd-wish:active .bd-icon {
	transform: scale(0.9);
}
.bd-theme ul.products li.bd-card .bd-wish[aria-pressed="true"],
.bd-theme ul.products li.bd-card .bd-wish.is-active {
	color: var(--bd-black);
}
.bd-theme ul.products li.bd-card .bd-wish[aria-pressed="true"] .bd-icon,
.bd-theme ul.products li.bd-card .bd-wish.is-active .bd-icon {
	fill: var(--bd-gold);
	animation: bd-wish-pop 0.42s var(--bd-ease-out);
}
@keyframes bd-wish-pop {
	0% { transform: scale(0.7); }
	55% { transform: scale(1.22); }
	100% { transform: scale(1); }
}

/* ---------- Add to cart: touch (default) = compact gold icon button ---------- */
.bd-theme ul.products li.bd-card .bd-card__actions {
	position: absolute;
	right: 8px;
	bottom: 8px;
	z-index: 4;
	display: flex;
	justify-content: flex-end;
}
.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc {
	position: relative;
	display: inline-grid;
	place-items: center;
	grid-auto-flow: column;
	gap: 8px;
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--bd-r-pill);
	background: var(--bd-gold);
	color: var(--bd-black);
	box-shadow: var(--bd-shadow-sm);
	font-family: var(--bd-font-body);
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transform: none;
	-webkit-tap-highlight-color: transparent;
}
.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc::before {
	content: "";
	position: absolute;
	inset: -2px;
	border-radius: inherit;
}
.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc:hover {
	background: var(--bd-gold-400);
	color: var(--bd-black);
	transform: none;
}
.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc:active {
	transform: scale(0.94);
}
.bd-theme ul.products li.bd-card .bd-card__atc .bd-icon {
	grid-area: 1 / 1;
	flex: none;
}
.bd-theme ul.products li.bd-card .bd-card__atc-label,
.bd-theme ul.products li.bd-card .bd-card__atc-done span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}
.bd-theme ul.products li.bd-card .bd-card__atc-sub {
	display: none;
}
.bd-theme ul.products li.bd-card .bd-card__atc-done {
	display: none;
	grid-area: 1 / 1;
	align-items: center;
	gap: 8px;
}
.bd-theme ul.products li.bd-card .bd-card__atc.added > .bd-icon {
	display: none;
}
.bd-theme ul.products li.bd-card .bd-card__atc.added .bd-card__atc-done {
	display: inline-flex;
}
.bd-theme ul.products li.bd-card .bd-card__atc.added .bd-card__atc-label {
	display: none;
}
/* Sold out: quiet "view" button instead of a CTA. */
.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc--out {
	background: var(--bd-white);
	color: var(--bd-text-2);
	box-shadow: inset 0 0 0 1px var(--bd-line-2), var(--bd-shadow-xs);
}
.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc--out:hover {
	background: var(--bd-white);
	color: var(--bd-black);
}
.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc--options {
	background: var(--bd-black);
	color: var(--bd-white);
}
/* WooCommerce AJAX states */
.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc.loading {
	color: transparent;
}
.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc.loading::after {
	width: 16px;
	height: 16px;
	border-color: var(--bd-black) transparent var(--bd-black) transparent;
}
.bd-theme ul.products li.bd-card .added_to_cart {
	display: none;
}

/* ---------- Pointer devices: hover lift, zoom, crossfade, sliding black bar ---------- */
@media (hover: hover) and (pointer: fine) {
	.bd-theme ul.products li.bd-card:hover .bd-card__media {
		transform: translateY(-4px);
		border-color: var(--bd-line-2);
		box-shadow: var(--bd-shadow);
	}
	.bd-theme ul.products li.bd-card:hover .bd-card__img {
		transform: scale(1.05);
	}
	.bd-theme ul.products li.bd-card--has-alt:hover .bd-card__img {
		opacity: 0;
	}
	.bd-theme ul.products li.bd-card--has-alt:hover .bd-card__img-alt {
		opacity: 1;
		transform: scale(1.03);
	}
	.bd-theme ul.products li.bd-card.outofstock:hover .bd-card__img {
		opacity: 0.55;
	}
	.bd-theme ul.products li.bd-card.outofstock.bd-card--has-alt:hover .bd-card__img {
		opacity: 0;
	}
	.bd-theme ul.products li.bd-card.outofstock.bd-card--has-alt:hover .bd-card__img-alt {
		opacity: 0.6;
	}

	.bd-theme ul.products li.bd-card .bd-card__actions {
		left: 10px;
		right: 10px;
		bottom: 10px;
		opacity: 0;
		transform: translateY(calc(100% + 12px));
		transition: transform 0.38s var(--bd-ease-out), opacity 0.25s var(--bd-ease);
	}
	.bd-theme ul.products li.bd-card:hover .bd-card__actions,
	.bd-theme ul.products li.bd-card:focus-within .bd-card__actions,
	.bd-theme ul.products li.bd-card .bd-card__actions:has(.loading) {
		opacity: 1;
		transform: none;
	}
	.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		height: 44px;
		padding: 0 14px;
		border-radius: var(--bd-r-btn);
		background: var(--bd-black);
		color: var(--bd-white);
		box-shadow: var(--bd-shadow-sm);
		transition: background-color var(--bd-dur) var(--bd-ease), color var(--bd-dur) var(--bd-ease);
	}
	.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc::before {
		content: none;
	}
	.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc:hover {
		background: var(--bd-gold);
		color: var(--bd-black);
	}
	.bd-theme ul.products li.bd-card .bd-card__atc .bd-icon {
		grid-area: auto;
	}
	.bd-theme ul.products li.bd-card .bd-card__atc-label,
	.bd-theme ul.products li.bd-card .bd-card__atc-done span {
		position: static;
		width: auto;
		height: auto;
		overflow: visible;
		clip: auto;
	}
	.bd-theme ul.products li.bd-card .bd-card__atc.added .bd-card__atc-done {
		display: inline-flex;
		color: var(--bd-gold);
	}
	.bd-theme ul.products li.bd-card .bd-card__atc.added:hover .bd-card__atc-done {
		color: var(--bd-black);
	}
	.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc.loading {
		color: transparent;
	}
	.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc.loading::after {
		border-color: var(--bd-gold) transparent var(--bd-gold) transparent;
	}
	.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc--out {
		background: var(--bd-white);
		color: var(--bd-text-2);
		box-shadow: inset 0 0 0 1px var(--bd-line-2);
	}
	.bd-theme ul.products li.bd-card .bd-card__actions .bd-card__atc--out:hover {
		background: var(--bd-white);
		color: var(--bd-black);
		box-shadow: inset 0 0 0 1.5px var(--bd-black);
	}
	.bd-theme ul.products li.bd-card .bd-card__atc--out .bd-card__atc-label {
		display: inline-flex;
		align-items: center;
		gap: 8px;
	}
	.bd-theme ul.products li.bd-card .bd-card__atc--out .bd-card__atc-sub {
		display: inline;
		font-weight: 600;
		letter-spacing: 0.04em;
		text-transform: none;
		color: var(--bd-text-3);
	}
	.bd-theme ul.products li.bd-card .bd-card__atc--out .bd-card__atc-sub::before {
		content: "·";
		margin-right: 8px;
	}
	.bd-theme ul.products li.bd-card .bd-card__atc--out:hover .bd-card__atc-sub {
		color: var(--bd-text);
	}
}

/* ---------- Body ---------- */
.bd-theme ul.products li.bd-card .bd-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	padding: 14px 2px 0;
}
.bd-theme ul.products li.bd-card .bd-card__body a.bd-card__brand,
.bd-theme ul.products li.bd-card .bd-card__brand {
	position: relative;
	z-index: 3;
	align-self: flex-start;
	max-width: 100%;
	min-height: 15px;
	margin: 0 0 5px;
	overflow: hidden;
	color: var(--bd-text-3);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-decoration: none;
}
.bd-theme ul.products li.bd-card .bd-card__body a.bd-card__brand:hover {
	color: var(--bd-gold-ink);
}
.bd-theme ul.products li.bd-card .bd-card__body .bd-card__title {
	min-height: 2.8em;
	margin: 0;
	padding: 0;
	color: var(--bd-text);
	font-family: var(--bd-font-body);
	font-size: 14px;
	font-weight: 600;
	font-stretch: 100%;
	line-height: 1.4;
	letter-spacing: -0.003em;
	text-transform: none;
}
.bd-theme ul.products li.bd-card .bd-card__title a.bd-card__title-link {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	color: inherit;
	text-decoration: none;
	overflow-wrap: anywhere;
}
/* The title link covers the card body (media sits above it), so the whole tile is clickable. */
.bd-theme ul.products li.bd-card .bd-card__title-link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: var(--bd-card-r);
}
.bd-theme ul.products li.bd-card .bd-card__title a.bd-card__title-link:hover,
.bd-theme ul.products li.bd-card:hover .bd-card__title a.bd-card__title-link {
	color: var(--bd-text);
	text-decoration: underline;
	text-decoration-color: var(--bd-gold);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}
.bd-theme ul.products li.bd-card .bd-card__title-link:focus-visible {
	outline: none;
}
.bd-theme ul.products li.bd-card .bd-card__title-link:focus-visible::after {
	outline: 2px solid var(--bd-gold);
	outline-offset: 4px;
}

/* Rating (only rendered when the product has ratings) */
.bd-theme ul.products li.bd-card .bd-card__rating {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
	color: var(--bd-text-3);
	font-size: 12px;
	line-height: 1;
}
.bd-stars {
	--bd-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 15'%3E%3Cpath d='M7.05.98a1 1 0 0 1 1.9 0l1.33 3.8 4.02.09a1 1 0 0 1 .59 1.8l-3.2 2.43 1.16 3.85a1 1 0 0 1-1.54 1.11L8 11.8l-3.31 2.26a1 1 0 0 1-1.54-1.1l1.16-3.86L1.11 6.67a1 1 0 0 1 .59-1.8l4.02-.09z'/%3E%3C/svg%3E");
	position: relative;
	display: inline-block;
	flex: none;
	width: 78px;
	height: 14px;
	background: var(--bd-line-2);
	-webkit-mask: var(--bd-star) 0 0 / 15.6px 14px repeat-x;
	mask: var(--bd-star) 0 0 / 15.6px 14px repeat-x;
}
.bd-stars__fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	background: var(--bd-gold-600);
}

/* ---------- Price ---------- */
.bd-theme ul.products li.bd-card .bd-card__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	margin-top: auto;
	padding-top: 10px;
}
.bd-theme ul.products li.bd-card .bd-card__price .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
	margin: 0;
	color: var(--bd-text);
	font-family: var(--bd-font-display);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0;
	font-variant-numeric: tabular-nums;
}
.bd-theme ul.products li.bd-card .bd-card__price .price ins {
	order: -1;
	background: none;
	color: var(--bd-text);
	font-weight: 700;
	text-decoration: none;
}
.bd-theme ul.products li.bd-card .bd-card__price .price del {
	color: var(--bd-text-3);
	font-size: 13px;
	font-weight: 500;
	opacity: 1;
	text-decoration-thickness: 1px;
}
.bd-theme ul.products li.bd-card .bd-card__save {
	flex-basis: 100%;
	color: var(--bd-success);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
}
.bd-theme ul.products li.bd-card.outofstock .bd-card__price .price {
	color: var(--bd-text-3);
}

/* ---------- Small screens ---------- */
@media (max-width: 767px) {
	.bd-theme ul.products li.bd-card {
		--bd-card-pad: 6%;
	}
	.bd-theme ul.products li.bd-card .bd-card__badges {
		top: 8px;
		left: 8px;
		gap: 4px;
	}
	.bd-theme ul.products li.bd-card .bd-badge {
		padding: 3px 7px;
		font-size: 10px;
	}
	.bd-theme ul.products li.bd-card .bd-wish {
		top: 6px;
		right: 6px;
		width: 34px;
		height: 34px;
	}
	.bd-theme ul.products li.bd-card .bd-wish::before {
		inset: -5px;
	}
	.bd-theme ul.products li.bd-card .bd-card__actions {
		right: 6px;
		bottom: 6px;
	}
	.bd-theme ul.products li.bd-card .bd-card__body {
		padding-top: 12px;
	}
	.bd-theme ul.products li.bd-card .bd-card__body a.bd-card__brand,
	.bd-theme ul.products li.bd-card .bd-card__brand {
		font-size: 10.5px;
		letter-spacing: 0.12em;
	}
	.bd-theme ul.products li.bd-card .bd-card__body .bd-card__title {
		font-size: 13.5px;
	}
	.bd-theme ul.products li.bd-card .bd-card__price .price {
		font-size: 16px;
	}
	.bd-theme ul.products li.bd-card .bd-card__price .price del {
		font-size: 12.5px;
	}
	.bd-theme ul.products li.bd-card .bd-card__save {
		font-size: 11.5px;
	}
}

/* ---------- Cards on dark sections ---------- */
.bd-theme .bd-dark ul.products li.bd-card .bd-card__media,
.bd-theme .bd-section--dark ul.products li.bd-card .bd-card__media {
	border-color: transparent;
}
.bd-theme .bd-dark ul.products li.bd-card .bd-card__body a.bd-card__brand,
.bd-theme .bd-section--dark ul.products li.bd-card .bd-card__body a.bd-card__brand {
	color: var(--bd-on-dark-3);
}
.bd-theme .bd-dark ul.products li.bd-card .bd-card__body a.bd-card__brand:hover,
.bd-theme .bd-section--dark ul.products li.bd-card .bd-card__body a.bd-card__brand:hover {
	color: var(--bd-gold);
}
.bd-theme .bd-dark ul.products li.bd-card .bd-card__body .bd-card__title,
.bd-theme .bd-section--dark ul.products li.bd-card .bd-card__body .bd-card__title,
.bd-theme .bd-dark ul.products li.bd-card .bd-card__price .price,
.bd-theme .bd-section--dark ul.products li.bd-card .bd-card__price .price,
.bd-theme .bd-dark ul.products li.bd-card .bd-card__price .price ins,
.bd-theme .bd-section--dark ul.products li.bd-card .bd-card__price .price ins {
	color: var(--bd-on-dark);
}
.bd-theme .bd-dark ul.products li.bd-card .bd-card__title a.bd-card__title-link:hover,
.bd-theme .bd-section--dark ul.products li.bd-card .bd-card__title a.bd-card__title-link:hover,
.bd-theme .bd-dark ul.products li.bd-card:hover .bd-card__title a.bd-card__title-link,
.bd-theme .bd-section--dark ul.products li.bd-card:hover .bd-card__title a.bd-card__title-link {
	color: var(--bd-on-dark);
}
.bd-theme .bd-dark ul.products li.bd-card .bd-card__price .price del,
.bd-theme .bd-section--dark ul.products li.bd-card .bd-card__price .price del {
	color: var(--bd-on-dark-3);
}
.bd-theme .bd-dark ul.products li.bd-card .bd-card__save,
.bd-theme .bd-section--dark ul.products li.bd-card .bd-card__save {
	color: var(--bd-gold);
}
