/*
 * All Documents (Catalog / WooCommerce Shop archive)
 *
 * Reuses existing design tokens throughout (base/variables.css) — no
 * new design system. Product cards themselves are styled by the
 * existing assets/css/components/document-card.css (untouched);
 * this file only covers the catalog page's own layout: hero, filter
 * sidebar, toolbar, grid wrapper, pagination, and the bottom panels.
 */

/* --- Hero --- */

.qehs-catalog-hero {
	padding-block: var(--qehs-space-xl);
	background-color: var(--qehs-primary);
	color: #ffffff;
}

.qehs-catalog-hero .qehs-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--qehs-space-xl);
}

.qehs-catalog-hero__content {
	min-width: 0;
	flex: 1 1 auto;
}

.qehs-catalog-hero__illustration {
	flex-shrink: 0;
	width: 100%;
	max-width: 320px;
}

.qehs-catalog-hero__illustration img {
	display: block;
	width: 100%;
	height: auto;
}

.qehs-catalog-hero__breadcrumb {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-xs);
	margin-bottom: var(--qehs-space-md);
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.7);
}

.qehs-catalog-hero__breadcrumb a {
	color: var(--qehs-secondary);
	font-weight: 600;
}

.qehs-catalog-hero__title {
	margin: 0 0 var(--qehs-space-sm);
	font-size: 2.25rem;
	font-weight: 700;
	color: #ffffff;
}

.qehs-catalog-hero__subtitle {
	margin: 0;
	max-width: 640px;
	font-size: 1rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.75);
}

/* Tablet: shrink the illustration rather than hide it, still no
   horizontal overflow. */
@media (max-width: 1024px) {
	.qehs-catalog-hero__illustration {
		max-width: 220px;
	}
}

/* Mobile: stack the illustration below the text content instead of
   side-by-side, matching the same "adapt naturally, no overflow"
   pattern already used for the sidebar/toolbar on this page. */
@media (max-width: 768px) {
	.qehs-catalog-hero .qehs-container {
		flex-direction: column;
		align-items: flex-start;
	}

	.qehs-catalog-hero__illustration {
		max-width: 200px;
		align-self: center;
	}
}

/* --- Main layout: sidebar + results --- */

.qehs-catalog-main {
	padding-block: var(--qehs-space-xl);
}

.qehs-catalog-main__inner {
	max-width: var(--qehs-header-container-max);
	margin-inline: auto;
	padding-inline: var(--qehs-container-padding);
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: var(--qehs-space-xl);
	align-items: start;
}

.qehs-catalog-results {
	min-width: 0;
}

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

.qehs-catalog-filters {
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-lg);
	padding: var(--qehs-space-lg);
}

.qehs-catalog-filters__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--qehs-space-md);
}

.qehs-catalog-filters__header h2 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
}

.qehs-catalog-filters__clear-link {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--qehs-secondary);
}

.qehs-catalog-filter-group {
	padding-block: var(--qehs-space-md);
	border-bottom: 1px solid var(--qehs-border);
}

.qehs-catalog-filter-group:first-of-type {
	padding-top: 0;
}

.qehs-catalog-filter-group label {
	display: block;
	margin-bottom: var(--qehs-space-sm);
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--qehs-text);
}

.qehs-catalog-filter-group h3 {
	margin: 0 0 var(--qehs-space-sm);
	font-size: 0.95rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: var(--qehs-space-xs);
}

.qehs-catalog-filter-group__search input {
	width: 100%;
	padding: var(--qehs-space-sm) var(--qehs-space-md);
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-md);
	font-family: inherit;
	font-size: 0.9rem;
}

.qehs-catalog-filter-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: var(--qehs-space-sm);
}

.qehs-catalog-filter-list label {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-sm);
	margin: 0;
	font-weight: 400;
	font-size: 0.9rem;
	cursor: pointer;
}

.qehs-catalog-filter-list__count {
	color: var(--qehs-text-muted);
	font-size: 0.8rem;
}

.qehs-catalog-filter-group--disabled {
	opacity: 0.6;
}

.qehs-catalog-filter-group__badge {
	padding: 1px 8px;
	border-radius: 999px;
	background-color: var(--qehs-background-alt);
	color: var(--qehs-text-muted);
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
}

.qehs-catalog-filter-group__note {
	margin: 0;
	font-size: 0.8rem;
	color: var(--qehs-text-muted);
	line-height: 1.5;
}

.qehs-catalog-filter-price {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-sm);
}

.qehs-catalog-filter-price input {
	width: 100%;
	padding: var(--qehs-space-sm);
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-md);
	font-family: inherit;
	font-size: 0.85rem;
}

.qehs-catalog-filters__apply {
	width: 100%;
	margin-top: var(--qehs-space-md);
	padding: var(--qehs-space-sm);
	border: none;
	border-radius: var(--qehs-radius-md);
	background-color: var(--qehs-secondary);
	color: #ffffff;
	font-weight: 700;
	font-size: 0.95rem;
	cursor: pointer;
}

.qehs-catalog-filters__clear-btn {
	display: block;
	width: 100%;
	margin-top: var(--qehs-space-sm);
	padding: var(--qehs-space-sm);
	border: 1px solid var(--qehs-secondary);
	border-radius: var(--qehs-radius-md);
	color: var(--qehs-secondary);
	font-weight: 600;
	font-size: 0.9rem;
	text-align: center;
}

/* --- Toolbar --- */

