/* Product cards, the product grid and the category banner, as in the approved M4 category mockup
   (18 Oct 2026; mockup-src/pages/category.py + chrome.py QCARD_CSS). Markup: includes/cards.php
   and includes/shop.php. Loaded after buttons.css and type.css, so the card's own button and type
   sizes win here.

   Card:  li.product
            .wpcbm-wrapper > a.nl-card-photo ( .qav-thumb img, span.onsale, .qav-soldout, countdown )
            .nl-card-body ( .nl-card-info ( a.nl-card-name h2, .price ), sold bar, .nl-card-buy ) */

/* ---------------------------------------------------------------- grid
   Four across; a short last row is centred under the centred description and results line.
   Three across at 901–1100px, two on phones. Shop Kit's carousel track keeps its own layout. */
.woocommerce ul.products::before,
.woocommerce ul.products::after { content: none !important; display: none !important; }

.woocommerce ul.products:not(.qav-carousel-track) {
	--cols: 4;
	--gap: 20px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--gap);
	margin: 0;
	padding: 0;
	list-style: none;
}
.woocommerce ul.products:not(.qav-carousel-track) li.product {
	flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
	width: auto !important;
	margin: 0 !important;
	float: none !important;
}

/* ---------------------------------------------------------------- card */
.woocommerce ul.products li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
	padding: 0 !important;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--hj-line-2);
	border-radius: 8px;
	text-align: left;
}
.woocommerce ul.products li.product .wpcbm-wrapper { display: block; position: relative; }

/* photo: square, on blush; a slight zoom when pointed at */
.woocommerce ul.products li.product a.nl-card-photo {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: var(--nl-blush);
}
.woocommerce ul.products li.product a.nl-card-photo .qav-thumb { display: block; position: relative; height: 100%; overflow: hidden; background: none; }
.woocommerce ul.products li.product a.nl-card-photo img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	margin: 0;
	background: var(--nl-blush);
	transition: transform .6s ease;
}
@media (hover: hover) and (min-width: 901px) {
	.woocommerce ul.products li.product:hover a.nl-card-photo img { transform: scale(1.03); }
}

