/**
 * Aero Catalog — front-end styles.
 * Everything is namespaced under .aero-catalog so it won't leak into the theme.
 */

.aero-catalog {
	--aero-accent: #0f6f8c;
	--aero-accent-dark: #0b566e;
	--aero-accent-soft: #e6f3f7;
	--aero-ink: #16202a;
	--aero-muted: #64748b;
	--aero-line: #e3e8ee;
	--aero-surface: #ffffff;
	--aero-bg: #f7f9fb;
	--aero-radius: 10px;
	--aero-shadow: 0 1px 2px rgba(16, 32, 42, .06);

	box-sizing: border-box;
	color: var(--aero-ink);
	font-size: 15px;
	line-height: 1.5;
}

.aero-catalog *,
.aero-catalog *::before,
.aero-catalog *::after {
	box-sizing: inherit;
}

/* ---------------------------------------------------------------- header */

.aero-crumbs {
	display: flex;
	gap: 8px;
	align-items: center;
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--aero-muted);
	margin-bottom: 10px;
}

.aero-crumbs a {
	color: inherit;
	text-decoration: none;
}

.aero-crumbs a:hover {
	color: var(--aero-accent);
}

.aero-head__row {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 26px;
}

.aero-head__title {
	margin: 0 0 4px;
	font-size: clamp(26px, 4vw, 40px);
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -.02em;
}

.aero-head__count {
	margin: 0;
	color: var(--aero-muted);
	font-size: 14px;
}

.aero-search {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 320px;
	max-width: 460px;
}

.aero-search svg {
	position: absolute;
	left: 14px;
	color: var(--aero-muted);
	pointer-events: none;
}

.aero-search input {
	width: 100%;
	padding: 11px 14px 11px 42px;
	border: 1px solid var(--aero-line);
	border-radius: 999px;
	background: var(--aero-bg);
	font: inherit;
	color: inherit;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}

.aero-search input:focus {
	border-color: var(--aero-accent);
	box-shadow: 0 0 0 3px var(--aero-accent-soft);
	background: var(--aero-surface);
}

/* ---------------------------------------------------------------- layout */

.aero-layout {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: 36px;
	align-items: start;
}

.aero-catalog--nosidebar .aero-layout {
	grid-template-columns: minmax(0, 1fr);
}

/* --------------------------------------------------------------- sidebar */

.aero-sidebar__head {
	display: none;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 14px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--aero-line);
	font-weight: 700;
}

.aero-sidebar__close {
	border: 0;
	background: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--aero-muted);
	padding: 0 4px;
}

.aero-filter {
	padding-bottom: 24px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--aero-line);
}

.aero-filter:last-of-type {
	border-bottom: 0;
}

.aero-filter__title {
	margin: 0 0 12px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--aero-ink);
}

.aero-cats,
.aero-checks {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aero-cat {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 9px 12px;
	border: 0;
	border-radius: 8px;
	background: none;
	font: inherit;
	color: var(--aero-muted);
	text-align: left;
	cursor: pointer;
	transition: background .15s, color .15s;
}

.aero-cat:hover {
	background: var(--aero-bg);
	color: var(--aero-ink);
}

.aero-cat.is-active {
	background: var(--aero-accent-soft);
	color: var(--aero-accent);
	font-weight: 600;
}

.aero-cat__count {
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	opacity: .8;
}

/* Dual-handle price slider built on two stacked range inputs. */

.aero-range {
	position: relative;
	height: 22px;
	margin: 6px 0 12px;
}

.aero-range__track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 4px;
	margin-top: -2px;
	border-radius: 999px;
	background: var(--aero-line);
}

.aero-range__fill {
	position: absolute;
	top: 0;
	bottom: 0;
	border-radius: 999px;
	background: var(--aero-accent);
}

.aero-range__input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 22px;
	margin: 0;
	background: none;
	appearance: none;
	-webkit-appearance: none;
	/* Let clicks fall through to whichever thumb is under the cursor. */
	pointer-events: none;
}

.aero-range__input::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid var(--aero-surface);
	background: var(--aero-accent);
	box-shadow: 0 1px 3px rgba(16, 32, 42, .3);
	cursor: grab;
	pointer-events: auto;
}

.aero-range__input::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid var(--aero-surface);
	background: var(--aero-accent);
	box-shadow: 0 1px 3px rgba(16, 32, 42, .3);
	cursor: grab;
	pointer-events: auto;
}

