/**
 * Product card (homepage rails): white card, 4:3 photo, title, rating,
 * swatches, price block + dark forest Add to Cart on one row.
 */

.hs-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--hs-white);
	border: 1px solid var(--hs-card-border);
	border-radius: var(--hs-radius-md);
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.hs-card:hover {
	border-color: var(--k-line-strong);
	box-shadow: var(--hs-shadow-card);
}

/* Media */
.hs-card__media {
	position: relative;
	background: var(--k-cream);
}

.hs-card__image-link {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.hs-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.hs-card:hover .hs-card__img {
	transform: scale(1.04);
}

.hs-card__badge {
	position: absolute;
	inset-block-start: 10px;
	inset-inline-end: 10px;
	padding: 3px 10px;
	border-radius: var(--hs-radius-pill);
	background: var(--k-sale);
	color: var(--k-white);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}

.hs-card__stock {
	position: absolute;
	inset-inline-start: 10px;
	inset-block-end: 10px;
	padding: 2px 9px;
	border-radius: var(--hs-radius-xs);
	background: rgba(62, 107, 79, 0.92);
	color: var(--hs-white);
	font-size: 12px;
	line-height: 1.5;
}

.hs-card__stock--out {
	background: rgba(35, 39, 35, 0.78);
}

.hs-card__stock--low {
	background: var(--k-sand-dark);
}

.hs-card__wish {
	position: absolute;
	inset-block-start: 10px;
	inset-inline-start: 10px;
	z-index: 1;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: var(--hs-shadow-soft);
	color: var(--k-forest-dark);
}

.hs-card__wish svg {
	width: 18px;
	height: 18px;
}

.hs-card__wish:hover {
	color: var(--k-sale);
}

/* Body */
.hs-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 6px;
	padding: 12px 14px 14px;
}

.hs-card__title {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.45;
	color: var(--k-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hs-card__title a:hover {
	color: var(--k-forest);
}

.hs-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 10px;
	min-height: 20px;
}

.hs-card__rating {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	line-height: 1;
}

.hs-card__rating-value {
	font-weight: 600;
	color: var(--k-text);
}

.hs-card__star {
	display: inline-flex;
	color: #D9A441;
}

.hs-card__rating-count {
	color: var(--k-muted);
}

/* Not rated yet: the same row, in grey. */
.hs-card__rating.is-empty .hs-card__rating-value,
.hs-card__rating.is-empty .hs-card__star {
	color: #C9C4BA;
}

.hs-card__variants {
	display: inline-flex;
	align-self: flex-start;
	padding: 2px 8px;
	border: 1px solid var(--k-line-strong);
	border-radius: var(--hs-radius-xs);
	font-size: 12px;
	line-height: 1.8;
	color: var(--k-muted);
}

.hs-card__variant + .hs-card__variant::before {
	content: '، ';
	white-space: pre;
}

[dir="ltr"] .hs-card__variant + .hs-card__variant::before {
	content: ', ';
}

/* Price + button row */
.hs-card__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px 10px;
	margin-top: auto;
	padding-top: 6px;
}

.hs-card__pricing {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.hs-card__from {
	margin-inline-end: 2px;
	font-size: 12px;
	font-weight: 400;
	color: var(--k-muted);
}

.hs-price-was {
	font-size: 13px;
	color: var(--k-muted);
	line-height: 1.3;
}

.hs-price {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	white-space: nowrap;
}

.hs-price__amount {
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--k-text);
}

.hs-price__currency {
	font-size: 14px;
	font-weight: 600;
	color: var(--k-text);
}

.hs-card.is-on-sale .hs-price__amount,
.hs-card.is-on-sale .hs-price__currency {
	color: var(--k-sale);
}

.hs-card__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
}

.hs-card .hs-card__cart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid var(--k-forest-dark);
	border-radius: var(--hs-radius-sm);
	background: var(--k-forest-dark);
	color: var(--k-white);
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Cart glyph before the label (mask keeps currentColor). */
.hs-card .hs-card__cart::before {
	content: '';
	width: 16px;
	height: 16px;
	flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2.2 10.2a1.5 1.5 0 0 0 1.5 1.2h8.6a1.5 1.5 0 0 0 1.5-1.1L21 8H6.2'/%3E%3Ccircle cx='9.5' cy='19.5' r='1'/%3E%3Ccircle cx='17' cy='19.5' r='1'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2.2 10.2a1.5 1.5 0 0 0 1.5 1.2h8.6a1.5 1.5 0 0 0 1.5-1.1L21 8H6.2'/%3E%3Ccircle cx='9.5' cy='19.5' r='1'/%3E%3Ccircle cx='17' cy='19.5' r='1'/%3E%3C/svg%3E") center / contain no-repeat;
}

.hs-card .hs-card__cart:hover,
.hs-card .hs-card__cart:focus-visible {
	background: var(--k-forest);
	border-color: var(--k-forest);
	color: var(--k-white);
}

/* Variable / grouped / external / out-of-stock: outline style (opens the product page). */
.hs-card .hs-card__cart:is(:not(.add_to_cart_button), .product_type_variable, .product_type_grouped, .product_type_external) {
	background: var(--k-white);
	color: var(--k-forest-dark);
}

.hs-card .hs-card__cart:is(:not(.add_to_cart_button), .product_type_variable, .product_type_grouped, .product_type_external)::before {
	display: none;
}

.hs-card .hs-card__cart:is(:not(.add_to_cart_button), .product_type_variable, .product_type_grouped, .product_type_external):hover,
.hs-card .hs-card__cart:is(:not(.add_to_cart_button), .product_type_variable, .product_type_grouped, .product_type_external):focus-visible {
	background: var(--k-forest-dark);
	color: var(--k-white);
}

.hs-card .hs-card__cart.loading {
	opacity: 0.65;
	pointer-events: none;
}

.hs-card .hs-card__cart.added::after {
	content: '✓';
	font-weight: 700;
}

.hs-card .added_to_cart {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--k-forest);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Swatches */
.hs-swatches {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px;
	padding-block: 2px;
}

.hs-swatch {
	position: relative;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--swatch, var(--k-cream));
	box-shadow: inset 0 0 0 1px rgba(35, 39, 35, 0.2);
}

.hs-swatch::after {
	content: '';
	position: absolute;
	inset: -3px;
	border-radius: 50%;
	border: 1.5px solid transparent;
	transition: border-color 0.15s ease;
}

.hs-swatch:hover::after {
	border-color: var(--k-line-strong);
}

.hs-swatch[aria-pressed="true"]::after {
	border-color: var(--k-forest);
}

.hs-swatch--multi {
	background: conic-gradient(#C7A97C, #9E2F2A, #6E4A8E, #2F5DA8, #2F4A3C, #C7A97C);
}

.hs-swatch--text {
	width: auto;
	height: 22px;
	padding: 0 8px;
	border-radius: 11px;
	background: var(--k-cream);
	color: var(--k-text);
	font-size: 11px;
	line-height: 22px;
	white-space: nowrap;
}

.hs-swatch--text::after {
	border-radius: 14px;
}

.hs-swatch.is-unavailable {
	opacity: 0.45;
}

.hs-swatch.is-unavailable:not(.hs-swatch--text)::before {
	content: '';
	position: absolute;
	inset-block-start: 50%;
	inset-inline: 1px;
	height: 1.5px;
	background: var(--k-text);
	transform: rotate(-45deg);
}

.hs-swatches__more {
	font-size: 12px;
	color: var(--k-muted);
}

.hs-swatches__more:hover {
	color: var(--k-forest);
}