/* sale badge: white with rose lettering, top right; a flash sale turns it red with a bolt */
.woocommerce ul.products li.product span.onsale {
	position: absolute;
	top: 10px;
	right: 10px;
	left: auto;
	z-index: 2;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 5px 9px;
	border-radius: 4px;
	background: #fff;
	color: var(--nl-rose);
	font-family: var(--hj-sans);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .02em;
}
.woocommerce ul.products li.product.qav-flash-sale span.onsale {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	background: var(--hj-flash);
	color: #fff;
}
.woocommerce ul.products li.product.qav-flash-sale span.onsale::before {
	content: "";
	width: 12px;
	height: 12px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 2 4 13.5h6.5L9.5 22 20 9.5h-6.5z'/%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'%3E%3Cpath d='M13.5 2 4 13.5h6.5L9.5 22 20 9.5h-6.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* sold out: "Out of stock" pill top left, a softened photo (Shop Kit guards its label with !important) */
.woocommerce ul.products li.product .qav-soldout {
	position: absolute;
	top: 10px;
	left: 10px;
	right: auto;
	bottom: auto;
	z-index: 2;
	transform: none;
	padding: 5px 10px;
	border-radius: 999px;
	background: var(--nl-wine) !important;
	color: #fff !important;
	font-family: var(--hj-sans);
	font-size: 12px !important;
	font-weight: 700 !important;
	line-height: 1.2;
	letter-spacing: .02em !important;
	text-transform: none !important;
}
.woocommerce ul.products li.product.outofstock a.nl-card-photo img { filter: saturate(.55); opacity: .72; }
.woocommerce ul.products li.product.outofstock .hj-chip { display: none; }

/* name left, price right */
.nl-card-body { display: flex; flex-direction: column; flex: 1; background: #fff; }
.nl-card-info {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 15px 16px;
}
.woocommerce ul.products li.product a.nl-card-name { display: block; min-width: 0; color: var(--hj-ink); text-decoration: none; }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	margin: 0 !important;
	padding: 0;
	font-family: var(--hj-sans);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3 !important;
	letter-spacing: 0;
	text-align: left;
	color: var(--hj-ink) !important;
}
.woocommerce ul.products li.product a.nl-card-name:hover .woocommerce-loop-product__title { color: var(--nl-rose) !important; }

.woocommerce ul.products li.product .nl-card-info .price {
	flex: none;
	display: block;
	margin: 0 !important;
	font-family: var(--hj-sans);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	color: var(--nl-rose);
}
/* on sale: the sale price on top, the old price struck under it */
.woocommerce ul.products li.product .nl-card-info .price:has(del) {
	display: flex;
	flex-direction: column-reverse;
	align-items: flex-end;
	gap: 2px;
}
.woocommerce ul.products li.product .nl-card-info .price ins { background: none; font-weight: 700; text-decoration: none; color: var(--nl-rose); }
.woocommerce ul.products li.product .nl-card-info .price del { font-size: 14px; font-weight: 400; color: var(--hj-muted); opacity: 1; text-decoration-thickness: 1px; }

/* units-sold bars (flash sale) under the name and price */
.nl-card-body .hj-sold,
.nl-card-body .qav-sold-bar { margin: -6px 15px 14px; max-width: none; }

/* Add to cart: rose pill, full width, at the bottom of every card in a row */
.woocommerce ul.products li.product .nl-card-buy {
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	width: auto;
	height: 42px;
	min-height: 42px;
	margin: auto 15px 16px;
	padding: 0 10px;
	border: 1px solid var(--nl-rose);
	border-radius: 999px;
	background: var(--nl-rose);
	color: #fff;
	font-family: var(--hj-sans);
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .02em;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.woocommerce ul.products li.product .nl-card-buy:hover,
.woocommerce ul.products li.product .nl-card-buy:focus-visible { background: var(--hj-accent-hover); border-color: var(--hj-accent-hover); color: #fff; }
.woocommerce ul.products li.product .nl-card-buy:focus-visible { outline: 2px solid var(--nl-wine); outline-offset: 2px; }
/* Read more (sold out): the same pill, outlined, because it opens the product instead of adding */
.woocommerce ul.products li.product .nl-card-buy--more { background: #fff; color: var(--nl-rose); }
.woocommerce ul.products li.product .nl-card-buy--more:hover,
.woocommerce ul.products li.product .nl-card-buy--more:focus-visible { background: var(--nl-rose); border-color: var(--nl-rose); color: #fff; }
.woocommerce ul.products li.product .nl-card-buy.is-busy { opacity: .7; cursor: progress; }
.woocommerce ul.products li.product .nl-card-buy.is-added { background: var(--nl-mulberry); border-color: var(--nl-mulberry); }

@media (max-width: 1100px) and (min-width: 901px) {
	.woocommerce ul.products:not(.qav-carousel-track) { --cols: 3; }
}
@media (max-width: 900px) {
	.woocommerce ul.products:not(.qav-carousel-track) { --cols: 2; --gap: 12px; }
	.woocommerce ul.products li.product { border-radius: 6px; }
	.woocommerce ul.products li.product span.onsale { top: 8px; right: 8px; padding: 4px 7px; font-size: 12px; }
	.woocommerce ul.products li.product .qav-soldout { top: 8px; left: 8px; padding: 4px 8px; font-size: 11px !important; }
	/* phones: name and price centred, the price on one line */
	.nl-card-info { flex-direction: column; align-items: center; gap: 6px; padding: 6px 10px 10px; text-align: center; }
	.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 13px; text-align: center; }
	.woocommerce ul.products li.product .nl-card-info .price { font-size: 15px; text-align: center; white-space: normal; }
	.woocommerce ul.products li.product .nl-card-info .price:has(del) {
		flex-direction: row-reverse;
		flex-wrap: wrap-reverse;
		align-items: baseline;
		justify-content: center;
		gap: 0 7px;
	}
	.nl-card-body .hj-sold,
	.nl-card-body .qav-sold-bar { margin: -2px 10px 10px; }
	.woocommerce ul.products li.product .nl-card-buy { height: 40px; min-height: 40px; margin: auto 10px 10px; font-size: 14px; }
}

/* ---------------------------------------------------------------- category banner (includes/shop.php)
   The category photo full width with the name at the bottom-left; a plum band when there is no photo. */
.nl-cb { position: relative; overflow: hidden; background: var(--nl-blush); }
.nl-cb .nl-cb-img { display: block; width: 100%; max-width: none; height: clamp(260px, 30vw, 480px); object-fit: cover; object-position: 30% 46%; }
.nl-cb:not(.nl-cb--plain)::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, rgba(60, 15, 40, .42), rgba(60, 15, 40, 0) 46%);
	pointer-events: none;
}
.nl-cb .nl-cb-title {
	position: absolute;
	z-index: 2;
	left: clamp(16px, 3.4vw, 64px);
	bottom: clamp(18px, 3vw, 44px);
	margin: 0;
	padding: 0;
	font-family: var(--hj-serif);
	font-size: clamp(32px, 3.4vw, 50px);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
	text-shadow: 0 1px 14px rgba(60, 15, 40, .35);
}
.nl-cb--plain { background: var(--nl-plum); }
.nl-cb--plain .nl-cb-title {
	position: static;
	max-width: 1440px;
	margin-inline: auto;
	padding: clamp(36px, 5vw, 64px) clamp(16px, 3.4vw, 64px);
	text-shadow: none;
}
@media (max-width: 900px) {
	.nl-cb .nl-cb-img { height: auto; aspect-ratio: 4 / 3; object-position: 22% 50%; }
	.nl-cb .nl-cb-title { left: 16px; right: 16px; bottom: 16px; font-size: 30px; text-align: center; }
	.nl-cb--plain .nl-cb-title { padding: 30px 16px; }
}

/* ---------------------------------------------------------------- listing page: white cards on a soft blush page */
body.woocommerce.archive { background: var(--nl-blush); }
body.woocommerce.archive main.site-main {
	max-width: 1440px;
	margin-inline: auto;
	padding: 30px clamp(16px, 3.4vw, 64px) 88px;
}
body.woocommerce.archive .term-description,
body.woocommerce.archive .page-description {
	max-width: 64ch;
	margin: 0 auto 26px;
	font-size: 16px;
	line-height: 1.6;
	text-align: center;
	color: var(--hj-ink-2);
}
body.woocommerce.archive .term-description p,
body.woocommerce.archive .page-description p { margin: 0; }
body.woocommerce.archive .woocommerce-result-count {
	float: none;
	margin: 0 0 18px;
	font-size: 15px;
	text-align: center;
	color: var(--hj-ink);
}
@media (max-width: 900px) {
	body.woocommerce.archive main.site-main { padding: 20px 16px 56px; }
	body.woocommerce.archive .term-description,
	body.woocommerce.archive .page-description { margin-bottom: 18px; }
	body.woocommerce.archive .woocommerce-result-count { margin-bottom: 14px; }
}

/* ---------------------------------------------------------------- grouped category page (includes/category-groups.php)
   Approved mockup 19 Oct 2026 (mockup-src/pages/category_grouped.py): before each sub-category's grid,
   its name centred between two thin plum lines, and the product count under it. */
body.woocommerce.archive .tn-cg + .tn-cg { margin-top: 56px; }
body.woocommerce.archive .tn-cg-sep {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 34px 0 4px;
	font-family: var(--hj-serif);
	font-weight: 700;
	font-size: clamp(22px, 1.9vw, 28px);
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	color: var(--hj-ink);
	text-wrap: balance;
}
body.woocommerce.archive .tn-cg-sep::before,
body.woocommerce.archive .tn-cg-sep::after { content: ""; flex: 1 1 0; height: 1px; background: rgba(142, 31, 91, .28); }
body.woocommerce.archive .tn-cg-name { flex: none; max-width: 70%; text-align: center; }
body.woocommerce.archive .tn-cg-count { margin: 0 0 20px; font-size: 14px; text-align: center; color: var(--hj-ink-2); }
@media (max-width: 900px) {
	body.woocommerce.archive .tn-cg + .tn-cg { margin-top: 40px; }
	body.woocommerce.archive .tn-cg-sep { gap: 12px; margin-top: 26px; font-size: 21px; }
	body.woocommerce.archive .tn-cg-count { margin-bottom: 14px; font-size: 13px; }
}

/* ---------------------------------------------------------------- option sheet (includes/cards.php, assets/cards.js)
   A bottom sheet: the product name, the picked option's photo and price, the options as photo tiles,
   and a full-width Add to cart. Under the flying photo (.nl-fly), above everything else. */
html.nl-osh-lock { overflow: hidden; }
.nl-osh { position: fixed; inset: 0; z-index: 99990; display: flex; align-items: flex-end; justify-content: center; }
.nl-osh[hidden] { display: none; }
.nl-osh-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .25s ease; }
.nl-osh-sheet {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 560px;
	max-height: 85vh;
	max-height: 85dvh;
	background: #fff;
	border-radius: 16px 16px 0 0;
	transform: translateY(100%);
	transition: transform .25s cubic-bezier(.32, .72, 0, 1);
}
.nl-osh.is-open .nl-osh-bg { opacity: 1; }
.nl-osh.is-open .nl-osh-sheet { transform: none; }
.nl-osh-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 10px 12px 20px;
	border-bottom: 1px solid var(--hj-line-2);
}
.nl-osh .nl-osh-title { margin: 0; font-family: var(--hj-sans); font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: 0; text-transform: none; color: var(--hj-ink); }
/* buttons reset: Hello's reset paints every button pink on hover and focus */
.nl-osh button { font-family: inherit; text-transform: none; letter-spacing: 0; }
.nl-osh .nl-osh-x {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--hj-ink);
	cursor: pointer;
}
.nl-osh .nl-osh-x:hover,
.nl-osh .nl-osh-x:focus { background: var(--nl-blush); color: var(--hj-ink); }
.nl-osh .nl-osh-x:focus-visible { outline: 2px solid var(--nl-wine); outline-offset: 1px; }
.nl-osh-body { flex: 1; overflow-y: auto; padding: 20px; overscroll-behavior: contain; }
.nl-osh-cur { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.nl-osh-cur img { flex: none; width: 80px; height: 80px; margin: 0; object-fit: cover; border-radius: 10px; background: var(--nl-blush); }
.nl-osh .nl-osh-price {
	display: flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	align-items: baseline;
	gap: 8px;
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
	color: var(--nl-rose);
}
.nl-osh .nl-osh-price ins { background: none; text-decoration: none; }
.nl-osh .nl-osh-price del { font-size: 14px; font-weight: 400; color: var(--hj-muted); }
.nl-osh-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--hj-line-2); }
.nl-osh .nl-osh-add {
	display: block;
	width: 100%;
	height: 48px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: var(--nl-rose);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background .2s ease;
}
.nl-osh .nl-osh-add:hover,
.nl-osh .nl-osh-add:focus { background: var(--hj-accent-hover); color: #fff; }
.nl-osh .nl-osh-add:focus-visible { outline: 2px solid var(--nl-wine); outline-offset: 2px; }

/* option tiles: photo with a small name under it; the picked one gets a rose ring */
.nl-vt-lbl { margin: 0 0 10px; font-size: 13px; color: var(--hj-ink-2); }
.nl-vt-lbl b { color: var(--hj-ink); font-weight: 700; }
.nl-vt-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 10px; }
.nl-osh .nl-vt {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: none;
	color: var(--hj-ink-2);
	text-align: center;
	cursor: pointer;
}
.nl-osh .nl-vt:hover,
.nl-osh .nl-vt:focus { background: none; color: var(--hj-ink-2); }
.nl-vt img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	margin: 0;
	object-fit: cover;
	border: 1.5px solid var(--hj-line-2);
	border-radius: 10px;
	background: var(--nl-blush);
	transition: border-color .15s ease;
}
.nl-vt span {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 11px;
	line-height: 1.25;
	white-space: normal; /* Hello's button reset is nowrap */
	overflow-wrap: anywhere;
}
@media (hover: hover) { .nl-osh .nl-vt:hover img { border-color: var(--nl-rose); } }
.nl-osh .nl-vt[aria-pressed="true"] img { border-color: var(--nl-rose); box-shadow: 0 0 0 1px var(--nl-rose); }
.nl-osh .nl-vt[aria-pressed="true"] span { color: var(--nl-rose); font-weight: 700; }
.nl-osh .nl-vt:focus-visible { outline: 2px solid var(--nl-wine); outline-offset: 3px; }
/* a sold-out option: faded with a line across, can't be picked */
.nl-osh .nl-vt:disabled { cursor: not-allowed; opacity: .45; }
.nl-osh .nl-vt:disabled::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	aspect-ratio: 1 / 1;
	border-radius: 10px;
	background: linear-gradient(to top right, transparent 48.5%, var(--hj-muted) 49.5% 50.5%, transparent 51.5%);
}
@media (max-width: 600px) {
	.nl-osh-body { padding: 16px; }
	.nl-vt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) {
	.nl-osh-bg, .nl-osh-sheet { transition: none; }
	.woocommerce ul.products li.product a.nl-card-photo img { transition: none; }
}
