/*
 * Products archive (/products/) — component styles.
 * Loaded only on the Products archive template. Depends on
 * tokens.css and base.css (container, button, visually-hidden utility).
 */

/* ---------- Catalogue hero ---------- */

.ff-catalogue-hero {
	position: relative;
	background-color: var(--ff-off-white);
	overflow: hidden;
}

/* Subtle technical accent — thin ruled lines + a corner bracket motif,
   CSS only, no imagery, no decorative gradients. Reads as a drawing/
   spec-sheet reference mark rather than an ornamental background. */
.ff-catalogue-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(135deg, transparent 0%, transparent 62%, rgba(237, 27, 48, 0.06) 62%, rgba(237, 27, 48, 0.06) 63%, transparent 63%),
		linear-gradient(135deg, transparent 0%, transparent 70%, rgba(1, 1, 1, 0.035) 70%, rgba(1, 1, 1, 0.035) 71%, transparent 71%);
	pointer-events: none;
}

.ff-catalogue-hero::after {
	content: "";
	position: absolute;
	top: var(--ff-space-6);
	right: clamp(1rem, 4vw, 2.5rem);
	width: 64px;
	height: 64px;
	border-top: 2px solid rgba(1, 1, 1, 0.14);
	border-right: 2px solid rgba(1, 1, 1, 0.14);
	pointer-events: none;
}

.ff-catalogue-hero__inner {
	position: relative;
	padding-block: var(--ff-space-9) var(--ff-space-7);
	max-width: 50rem;
}

.ff-catalogue-hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--ff-space-2);
	margin: 0 0 var(--ff-space-4);
	font-size: 0.8125rem;
	font-weight: var(--ff-font-weight-secondary);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ff-dark-red);
}

.ff-catalogue-hero__eyebrow::before {
	content: "";
	width: 28px;
	height: 2px;
	background-color: var(--ff-primary-red);
}

.ff-catalogue-hero__title {
	margin: 0 0 var(--ff-space-5);
	font-size: clamp(2.5rem, 5vw, 3.5rem);
	font-weight: var(--ff-font-weight-heading);
	line-height: 1.05;
	letter-spacing: -0.01em;
	color: var(--ff-black);
}

.ff-catalogue-hero__intro {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.65;
	color: var(--ff-charcoal);
	max-width: 42rem;
}

/* ---------- Category navigation ---------- */
/* A segmented technical rail, not a row of pill buttons: rectangular
   segments with a red underline accent on hover/active, divided by
   hairlines. Wraps freely on narrow widths so every category stays
   visible rather than relying on horizontal scroll. */

.ff-category-nav {
	background-color: var(--ff-white);
	border-bottom: 1px solid var(--ff-warm-gray);
}

.ff-category-nav__list {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ff-category-nav__item {
	border-right: 1px solid var(--ff-warm-gray);
}

.ff-category-nav__item:last-child {
	border-right: none;
}

.ff-category-nav__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	padding: var(--ff-space-4) var(--ff-space-5);
	font-size: 0.875rem;
	font-weight: var(--ff-font-weight-secondary);
	letter-spacing: 0.02em;
	color: var(--ff-charcoal);
	text-decoration: none;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.ff-category-nav__link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background-color: var(--ff-primary-red);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.18s ease;
}

.ff-category-nav__link:hover {
	color: var(--ff-dark-red);
	background-color: var(--ff-off-white);
}

.ff-category-nav__link:hover::after {
	transform: scaleX(1);
}

.ff-category-nav__link.is-active {
	color: var(--ff-primary-red);
}

.ff-category-nav__link.is-active::after {
	transform: scaleX(1);
}

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

.ff-product-grid-section {
	background-color: var(--ff-white);
	padding-block: var(--ff-space-9);
}

.ff-product-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--ff-space-7) var(--ff-space-6);
}

@media (min-width: 768px) {
	.ff-product-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: var(--ff-space-7);
	}
}

@media (min-width: 1024px) {
	.ff-product-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

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

.ff-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background-color: var(--ff-white);
	border: 1px solid var(--ff-warm-gray);
	border-radius: var(--ff-radius-md);
	overflow: hidden;
	transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ff-product-card:hover {
	border-color: rgba(175, 34, 36, 0.25);
	box-shadow: var(--ff-shadow-md);
	transform: translateY(-3px);
}

/* Consistent, square media stage — normalizes portrait 3PUMP cover
   photos, wide suppression-system images, and square detector/panel
   photos alike. Generous padding keeps every image feeling
   deliberately placed rather than cropped or stretched. */
.ff-product-card__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	background-color: var(--ff-off-white);
	padding: var(--ff-space-5);
	border-bottom: 1px solid var(--ff-warm-gray);
}

.ff-product-card__image {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.ff-product-card__media-fallback {
	font-size: 0.875rem;
	font-weight: var(--ff-font-weight-secondary);
	color: var(--ff-charcoal);
	text-align: center;
	opacity: 0.5;
}

.ff-product-card__body {
	display: flex;
	flex-direction: column;
	padding: var(--ff-space-5);
	flex: 1;
}

.ff-product-card__brand {
	margin: 0 0 var(--ff-space-1);
	font-size: 0.6875rem;
	font-weight: var(--ff-font-weight-secondary);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ff-dark-red);
	opacity: 0.85;
}

