/**
 * Vassart Products — front-end styles for the Product Category /
 * Sub-category archive template (templates/taxonomy-vassart_product_cat.php).
 * Only enqueued on that template (see class-vassart-products-category-template.php).
 */

.vassart-category-page {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 20px 64px;
}

/* Breadcrumb */
.vassart-category-breadcrumb {
	margin-bottom: 24px;
	font-size: 13px;
	color: #757575;
}

.vassart-category-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.vassart-category-breadcrumb li {
	display: flex;
	align-items: center;
}

.vassart-category-breadcrumb li:not(:last-child)::after {
	content: '/';
	margin: 0 8px;
	color: #c2c2c2;
}

.vassart-category-breadcrumb a {
	color: #757575;
	text-decoration: none;
}

.vassart-category-breadcrumb a:hover {
	color: #ea5501;
	text-decoration: underline;
}

.vassart-category-breadcrumb [aria-current='page'] {
	color: #1b1b1b;
	font-weight: 600;
}

/* Section 1: intro */
.vassart-category-intro {
	margin-bottom: 32px;
}

.vassart-category-title {
	margin: 0 0 12px;
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 700;
}

.vassart-category-description {
	color: #444;
	line-height: 1.7;
}

.vassart-category-description p:last-child {
	margin-bottom: 0;
}

/* Section 2: sub-category selector — a single-row horizontal carousel with
 * arrow navigation at the top right (matching the Product Category Listing
 * Elementor widget's carousel header/arrows), collapsing to a <select>
 * dropdown on small screens. */
.vassart-category-selector {
	margin-bottom: 36px;
}

.vassart-category-tabs-header {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 12px;
}

.vassart-category-tabs-arrows {
	display: flex;
	gap: 8px;
}

.vassart-category-tabs-arrow {
	flex-shrink: 0;
	width: 50px;
	height: 50px;
	line-height: 48px;
	text-align: center;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: #f7f7f7;
	color: #616161;
	font-size: 20px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.vassart-category-tabs-arrow:hover:not([disabled]) {
	background: #ea5501;
	color: #fff;
}

.vassart-category-tabs-arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

.vassart-category-tabs-viewport {
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.vassart-category-tabs-viewport::-webkit-scrollbar {
	display: none;
}

.vassart-category-tabs {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 2px;
}

.vassart-category-tabs li {
	flex: 0 0 auto;
}

.vassart-category-tab {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 999px;
	background: #f7f7f7;
	color: #444;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.vassart-category-tab:hover {
	background: #ececec;
	color: #1b1b1b;
}

.vassart-category-tab.is-active {
	background: #ea5501;
	color: #fff;
}

.vassart-category-select {
	display: none;
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	background: #fff;
	font-size: 14px;
	font-weight: 600;
	color: #1b1b1b;
}

@media (max-width: 600px) {
	.vassart-category-tabs-header,
	.vassart-category-tabs-viewport {
		display: none;
	}

	.vassart-category-select {
		display: block;
	}
}

/* Section 3: product grid */
.vassart-category-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 28px 24px;
}

@media (max-width: 1024px) {
	.vassart-category-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 767px) {
	.vassart-category-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.vassart-category-grid {
		grid-template-columns: 1fr;
	}
}

.vassart-device-card {
	display: flex;
	flex-direction: column;
}

.vassart-device-photo {
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: 4px;
	overflow: hidden;
	background: #f0f0f0;
	margin-bottom: 14px;
}

.vassart-device-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.vassart-device-card:hover .vassart-device-photo img {
	transform: scale(1.04);
}

.vassart-device-title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
}

.vassart-device-title a {
	color: #1b1b1b;
	text-decoration: none;
}

.vassart-device-title a:hover {
	color: #ea5501;
}

.vassart-device-excerpt-wrap {
	margin: 0 0 10px;
}

/* Clamped to two lines; category-page.js reveals the "Learn more" button
 * when the text overflows, which opens the full excerpt in a modal. */
.vassart-device-excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	margin: 0;
	color: #666;
	font-size: 14px;
	line-height: 1.6;
}

