/**
 * Hudson product category archive styles.
 *
 * Loaded only on product_cat archives (see functions.php).
 *
 * Scope note: section layout, colour, type and spacing are set in the Elementor
 * panel, not here. This file covers the two things Elementor has no controls
 * for — the horizontally scrolling category strip, and the Refine sidebar,
 * which is rendered by [hudson_refine] rather than by widgets.
 *
 * Colours reference Elementor Global Colors so the palette stays in one place.
 */

/* ---------------------------------------------------------------
   Category strip: chips, edge fades, scroll chevrons
   --------------------------------------------------------------- */

.chips-wrap {
	position: relative;
	min-width: 0;
	display: flex;
	align-items: center;
}

.chips-wrap > .elementor-widget-loop-grid {
	position: relative;
	z-index: 0;
	width: 100%;
}

/* Flatten Elementor's loop grid into one non-wrapping scrolling row. */
.chips-wrap .elementor-loop-container {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	overflow-x: auto;
	grid-template-columns: none;
	scrollbar-width: none;
	-ms-overflow-style: none;
	scroll-behavior: smooth;
	align-items: center;
}

.chips-wrap .elementor-loop-container::-webkit-scrollbar {
	display: none;
}

.chips-wrap .e-loop-item {
	flex: 0 0 auto;
	width: auto;
	max-width: none;
}

.chips-wrap .cat-chip {
	min-height: 42px;
	box-sizing: border-box;
}

/* Fades signal more content in each direction; toggled by category.js. */
.chips-wrap::before,
.chips-wrap::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 70px;
	pointer-events: none;
	z-index: 2;
	opacity: 0;
	transition: opacity .2s;
}