.aero-range__input:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 0 0 4px var(--aero-accent-soft);
}

.aero-range__values {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	font-size: 13px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.aero-range__values .woocommerce-Price-amount {
	color: var(--aero-ink);
}

.aero-check {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 0;
	cursor: pointer;
	color: var(--aero-muted);
	transition: color .15s;
}

.aero-check:hover {
	color: var(--aero-ink);
}

.aero-check input {
	width: 16px;
	height: 16px;
	accent-color: var(--aero-accent);
	cursor: pointer;
}

.aero-reset {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--aero-line);
	border-radius: 8px;
	background: var(--aero-surface);
	font: inherit;
	font-size: 13px;
	color: var(--aero-muted);
	cursor: pointer;
	transition: border-color .15s, color .15s;
}

.aero-reset:hover {
	border-color: var(--aero-accent);
	color: var(--aero-accent);
}

/* --------------------------------------------------------------- toolbar */

.aero-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-bottom: 22px;
}

.aero-toolbar__right {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-left: auto;
}

.aero-viewswitch {
	display: inline-flex;
	padding: 3px;
	border: 1px solid var(--aero-line);
	border-radius: 8px;
	background: var(--aero-bg);
}

.aero-viewswitch button {
	padding: 6px 14px;
	border: 0;
	border-radius: 6px;
	background: none;
	font: inherit;
	font-size: 13px;
	color: var(--aero-muted);
	cursor: pointer;
	transition: background .15s, color .15s;
}

.aero-viewswitch button.is-active {
	background: var(--aero-surface);
	color: var(--aero-ink);
	font-weight: 600;
	box-shadow: var(--aero-shadow);
}

.aero-sort select {
	padding: 9px 34px 9px 14px;
	border: 1px solid var(--aero-line);
	border-radius: 8px;
	background: var(--aero-surface) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
	font: inherit;
	font-size: 14px;
	color: var(--aero-ink);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.aero-sort select:focus {
	outline: none;
	border-color: var(--aero-accent);
	box-shadow: 0 0 0 3px var(--aero-accent-soft);
}

.aero-filters-toggle {
	display: none;
}

/* Active-filter chips */

.aero-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.aero-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 8px 5px 12px;
	border: 1px solid var(--aero-line);
	border-radius: 999px;
	background: var(--aero-surface);
	font-size: 12px;
	color: var(--aero-ink);
}

.aero-chip button {
	border: 0;
	background: none;
	padding: 0 2px;
	font-size: 15px;
	line-height: 1;
	color: var(--aero-muted);
	cursor: pointer;
}

.aero-chip button:hover {
	color: #b42318;
}

/* ------------------------------------------------------------------ grid */

.aero-results {
	position: relative;
	min-height: 200px;
	transition: opacity .15s;
}

.aero-results[aria-busy="true"] {
	opacity: .45;
	pointer-events: none;
}

.aero-grid {
	display: grid;
	gap: 20px;
}

.aero-grid--grid {
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.aero-grid--list {
	grid-template-columns: minmax(0, 1fr);
}

/* ------------------------------------------------------------------ card */

.aero-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--aero-line);
	border-radius: var(--aero-radius);
	background: var(--aero-surface);
	overflow: hidden;
	transition: box-shadow .18s, transform .18s, border-color .18s;
}

.aero-card:hover {
	border-color: #cfd8e3;
	box-shadow: 0 6px 20px rgba(16, 32, 42, .09);
	transform: translateY(-2px);
}

.aero-card__media {
	position: relative;
	background: var(--aero-bg);
}

.aero-card__image {
	display: block;
	aspect-ratio: 1 / 1;
}

.aero-card__image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	mix-blend-mode: multiply;
}

.aero-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	padding: 4px 9px;
	border-radius: 5px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
}

.aero-badge--ok {
	background: var(--aero-accent-soft);
	color: var(--aero-accent);
}

.aero-badge--warn {
	background: #fef3c7;
	color: #92400e;
}

.aero-badge--muted {
	background: #eef1f5;
	color: #64748b;
}

.aero-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 16px;
}

.aero-card__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
	min-height: 18px;
}

.aero-card__sku {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	color: var(--aero-accent);
}

.aero-card__rating {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #b45309;
}