.vassart-device-excerpt p,
.vassart-excerpt-modal__text p {
	margin: 0;
}

.vassart-excerpt-modal__text p + p {
	margin-top: 0.8em;
}

.vassart-device-excerpt-more {
	display: inline-block;
	margin-top: 4px;
	color: #e00000;
	font-size: 13px;
	text-decoration: none;
}

.vassart-device-excerpt-more:hover,
.vassart-device-excerpt-more:focus-visible {
	text-decoration: underline;
}

.vassart-device-excerpt-more[hidden] {
	display: none;
}

/* Excerpt modal */
.vassart-excerpt-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.6);
}

.vassart-excerpt-modal[hidden] {
	display: none;
}

body.vassart-excerpt-modal-open {
	overflow: hidden;
}

.vassart-excerpt-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 28px 28px 24px;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

/* The dialog only receives focus programmatically on open (for keyboard/
 * screen-reader users), so no visible focus ring on the whole box. */
.vassart-excerpt-modal__dialog:focus {
	outline: none;
}

.vassart-excerpt-modal__title {
	margin: 0 32px 12px 0;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.35;
	color: #1b1b1b;
}

.vassart-excerpt-modal__text {
	margin: 0;
	color: #444;
	font-size: 15px;
	line-height: 1.7;
}

/* Scoped under the modal so it outranks the theme's generic button /
 * [type="button"] styles (border, padding, font-size, colours). */
.vassart-excerpt-modal .vassart-excerpt-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f0f0f0;
	color: #1b1b1b;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
}

.vassart-excerpt-modal .vassart-excerpt-modal__close svg {
	display: block;
	width: 14px;
	height: 14px;
}

.vassart-excerpt-modal .vassart-excerpt-modal__close:hover,
.vassart-excerpt-modal .vassart-excerpt-modal__close:focus-visible {
	border: 0;
	background: #ea5501;
	color: #fff;
}

.vassart-device-power-airflow {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 0 10px;
	font-size: 14px;
	line-height: 1.5;
	color: #444;
}

.vassart-device-power-airflow__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0 6px;
}

.vassart-device-power-airflow__label {
	font-weight: 600;
	color: #1b1b1b;
}

.vassart-device-factsheet {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	color: #ea5501;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.vassart-device-factsheet::after {
	content: '\2197';
	font-size: 14px;
}

.vassart-device-factsheet:hover {
	text-decoration: underline;
}

.vassart-category-empty {
	color: #757575;
}

/* Loading state while a tab switch/pagination click is in flight via AJAX. */
.vassart-category-products.is-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* Pagination (paginate_links() default markup: .page-numbers / .prev / .next / .current) */
.vassart-category-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 36px;
}

.vassart-category-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 4px;
	background: #f7f7f7;
	color: #444;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.vassart-category-pagination a.page-numbers:hover {
	background: #ececec;
	color: #1b1b1b;
}

.vassart-category-pagination .page-numbers.current {
	background: #ea5501;
	color: #fff;
}

.vassart-category-pagination .page-numbers.dots {
	background: transparent;
}

/* Section 4: FAQ (optional) */
.vassart-category-faq {
	margin-top: 56px;
	padding-top: 40px;
	border-top: 1px solid #e5e5e5;
}

.vassart-category-faq-heading {
	margin: 0 0 20px;
	font-size: 26px;
	font-weight: 700;
}

.vassart-faq-item {
	border-bottom: 1px solid #e5e5e5;
	padding: 16px 0;
}

.vassart-faq-question {
	cursor: pointer;
	font-weight: 600;
	font-size: 16px;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.vassart-faq-question::-webkit-details-marker {
	display: none;
}

.vassart-faq-question::after {
	content: '+';
	font-size: 20px;
	color: #ea5501;
	margin-left: 12px;
	flex-shrink: 0;
}

.vassart-faq-item[open] .vassart-faq-question::after {
	content: '\2212';
}

.vassart-faq-answer {
	margin-top: 10px;
	color: #555;
	line-height: 1.7;
}

.vassart-faq-answer p:last-child {
	margin-bottom: 0;
}