.chips-wrap::before {
	left: 0;
	background: linear-gradient(to right, #fff 45%, rgba(255, 255, 255, 0));
}

.chips-wrap::after {
	right: 0;
	background: linear-gradient(to left, #fff 45%, rgba(255, 255, 255, 0));
}

.chips-wrap.can-left::before,
.chips-wrap.can-right::after {
	opacity: 1;
}

/* Selector is deliberately specific: Elementor's kit styles bare `button`. */
.chips-wrap button.chips-nudge {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 32px;
	height: 32px;
	min-width: 0;
	min-height: 0;
	border-radius: 50%;
	border: 1px solid rgba(10, 28, 43, .14);
	background: #fff;
	background-image: none;
	box-shadow: 0 1px 4px rgba(10, 28, 43, .10);
	display: none;
	place-items: center;
	cursor: pointer;
	padding: 0;
	margin: 0;
	transition: border-color .2s;
}

.chips-wrap button.chips-nudge.prev { left: 0; }
.chips-wrap button.chips-nudge.next { right: 0; }

.chips-wrap.can-left button.chips-nudge.prev,
.chips-wrap.can-right button.chips-nudge.next {
	display: grid;
}

.chips-wrap button.chips-nudge svg {
	width: 13px;
	height: 13px;
	stroke: #93A5B1;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.chips-wrap button.chips-nudge:hover { border-color: rgba(10, 28, 43, .30); }
.chips-wrap button.chips-nudge:hover svg { stroke: #5F7383; }

/* ---------------------------------------------------------------
   Ingredient search
   Elementor renders the magnifier in a <label> BEFORE the input wrapper and
   borders the input itself, so the label is floated over the field's end.
   --------------------------------------------------------------- */

.cat-search { display: flex; align-items: center; }

.cat-search .elementor-widget-search,
.cat-search .e-search { width: 100%; }

.cat-search .e-search.hidden { visibility: visible; opacity: 1; }

.cat-search .e-search-form {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

.cat-search .e-search-input-wrapper {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
}

.cat-search .e-search-label {
	position: absolute;
	inset-inline-end: 0;
	inset-inline-start: auto;
	top: 50%;
	transform: translateY(-50%);
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	z-index: 2;
	pointer-events: none;
	display: flex;
	align-items: center;
}

.cat-search .e-search-label > svg,
.cat-search .e-search-label > i {
	position: static;
	transform: none;
	inset: auto;
	margin-inline-end: 20px;
}

/* Explicit padding beats Elementor's calc(), which reserves icon space at the start. */
.cat-search input.e-search-input {
	width: 100%;
	min-height: 42px;
	box-sizing: border-box;
	text-align: left;
	padding-inline-start: 20px;
	padding-inline-end: 48px;
}

.cat-search .e-search-submit { display: none !important; }

@media (max-width: 920px) {
	.chips-wrap button.chips-nudge { display: none !important; }
	.chips-wrap::before,
	.chips-wrap::after { width: 40px; }
}

/* ---------------------------------------------------------------
   Refine sidebar — markup from [hudson_refine]
   --------------------------------------------------------------- */

.hud-refine__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 6px;
}

.hud-refine__title {
	font-family: Inter, sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--e-global-color-primary);
}

.hud-refine__clear {
	font-family: Inter, sans-serif;
	font-size: 12.5px;
	color: var(--e-global-color-accent);
	text-decoration: none;
}

.hud-refine__clear:hover { text-decoration: underline; }

.hud-fgroup { border-bottom: 1px solid rgba(10, 28, 43, .10); }

.hud-refine button.hud-fgroup__btn {
	width: 100%;
	background: none;
	background-image: none;
	border: 0;
	box-shadow: none;
	text-align: left;
	font-family: Inter, sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: var(--e-global-color-primary);
	padding: 18px 26px 18px 0;
	margin: 0;
	cursor: pointer;
	position: relative;
	display: block;
}

.hud-refine button.hud-fgroup__btn:hover {
	color: var(--e-global-color-accent);
	background: none;
}

.hud-ic {
	position: absolute;
	right: 2px;
	top: 50%;
	transform: translateY(-50%);
	width: 11px;
	height: 11px;
	display: block;
}

.hud-ic::before,
.hud-ic::after {
	content: "";
	position: absolute;
	background: var(--e-global-color-accent);
	border-radius: 2px;
	transition: .28s;
}

.hud-ic::before { left: 0; top: 5px; width: 11px; height: 1.5px; }
.hud-ic::after { left: 5px; top: 0; width: 1.5px; height: 11px; }

.hud-fgroup.is-open .hud-ic::after {
	transform: rotate(90deg);
	opacity: 0;
}

.hud-fbody {
	max-height: 0;
	overflow: hidden;
	transition: max-height .38s cubic-bezier(.2, .7, .3, 1);
}

.hud-fbody ul {
	list-style: none;
	margin: 0;
	padding: 0 0 18px;
}

.hud-opt {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 7px 0;
	cursor: pointer;
	font-family: Inter, sans-serif;
	font-size: 14px;
	color: var(--e-global-color-text);
}

.hud-opt:hover { color: var(--e-global-color-primary); }

/* Terms with no products in this category are dimmed but still selectable. */
.hud-opt.is-empty { opacity: .45; }

.hud-opt input {
	appearance: none;
	-webkit-appearance: none;
	width: 17px;
	height: 17px;
	border: 1px solid rgba(10, 28, 43, .18);
	border-radius: 4px;
	flex: none;
	cursor: pointer;
	position: relative;
	background: #fff;
	transition: .18s;
	margin: 0;
}

.hud-opt input:checked {
	background: var(--e-global-color-accent);
	border-color: var(--e-global-color-accent);
}

.hud-opt input:checked::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1.5px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 1.7px 1.7px 0;
	transform: rotate(42deg);
}

.hud-opt__c {
	margin-left: auto;
	font-size: 12px;
	color: var(--e-global-color-mist);
}

/* ---------------------------------------------------------------
   Sort select — markup from [hudson_sort]
   --------------------------------------------------------------- */

.hud-sort {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: Inter, sans-serif;
	font-size: 13.5px;
	color: var(--e-global-color-slate);
}

.hud-sort select {
	font-family: Inter, sans-serif;
	font-size: 13.5px;
	color: var(--e-global-color-primary);
	background: #fff;
	border: 1px solid rgba(10, 28, 43, .18);
	border-radius: 4px;
	padding: 9px 34px 9px 13px;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%278%27 viewBox=%270 0 12 8%27><path d=%27M1 1l5 5 5-5%27 stroke=%27%235F7383%27 stroke-width=%271.5%27 fill=%27none%27 stroke-linecap=%27round%27/></svg>");
	background-repeat: no-repeat;
	background-position: right 13px center;
}

.hud-sort select:focus {
	outline: none;
	border-color: var(--e-global-color-accent);
}