.ff-product-card__title {
	margin: 0 0 var(--ff-space-3);
	font-size: 1.25rem;
	font-weight: var(--ff-font-weight-heading);
	line-height: 1.28;
	color: var(--ff-black);
}

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

/* Stretched-link pattern: the title link is the sole real, keyboard-
   focusable link for the whole card; its accessible name is the
   Product title, which reads sensibly out of context on its own. */
.ff-product-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.ff-product-card__title a:hover,
.ff-product-card__title a:focus-visible {
	color: var(--ff-primary-red);
}

.ff-product-card__meta {
	margin: 0 0 var(--ff-space-5);
	display: flex;
	flex-direction: column;
	gap: var(--ff-space-1);
	font-size: 0.875rem;
}

.ff-product-card__category {
	color: var(--ff-charcoal);
	font-weight: var(--ff-font-weight-secondary);
}

.ff-product-card__model {
	color: var(--ff-charcoal);
	opacity: 0.6;
	font-size: 0.8125rem;
}

.ff-product-card__cta {
	margin-top: auto;
	padding-top: var(--ff-space-4);
	border-top: 1px solid var(--ff-warm-gray);
	display: inline-flex;
	align-items: center;
	gap: var(--ff-space-2);
	font-size: 0.875rem;
	font-weight: var(--ff-font-weight-secondary);
	color: var(--ff-primary-red);
}

.ff-product-card__cta::after {
	content: "\2192";
	transition: transform 0.18s ease;
}

.ff-product-card:hover .ff-product-card__cta::after {
	transform: translateX(4px);
}

/* ---------- Empty state ---------- */

.ff-product-empty-state {
	text-align: center;
	padding-block: var(--ff-space-8);
	color: var(--ff-charcoal);
	font-size: 1.0625rem;
}

/* ---------- Pagination ---------- */

.pagination,
.navigation.pagination {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ff-space-2);
	justify-content: center;
	margin-top: var(--ff-space-8);
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5em;
	height: 2.5em;
	padding-inline: var(--ff-space-2);
	border-radius: var(--ff-radius-sm);
	border: 1px solid var(--ff-warm-gray);
	color: var(--ff-charcoal);
	text-decoration: none;
	font-size: 0.9375rem;
}

.pagination .page-numbers.current {
	background-color: var(--ff-primary-red);
	border-color: var(--ff-primary-red);
	color: var(--ff-white);
}

.pagination .page-numbers:hover:not(.current) {
	border-color: var(--ff-dark-red);
	color: var(--ff-dark-red);
}

/* ---------- Enquiry CTA ---------- */
/* A considered dark panel, not a full-bleed generic banner: the
   section itself sits on the page's off-white surface, with the
   charcoal treatment confined to an inset panel with a red top accent
   and a technical corner bracket, matching the hero's motif. */

.ff-product-cta {
	background-color: var(--ff-off-white);
	padding-block: var(--ff-space-9);
}

.ff-product-cta__panel {
	position: relative;
	background-color: var(--ff-charcoal);
	color: var(--ff-white);
	border-radius: var(--ff-radius-lg);
	overflow: hidden;
	padding: var(--ff-space-8) var(--ff-space-7);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--ff-space-6);
}

.ff-product-cta__panel::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background-color: var(--ff-primary-red);
}

.ff-product-cta__panel::after {
	content: "";
	position: absolute;
	bottom: var(--ff-space-5);
	right: var(--ff-space-5);
	width: 48px;
	height: 48px;
	border-bottom: 2px solid rgba(255, 255, 255, 0.14);
	border-right: 2px solid rgba(255, 255, 255, 0.14);
	pointer-events: none;
}

.ff-product-cta__copy {
	max-width: 34rem;
}

.ff-product-cta__heading {
	margin: 0 0 var(--ff-space-3);
	font-size: clamp(1.5rem, 2.6vw, 1.875rem);
	font-weight: var(--ff-font-weight-heading);
	line-height: 1.25;
}

.ff-product-cta__body {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--ff-warm-gray);
}

.ff-product-cta__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ff-space-3);
	flex: none;
}

.ff-product-cta .ff-btn--secondary {
	color: var(--ff-white);
	border-color: rgba(255, 255, 255, 0.4);
}

.ff-product-cta .ff-btn--secondary:hover,
.ff-product-cta .ff-btn--secondary:focus-visible {
	background-color: var(--ff-white);
	color: var(--ff-charcoal);
	border-color: var(--ff-white);
}

@media (max-width: 767px) {
	.ff-product-cta__panel {
		padding: var(--ff-space-6) var(--ff-space-5);
	}

	.ff-product-cta__actions {
		width: 100%;
		flex-direction: column;
	}

	.ff-product-cta__actions .ff-btn {
		width: 100%;
	}
}