.aero-card__title {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.aero-card__title a {
	color: inherit;
	text-decoration: none;
}

.aero-card__title a:hover {
	color: var(--aero-accent);
}

.aero-card__desc {
	margin: 0 0 14px;
	font-size: 13.5px;
	color: var(--aero-muted);
}

.aero-card__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	margin-top: auto;
	margin-bottom: 14px;
	font-size: 20px;
	font-weight: 700;
}

.aero-card__price del {
	font-size: 14px;
	font-weight: 400;
	color: var(--aero-muted);
	opacity: .85;
}

.aero-card__price ins {
	text-decoration: none;
}

.aero-card__discount {
	padding: 2px 7px;
	border-radius: 5px;
	background: #fee4e2;
	color: #b42318;
	font-size: 11px;
	font-weight: 700;
}

/* List view reflows the card horizontally. */

.aero-grid--list .aero-card {
	flex-direction: row;
}

.aero-grid--list .aero-card__media {
	flex: 0 0 200px;
}

.aero-grid--list .aero-card__image {
	height: 100%;
	aspect-ratio: auto;
}

.aero-grid--list .aero-card__price {
	margin-top: 12px;
}

.aero-grid--list .aero-btn--cart {
	align-self: flex-start;
	min-width: 200px;
}

/* --------------------------------------------------------------- buttons */

.aero-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 18px;
	border: 1px solid transparent;
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}

.aero-btn--cart {
	background: var(--aero-accent);
	color: #fff;
}

.aero-btn--cart:hover,
.aero-btn--cart:focus {
	background: var(--aero-accent-dark);
	color: #fff;
}

.aero-btn--cart.loading {
	opacity: .7;
	pointer-events: none;
}

.aero-btn--cart.added::after {
	content: "✓";
	font-weight: 700;
}

.aero-btn--ghost {
	background: var(--aero-surface);
	border-color: var(--aero-line);
	color: var(--aero-ink);
}

.aero-btn--ghost:hover {
	border-color: var(--aero-accent);
	color: var(--aero-accent);
}

/* WooCommerce injects this link after an AJAX add; keep it out of the grid. */
.aero-card .added_to_cart {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	text-align: center;
	color: var(--aero-accent);
}

/* ------------------------------------------------------ pager / empty */

.aero-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 34px;
	padding-top: 24px;
	border-top: 1px solid var(--aero-line);
}

.aero-pager__btn {
	padding: 9px 16px;
	border: 1px solid var(--aero-line);
	border-radius: 8px;
	background: var(--aero-surface);
	font: inherit;
	font-size: 14px;
	color: var(--aero-ink);
	cursor: pointer;
	transition: border-color .15s, color .15s;
}

.aero-pager__btn:hover:not(:disabled) {
	border-color: var(--aero-accent);
	color: var(--aero-accent);
}

.aero-pager__btn:disabled {
	opacity: .4;
	cursor: not-allowed;
}

.aero-pager__status {
	font-size: 14px;
	color: var(--aero-muted);
	font-variant-numeric: tabular-nums;
}

.aero-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 70px 20px;
	text-align: center;
	color: var(--aero-muted);
}

.aero-empty__title {
	margin: 8px 0 0;
	font-size: 17px;
	font-weight: 700;
	color: var(--aero-ink);
}

.aero-empty__hint {
	margin: 0 0 14px;
	font-size: 14px;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 900px) {
	.aero-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.aero-filters-toggle {
		display: inline-flex;
	}

	.aero-sidebar {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 100000;
		width: min(320px, 86vw);
		padding: 20px;
		background: var(--aero-surface);
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform .25s ease;
		box-shadow: 0 0 40px rgba(16, 32, 42, .2);
	}

	.aero-sidebar.is-open {
		transform: translateX(0);
	}

	.aero-sidebar__head {
		display: flex;
	}

	.aero-scrim {
		position: fixed;
		inset: 0;
		z-index: 99999;
		background: rgba(16, 32, 42, .45);
	}

	.aero-toolbar__right {
		width: 100%;
		margin-left: 0;
	}

	.aero-sort {
		flex: 1;
	}

	.aero-sort select {
		width: 100%;
	}
}

@media (max-width: 600px) {
	.aero-grid--grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 14px;
	}

	.aero-grid--list .aero-card {
		flex-direction: column;
	}

	.aero-grid--list .aero-card__media {
		flex: none;
	}

	.aero-viewswitch {
		display: none;
	}
}

/* Fallback for themes that don't ship WordPress's own SR-only class. */
.aero-catalog .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
