/**
 * Helios Labs Replica — shop / category / search archive.
 *
 * Depends on hl-card.css (sitewide) for the product card itself. Nothing here
 * restyles a card; if a card is wrong, fix it in hl-card.css so every surface
 * gets the fix.
 *
 * Tokens come from hl-tokens.css — measured off the source, never invented:
 *   --hl-granite #050504 · --hl-layer #100e0c · --hl-bone #f7f2e8
 *   --hl-stone #8c867c · --hl-faint #857f75 · --hl-hairline #2a2723
 *   --hl-glacier #fc5501
 */

/* ---------------------------------------------------------------- shell -- */
.hl-shop {
	background: var(--hl-granite, #050504);
	padding-bottom: 96px;
}

.hl-crumb {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 28px 0 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.68rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--hl-faint, #857f75);
}

.hl-crumb a {
	color: var(--hl-faint, #857f75);
	text-decoration: none;
}

.hl-crumb a:hover,
.hl-crumb a:focus-visible {
	color: var(--hl-glacier, #fc5501);
}

.hl-crumb .sep {
	opacity: 0.5;
}

/* --------------------------------------------------------------- header -- */
.hl-shop__head {
	padding: 24px 0 32px;
	border-bottom: 1px solid var(--hl-hairline, #2a2723);
}

.hl-shop__h1 {
	margin: 6px 0 0;
	text-transform: uppercase;
	color: var(--hl-glacier, #fc5501);
}

.hl-shop__sub {
	margin: 12px 0 0;
	max-width: 46ch;
	color: var(--hl-stone, #8c867c);
	line-height: 1.625; /* source uses leading-relaxed throughout, never 1.7 */
}

/* -------------------------------------------------------- category tiles -- */
.hl-tiles {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 10px;
	margin: 28px 0 0;
	padding: 0;
	list-style: none;
}

.hl-tiles__i > a {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 2px;
	min-height: 104px;
	padding: 14px;
	overflow: hidden;
	background: var(--hl-card, #0c0c0c);
	border: 1px solid var(--hl-hairline, #2a2723);
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hl-tiles__i > a:hover,
.hl-tiles__i > a:focus-visible {
	border-color: var(--hl-glacier, #fc5501);
	background: #110d0a;
}

.hl-tiles__i.is-current > a {
	border-color: var(--hl-glacier, #fc5501);
	background: rgba(252, 85, 1, 0.1);
}

.hl-tiles__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.16;
	pointer-events: none;
}

.hl-tiles__n {
	position: relative;
	font-family: var(--hl-font-condensed, Anton, "Arial Narrow", sans-serif);
	font-size: 1.5rem;
	line-height: 1;
	color: var(--hl-bone, #f7f2e8);
}

.hl-tiles__i.is-current .hl-tiles__n {
	color: var(--hl-glacier, #fc5501);
}

.hl-tiles__l {
	position: relative;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.62rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hl-stone, #8c867c);
}

/* ------------------------------------------------------ subcategory chips -- */
.hl-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.hl-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px;
	border: 1px solid var(--hl-hairline, #2a2723);
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.64rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hl-stone, #8c867c);
	text-decoration: none;
}

.hl-chip:hover,
.hl-chip:focus-visible {
	border-color: var(--hl-glacier, #fc5501);
	color: var(--hl-glacier, #fc5501);
}

.hl-chip__n {
	color: var(--hl-faint, #857f75);
	opacity: 0.8;
}

/* ------------------------------------------------------------ sort + bar -- */
.hl-shop__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 30px 0 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--hl-hairline, #2a2723);
}

.hl-sort {
	display: flex;
	align-items: center;
	gap: 10px;
}

.hl-sort__l,
.hl-shop__count {
	margin: 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.66rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--hl-faint, #857f75);
}

.hl-sort__s {
	appearance: none;
	padding: 8px 30px 8px 12px;
	background-color: #0c0c0c;
	background-image: linear-gradient(45deg, transparent 50%, var(--hl-stone, #8c867c) 50%),
		linear-gradient(135deg, var(--hl-stone, #8c867c) 50%, transparent 50%);
	background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	border: 1px solid var(--hl-hairline, #2a2723);
	border-radius: 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.66rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--hl-bone, #f7f2e8);
	cursor: pointer;
}

.hl-sort__s:focus-visible {
	outline: 2px solid var(--hl-glacier, #fc5501);
	outline-offset: 2px;
}

/* ------------------------------------------------------------- the grid --
 * WooCommerce ships `.woocommerce ul.products::before{content:" ";display:table}`
 * as a float clearfix. On a GRID container that pseudo-element becomes a real
 * grid item, takes cell 1, and shifts the whole catalogue one cell right at
 * every breakpoint — while the card COUNT stays correct, so no count-based
 * test catches it. Kill both pseudo-elements.
 * ------------------------------------------------------------------------ */
.hl-shop ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hl-shop ul.products::before,
.hl-shop ul.products::after {
	content: none !important;
	display: none !important;
}

.hl-shop ul.products > li.hl-cell {
	margin: 0 !important;
	width: auto !important;
	float: none !important;
	clear: none !important;
	list-style: none;
}

.hl-shop__empty {
	padding: 64px 0;
	font-family: var(--hl-font-mono, "IBM Plex Mono", ui-monospace, monospace);
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--hl-stone, #8c867c);
}

.hl-shop__empty a {
	color: var(--hl-glacier, #fc5501);
	text-decoration: none;
}

/* ---------------------------------------------------------- breakpoints -- */
@media (max-width: 1100px) {
	.hl-tiles {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.hl-shop ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 820px) {
	.hl-shop ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.hl-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.hl-shop__bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
}

@media (max-width: 420px) {
	.hl-shop ul.products {
		grid-template-columns: minmax(0, 1fr);
	}
}
