/* =========================================================================
   Handknitted — WooCommerce product cards
   -------------------------------------------------------------------------
   Shared card styling for every product grid: the front-page rows
   (.hk-products wrappers) and the single-product "Other recommendations"
   section (section.related.products). Card spec from the Figma design:
   image / bold name / grey description / bold price — no add-to-cart.
   ========================================================================= */

:is(.hk-products, section.related.products) ul.products {
	display: grid;
	gap: clamp(0.75rem, 1.4vw, 1.25rem);
	margin: 0;
	padding: 0;
	list-style: none;
}
:is(.hk-products, section.related.products) ul.products::before,
:is(.hk-products, section.related.products) ul.products::after { content: none; } /* kill Woo clearfix */
:is(.hk-products, section.related.products) ul.products.columns-3 { grid-template-columns: repeat(3, 1fr); }
:is(.hk-products, section.related.products) ul.products.columns-4 { grid-template-columns: repeat(4, 1fr); }

:is(.hk-products, section.related.products) ul.products li.product {
	width: auto !important;
	margin: 0 !important;
	float: none !important;
	text-align: left;
}
:is(.hk-products, section.related.products) li.product a img {
	width: 100%;
	aspect-ratio: 428 / 541;
	/* contain, not cover: always show the WHOLE product photo — odd ratios
	   letterbox onto the light-grey backing instead of being cropped. */
	object-fit: contain;
	background: #fff; /* white letterbox — odd image ratios blend in */
	margin: 0 0 0.85rem;
	border-radius: 2px;
	display: block;
}
/* Product typography (Nexa: name + price bold, description grey) */
:is(.hk-products, section.related.products) li.product .woocommerce-loop-product__title {
	font-family: "Nexa", var(--hk-font);
	font-weight: 700;
	font-size: 1.25rem;      /* 20px */
	color: var(--hk-ink);
	padding: 0;
	margin: 0 0 0.1rem;
	line-height: 1.2;
}
:is(.hk-products, section.related.products) li.product .hk-loop-desc {
	font-family: "Nexa", var(--hk-font);
	font-weight: 400;
	font-size: 1.0625rem;    /* 17px */
	color: #8b8b8b;
	margin: 0 0 0.35rem;
	line-height: 1.3;
}
:is(.hk-products, section.related.products) li.product .price {
	font-family: "Nexa", var(--hk-font);
	font-weight: 700 !important;
	font-size: 1.25rem;      /* 20px */
	color: var(--hk-ink) !important;
	margin: 0;
}
:is(.hk-products, section.related.products) li.product .price del,
:is(.hk-products, section.related.products) li.product .price ins { font-weight: 700; }

/* "Export orders: $255.04" under the price: the net amount for orders shipped
   out of Iceland. Same grey and size as the description line, per the design. */
:is(.hk-products, section.related.products) li.product .hk-export-price {
	display: block;
	font-family: "Nexa", var(--hk-font);
	font-weight: 400;
	font-size: 1.0625rem;    /* 17px, matching .hk-loop-desc */
	color: #8b8b8b;
	margin: 0.15rem 0 0;
	line-height: 1.3;
}
/* wc_price() wraps the amount in WooCommerce's own price spans. */
:is(.hk-products, section.related.products) li.product .hk-export-price .woocommerce-Price-amount {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

/* Language options on pattern cards ("Product Overview - Uppskriftir"):
   2-column grid of bordered boxes, default language filled cyan. */
:is(.hk-products, section.related.products) li.product .hk-loop-langs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem;
	margin-top: 0.8rem;
}
:is(.hk-products, section.related.products) li.product .hk-loop-langs__opt {
	display: block;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--hk-line);
	border-radius: 2px;
	font-family: "Nexa", var(--hk-font);
	font-size: 0.875rem;
	line-height: 1.2;
	color: #8b8b8b;
	text-decoration: none;
	text-align: left;
}
:is(.hk-products, section.related.products) li.product .hk-loop-langs__opt:hover {
	border-color: var(--hk-brand);
	color: var(--hk-brand);
	text-decoration: none;
}
:is(.hk-products, section.related.products) li.product .hk-loop-langs__opt.is-active {
	background: var(--hk-brand);
	border-color: var(--hk-brand);
	color: #fff;
}

/* Hide the loop "Add to cart" button + rating on these grids (design shows
   image/name/desc/price only). !important beats WooCommerce's own selectors. */
:is(.hk-products, section.related.products) li.product .button,
:is(.hk-products, section.related.products) li.product .added_to_cart,
:is(.hk-products, section.related.products) li.product .star-rating { display: none !important; }

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
	:is(.hk-products, section.related.products) ul.products.columns-4,
	:is(.hk-products, section.related.products) ul.products.columns-3 { grid-template-columns: repeat(2, 1fr); }
}