.qehs-catalog-toolbar {
	margin-bottom: var(--qehs-space-lg);
}

.qehs-catalog-toolbar__active-filters {
	display: flex;
	flex-wrap: wrap;
	gap: var(--qehs-space-sm);
	margin-bottom: var(--qehs-space-md);
}

.qehs-catalog-toolbar__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background-color: var(--qehs-accent-blue-tint);
	color: var(--qehs-accent-blue);
	font-size: 0.85rem;
	font-weight: 600;
}

.qehs-catalog-toolbar__chip span[aria-hidden] {
	font-size: 1rem;
	line-height: 1;
}

.qehs-catalog-toolbar__chip:hover {
	filter: brightness(0.95);
}

.qehs-catalog-toolbar__filter-toggle {
	display: none;
	align-items: center;
	gap: var(--qehs-space-sm);
	margin-bottom: var(--qehs-space-md);
	padding: var(--qehs-space-sm) var(--qehs-space-md);
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-md);
	background: var(--qehs-background);
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
}

.qehs-catalog-toolbar__search {
	display: flex;
	margin-bottom: var(--qehs-space-md);
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-md);
	overflow: hidden;
}

.qehs-catalog-toolbar__search input {
	flex: 1 1 auto;
	border: none;
	padding: var(--qehs-space-sm) var(--qehs-space-md);
	font-family: inherit;
	font-size: 0.95rem;
}

.qehs-catalog-toolbar__search button {
	flex-shrink: 0;
	padding: var(--qehs-space-sm) var(--qehs-space-lg);
	border: none;
	background-color: var(--qehs-secondary);
	color: #ffffff;
	font-weight: 600;
	cursor: pointer;
}

.qehs-catalog-toolbar__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--qehs-space-sm);
}

.qehs-catalog-toolbar__count {
	margin: 0;
	font-size: 0.9rem;
	color: var(--qehs-text-muted);
}

.qehs-catalog-toolbar__controls {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-sm);
}

.qehs-catalog-toolbar__sort-label {
	font-size: 0.85rem;
	color: var(--qehs-text-muted);
}

.qehs-catalog-toolbar__controls select {
	padding: var(--qehs-space-xs) var(--qehs-space-sm);
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-md);
	font-family: inherit;
	font-size: 0.85rem;
}

.qehs-catalog-toolbar__view {
	display: flex;
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-md);
	overflow: hidden;
}

.qehs-catalog-toolbar__view button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: var(--qehs-background);
	color: var(--qehs-text-muted);
	cursor: pointer;
}

.qehs-catalog-toolbar__view button.is-active {
	background-color: var(--qehs-secondary);
	color: #ffffff;
}

.qehs-catalog-toolbar__view button:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

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

.qehs-catalog-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--qehs-space-lg);
	justify-items: start;
}

.qehs-catalog-empty {
	padding: var(--qehs-space-2xl);
	text-align: center;
	border: 1px dashed var(--qehs-border);
	border-radius: var(--qehs-radius-lg);
	color: var(--qehs-text-muted);
}

/* --- Pagination (WordPress's own the_posts_pagination()) --- */

.qehs-catalog-pagination {
	display: flex;
	justify-content: center;
	gap: var(--qehs-space-xs);
	margin-top: var(--qehs-space-xl);
}

.qehs-catalog-pagination .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding-inline: var(--qehs-space-sm);
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-md);
	color: var(--qehs-text);
	font-size: 0.9rem;
}

.qehs-catalog-pagination .page-numbers.current {
	background-color: var(--qehs-secondary);
	border-color: var(--qehs-secondary);
	color: #ffffff;
	font-weight: 700;
}

.qehs-catalog-pagination .page-numbers:hover:not(.current) {
	border-color: var(--qehs-secondary);
	color: var(--qehs-secondary);
}

/* --- Bottom panels (Recently Viewed / Recommended Bundles) --- */

.qehs-catalog-panels {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--qehs-space-lg);
	margin-block: var(--qehs-space-xl);
}

.qehs-catalog-panel {
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-lg);
	padding: var(--qehs-space-lg);
}

.qehs-catalog-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--qehs-space-md);
}

.qehs-catalog-panel__header h2 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
}

.qehs-catalog-panel__header a {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--qehs-secondary);
}

.qehs-catalog-panel__grid--compact {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--qehs-space-md);
}

.qehs-catalog-panel__grid--bundles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--qehs-space-md);
}

/* --- Tablet --- */
@media (max-width: 1024px) {
	.qehs-catalog-main__inner {
		grid-template-columns: 1fr;
	}

	.qehs-catalog-toolbar__filter-toggle {
		display: inline-flex;
	}

	.qehs-catalog-filters {
		display: none;
	}

	.qehs-catalog-filters.is-open {
		display: block;
	}

	.qehs-catalog-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.qehs-catalog-panels {
		grid-template-columns: 1fr;
	}

	.qehs-catalog-panel__grid--compact {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* --- Mobile --- */
@media (max-width: 480px) {
	.qehs-catalog-hero__title {
		font-size: 1.75rem;
	}

	.qehs-catalog-grid {
		grid-template-columns: 1fr;
	}

	.qehs-catalog-toolbar__meta {
		flex-direction: column;
		align-items: flex-start;
	}

	.qehs-catalog-panel__grid--compact,
	.qehs-catalog-panel__grid--bundles {
		grid-template-columns: 1fr;
	}
}
