/* Product cards (includes/cards.php, templates/card.php). Colours come from the theme's own variables. */

.hbs-card-col {
	display: flex;
}

/* The theme's "bordered grid" draws lines between items; the cards have their own border. */
.products-bordered-grid .hbs-card-col {
	border: 0 !important;
}

.products-bordered-grid:has(> .hbs-card-col) {
	border: 0 !important;
}

.hbs-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	border: 1px solid #ececec;
	border-radius: 10px;
	background: #fff;
}

.hbs-card-media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: #fafafa;
}

.hbs-card-media img.hbs-card-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.hbs-card.is-out .hbs-card-media img {
	opacity: .45;
}

.hbs-card-flag {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 5px 7px;
	border-radius: 5px;
	background: var(--btn-accented-bgcolor, #e28b66);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
}

.hbs-card-flag.is-out {
	background: #6b6b6b;
}

.hbs-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 6px;
	padding: 10px;
}

.hbs-card-brand {
	color: var(--wd-primary-color, #439665);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .02em;
	text-transform: uppercase;
}

.hbs-card-name {
	display: -webkit-box;
	min-height: 2.7em;
	overflow: hidden;
	color: #222;
	font-size: 13px;
	line-height: 1.35;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.hbs-card .hbs-card-price {
	margin: 0;
	color: #222;
	font-size: 15px;
	font-weight: 700;
}

.hbs-card .hbs-card-price ins {
	text-decoration: none;
}

.hbs-card .hbs-card-price del {
	margin-left: 4px;
	color: #999;
	font-size: 12px;
	font-weight: 400;
}

.hbs-card-buy {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: auto;
}

.hbs-qty {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 34px;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
}

.hbs-card .hbs-qty-btn {
	width: 36px;
	height: 100%;
	min-height: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: #333;
	font-size: 18px;
	line-height: 1;
}

.hbs-card .hbs-qty-input {
	width: 42px;
	height: 100%;
	min-height: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: #222;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	-moz-appearance: textfield;
}

.hbs-card .hbs-qty-input::-webkit-inner-spin-button,
.hbs-card .hbs-qty-input::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.hbs-card .hbs-card-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 38px;
	min-height: 0;
	padding: 0 8px;
	border: 0;
	border-radius: 6px;
	background: var(--btn-accented-bgcolor, #e28b66);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-transform: none;
}

.hbs-card .hbs-card-btn:hover {
	background: var(--btn-accented-bgcolor-hover, #3d885c);
	color: #fff;
}

/* The side cart already shows the product, so the button never looks busy. */
.hbs-card .hbs-card-btn.loading {
	opacity: 1;
	color: #fff;
}

.hbs-card .hbs-card-btn.loading::after,
.hbs-card .hbs-card-btn::before,
.hbs-card .added_to_cart {
	display: none !important;
}

.hbs-card .hbs-card-btn.is-alt {
	margin-top: auto;
	border: 1px solid var(--wd-primary-color, #439665);
	background: #fff;
	color: var(--wd-primary-color, #439665);
}

.hbs-card .hbs-card-btn.is-disabled {
	margin-top: auto;
	background: #eee;
	color: #888;
	cursor: default;
}

@media (min-width: 1025px) {
	.hbs-card-name {
		font-size: 14px;
	}
}
