/**
 * Product cards (shop grid, homepage grids). Split out of shop.css in 1.10.0 so the
 * homepage can use the same card without loading the catalog page styles.
 */

/* ---------- Product grid: cards, 4 across on desktop, 3 on tablets, 2 on phones ---------- */
.bm-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}
.bm-gcard {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	border: 1px solid rgba(12, 34, 48, .08);
	border-radius: 16px;
	background: #fff;
	overflow: hidden;
	transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}
.bm-gcard:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 36px -24px rgba(12, 34, 48, .5);
}
.bm-gcard__media {
	position: relative;
	aspect-ratio: 1 / 1;
	background: #e3ebf0;
	overflow: hidden;
}
.bm-gcard__img {
	display: block;
	width: 100%;
	height: 100%;
}
.bm-gcard__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.bm-gcard:hover .bm-gcard__img img {
	transform: scale(1.04);
}
.bm-gcard.is-out .bm-gcard__img img {
	filter: grayscale(.55);
	opacity: .8;
}
.bm-gcard__off,
.bm-gcard__stock {
	position: absolute;
	top: 10px;
	padding: 4px 9px;
	border-radius: 999px;
	font-family: "IBM Plex Mono", monospace;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
}
.bm-gcard__off {
	right: 10px;
	background: var(--bm-ink);
	color: #ffc08a;
}
.bm-gcard__stock {
	left: 10px;
	background: rgba(255, 255, 255, .94);
	color: var(--bm-low-stock);
}
.bm-gcard__stock--out {
	color: var(--bm-out-stock);
}
.bm-gcard__coa {
	position: absolute;
	left: 10px;
	bottom: 10px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: calc(100% - 20px);
	padding: 5px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .94);
	box-shadow: 0 2px 8px rgba(12, 34, 48, .1);
	font-family: "IBM Plex Mono", monospace;
	font-size: 11px;
	font-weight: 500;
	color: var(--bm-ink);
	text-decoration: none;
	white-space: nowrap;
}
.bm-gcard__tick {
	color: var(--bm-teal-hover);
	font-weight: 700;
}
.bm-gcard__coalink {
	font-family: "IBM Plex Sans", Arial, sans-serif;
	color: #5c7480;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.bm-gcard__coa:hover .bm-gcard__coalink {
	color: var(--bm-teal-hover);
}
.bm-gcard__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 7px;
	padding: 14px 14px 16px;
}
.bm-gcard__name {
	font-size: 15.5px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--bm-ink);
	text-decoration: none;
}
.bm-gcard__name:hover {
	color: var(--bm-teal-hover);
}
.bm-gcard__meta {
	font-family: "IBM Plex Mono", monospace;
	font-size: 11px;
	letter-spacing: .03em;
	color: var(--bm-text-muted);
}
.bm-gcard__price {
	margin-top: auto;
	padding-top: 5px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--bm-ink);
}
.bm-gcard__price del {
	margin-right: 4px;
	font-size: 12.5px;
	font-weight: 400;
	color: var(--bm-text-strike);
}
.bm-gcard__price ins {
	color: #b84e14;
	text-decoration: none;
}
.bm-gcard__price .bm-codetag {
	display: table;
	margin: 6px 0 0;
}
.bm-gcard__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 7px;
}
.bm-gcard__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.bm-gcard__btn--ghost {
	border-color: var(--bm-border-strong);
	background: #fff;
	color: var(--bm-ink);
}
.bm-gcard__btn--ghost:hover {
	border-color: var(--bm-ink);
	color: var(--bm-ink);
}
.bm-gcard__btn--add {
	background: var(--bm-ink);
	color: #fff;
}
.bm-gcard__btn--add:hover,
.bm-gcard__btn--add:focus-visible {
	background: var(--bm-teal-hover);
	color: #fff;
}
.bm-gcard__btn--add[disabled] {
	opacity: .7;
	cursor: wait;
}
.bm-gcard__btn--off {
	background: #eef2f4;
	color: #8a9aa3;
	cursor: default;
}
.bm-gcard__btn .bm-spinner {
	width: 14px;
	height: 14px;
}
@media (max-width: 1099px) {
	.bm-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 14px;
	}
}
@media (max-width: 767px) {
	.bm-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
		margin-top: 12px;
	}
	.bm-gcard {
		border-radius: 14px;
	}
	.bm-gcard__off,
	.bm-gcard__stock {
		top: 8px;
		padding: 3px 7px;
		font-size: 10px;
	}
	.bm-gcard__off {
		right: 8px;
	}
	.bm-gcard__stock {
		left: 8px;
	}
	.bm-gcard__coa {
		left: 8px;
		bottom: 8px;
		gap: 5px;
		max-width: calc(100% - 16px);
		padding: 4px 8px;
		font-size: 10px;
	}
	.bm-gcard__body {
		gap: 6px;
		padding: 11px 10px 12px;
	}
	.bm-gcard__name {
		font-size: 14px;
	}
	.bm-gcard__meta {
		font-size: 10px;
	}
	.bm-gcard__price {
		font-size: 15.5px;
	}
	.bm-gcard__price del {
		font-size: 11.5px;
	}
	.bm-gcard__actions {
		gap: 6px;
	}
	.bm-gcard__btn {
		height: 36px;
		padding: 0 6px;
		font-size: 12.5px;
	}
}
@media (max-width: 359px) {
	.bm-gcard__coalink {
		display: none;
	}
}
@media (prefers-reduced-motion: reduce) {
	.bm-gcard,
	.bm-gcard__img img {
		transition: none;
	}
	.bm-gcard:hover,
	.bm-gcard:hover .bm-gcard__img img {
		transform: none;
	}
}
