/**
 * Cypros Core
 * V8.33 — Complete-site polish layer
 *
 * Final visual, responsive, accessibility and product-detail refinements.
 * This file is intentionally loaded after every route stylesheet.
 *
 * @package Cypros_Core
 */

/* ==========================================================
   GLOBAL EDITORIAL QUALITY
========================================================== */

.site-main :is(h1, h2, h3) {
	text-wrap: balance;
}

.site-main :is(p, li, dd) {
	text-wrap: pretty;
}

.site-main :is(
	.cy-page-hero__content,
	.cy-services-page-hero__content,
	.cy-process-page-hero__content,
	.cy-industries-page-hero__content,
	.cy-contact-page-hero__content,
	.cy-seo-pillar__lead,
	.cy-product-hero__lead
) > p {
	max-width: 48rem;
}

.site-main section[id] {
	scroll-margin-top: calc(var(--cypros-header-height) + 8rem);
}


/* V8.50 — keyboard entry point for the persistent skip link. */
#primary {
	scroll-margin-top: calc(var(--cypros-header-height) + 1rem);
}

#primary:focus {
	outline: none;
}

@media (max-width: 48rem) {
	#primary {
		scroll-margin-top: calc(var(--cypros-header-height-scrolled, 4.5rem) + 0.75rem);
	}
}

/* A precise electrical datum line on the major editorial surfaces. */
.site-main :is(
	.cy-page-hero,
	.cy-services-page-hero,
	.cy-process-page-hero,
	.cy-industries-page-hero,
	.cy-contact-page-hero,
	.cy-seo-pillar__hero,
	.cy-product-hero
) {
	position: relative;
	isolation: isolate;
}

.site-main :is(
	.cy-page-hero,
	.cy-services-page-hero,
	.cy-process-page-hero,
	.cy-industries-page-hero,
	.cy-contact-page-hero,
	.cy-seo-pillar__hero,
	.cy-product-hero
)::after {
	position: absolute;
	right: var(--cypros-container-padding);
	bottom: 0;
	left: var(--cypros-container-padding);
	height: 1px;
	background: linear-gradient(
		90deg,
		var(--cypros-yellow) 0 5rem,
		rgba(17, 17, 17, 0.16) 5rem 72%,
		transparent 72%
	);
	content: "";
	pointer-events: none;
	z-index: 1;
}

/* ==========================================================
   HEADER / SYSTEM RAIL / BREADCRUMB
========================================================== */

.site-system-rail__inner {
	min-height: 2.35rem;
}

.site-system-rail__inner > span,
.site-system-rail__inner > a {
	white-space: nowrap;
}

.site-system-rail__status i {
	box-shadow: 0 0 0 0.2rem rgba(244, 195, 0, 0.12);
}

.site-breadcrumb__inner {
	min-width: 0;
}

.site-breadcrumb ol {
	min-height: 2.65rem;
}

/* ==========================================================
   PRODUCT DETAIL — DECISION / TECHNICAL NAVIGATION
========================================================== */

.cy-product-local-nav {
	position: sticky;
	top: var(--cypros-header-height-scrolled);
	z-index: calc(var(--cypros-z-sticky) - 2);
	border-top: 1px solid rgba(17, 17, 17, 0.12);
	border-bottom: 1px solid rgba(17, 17, 17, 0.15);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(16px);
}

.cy-product-local-nav__inner {
	display: grid;
	grid-template-columns: minmax(12rem, 0.7fr) minmax(0, 1.3fr);
	align-items: stretch;
	min-height: 4.5rem;
}

.cy-product-local-nav__identity {
	display: flex;
	min-width: 0;
	flex-direction: column;
	justify-content: center;
	gap: 0.2rem;
	padding-right: clamp(1rem, 2vw, 2rem);
	border-right: 1px solid rgba(17, 17, 17, 0.12);
}

.cy-product-local-nav__identity span {
	color: var(--cypros-gray-700);
	font-size: 0.62rem;
	font-weight: 900;
	letter-spacing: 0.12em;
	line-height: 1.15;
	text-transform: uppercase;
}

.cy-product-local-nav__identity strong {
	overflow: hidden;
	font-size: 0.84rem;
	font-weight: 900;
	line-height: 1.2;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cy-product-local-nav__links {
	display: flex;
	min-width: 0;
	align-items: stretch;
	justify-content: flex-end;
}

.cy-product-local-nav__links :is(a, button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 100%;
	padding: 0.85rem clamp(0.7rem, 1vw, 1.15rem);
	border: 0;
	border-left: 1px solid rgba(17, 17, 17, 0.1);
	color: var(--cypros-black);
	background: transparent;
	font: inherit;
	font-size: 0.66rem;
	font-weight: 900;
	letter-spacing: 0.075em;
	line-height: 1.15;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--cypros-transition-fast), color var(--cypros-transition-fast);
}

.cy-product-local-nav__links button {
	gap: 0.45rem;
	background: var(--cypros-yellow);
}

@media (hover: hover) and (pointer: fine) {
	.cy-product-local-nav__links a:hover,
	.cy-product-local-nav__links a:focus-visible {
		background: var(--cypros-gray-100);
	}

	.cy-product-local-nav__links button:hover,
	.cy-product-local-nav__links button:focus-visible {
		color: var(--cypros-white);
		background: var(--cypros-black);
	}
}

.cy-product-local-nav__links :is(a, button):focus-visible {
	position: relative;
	z-index: 2;
	outline: 2px solid var(--cypros-black);
	outline-offset: -3px;
}

/* ==========================================================
   CATALOG — ACCESSIBLE TECHNICAL TABS
========================================================== */

.cy-equipment-selector[role="tablist"] {
	position: relative;
}

.cy-equipment-selector[role="tablist"]::after {
	position: absolute;
	right: 0;
	bottom: -1px;
	left: 0;
	height: 1px;
	background: linear-gradient(90deg, var(--cypros-yellow), rgba(17, 17, 17, 0.15) 38%, transparent 78%);
	content: "";
	pointer-events: none;
}

.cy-equipment-selector__item[role="tab"]:focus-visible {
	z-index: 2;
	outline: 2px solid var(--cypros-yellow);
	outline-offset: -3px;
}

.cy-equipment-panel[role="tabpanel"]:focus-visible {
	outline: 2px solid var(--cypros-yellow);
	outline-offset: 3px;
}

.cy-equipment-brands__tab[aria-current="page"] {
	position: relative;
}

.cy-equipment-brands__tab[aria-current="page"]::after {
	position: absolute;
	right: 1rem;
	bottom: 1rem;
	width: 0.5rem;
	height: 0.5rem;
	background: currentColor;
	content: "";
}

/* ==========================================================
   COMMERCIAL SURFACES — CONSISTENT INDUSTRIAL DENSITY
========================================================== */

.site-main :is(
	.cy-card,
	.cy-equipment-card,
	.cy-product-related__card,
	.cy-services-page-services__item,
	.cy-process-page-flow__item,
	.cy-industries-page-sector
) {
	position: relative;
	isolation: isolate;
}

.site-main :is(
	.cy-card,
	.cy-equipment-card,
	.cy-product-related__card,
	.cy-services-page-services__item,
	.cy-process-page-flow__item,
	.cy-industries-page-sector
)::after {
	position: absolute;
	top: -1px;
	right: -1px;
	width: 0.55rem;
	height: 0.55rem;
	border-top: 1px solid currentColor;
	border-right: 1px solid currentColor;
	opacity: 0.28;
	content: "";
	pointer-events: none;
}

.site-main :is(
	.cy-equipment-filters,
	.cy-contact-page-form-wrap,
	.cy-compare__selector,
	.cy-product-specs__details
) {
	background-clip: padding-box;
}

/* Technical data remains legible when values become longer than expected. */
.site-main :is(
	.cy-product-hero__metrics,
	.cy-product-specs__summary-grid,
	.cy-product-trust-strip,
	.cy-equipment-panel__power
) :is(strong, dd, span) {
	overflow-wrap: anywhere;
}

/* ==========================================================
   FORMS / DECISION INPUTS
========================================================== */

.site-main :is(input, select, textarea, button) {
	font-family: inherit;
}

.site-main :is(input, select, textarea) {
	min-width: 0;
}

.site-main textarea {
	resize: vertical;
}

.site-main :is(input, select, textarea):user-invalid {
	border-color: #7a1f1f;
}

.site-main :is(input, select, textarea):user-valid:not(:placeholder-shown) {
	border-color: rgba(17, 17, 17, 0.42);
}

/* ==========================================================
   RESPONSIVE — TABLET / MOBILE
========================================================== */

@media (max-width: 72rem) {
	.cy-product-local-nav {
		top: var(--cypros-header-height-scrolled);
	}

	.cy-product-local-nav__inner {
		grid-template-columns: 1fr;
		width: 100%;
	}

	.cy-product-local-nav__identity {
		display: none;
	}

	.cy-product-local-nav__links {
		overflow-x: auto;
		justify-content: flex-start;
		scrollbar-width: none;
	}

	.cy-product-local-nav__links::-webkit-scrollbar {
		display: none;
	}

	.cy-product-local-nav__links :is(a, button) {
		flex: 0 0 auto;
		min-height: 3.7rem;
	}
}

@media (max-width: 58rem) {
	.site-system-rail__inner {
		overflow-x: auto;
		justify-content: flex-start;
		scrollbar-width: none;
	}

	.site-system-rail__inner::-webkit-scrollbar {
		display: none;
	}

	.site-system-rail__inner > * {
		flex: 0 0 auto;
	}

	.site-main :is(
		.cy-page-hero,
		.cy-services-page-hero,
		.cy-process-page-hero,
		.cy-industries-page-hero,
		.cy-contact-page-hero,
		.cy-seo-pillar__hero,
		.cy-product-hero
	)::after {
		right: var(--cypros-container-padding);
		left: var(--cypros-container-padding);
		background: linear-gradient(90deg, var(--cypros-yellow) 0 3.25rem, rgba(17, 17, 17, 0.15) 3.25rem 100%);
	}
}

@media (max-width: 40rem) {
	.cy-product-local-nav {
		top: 0;
	}

	.cy-product-local-nav__links :is(a, button) {
		min-height: 3.4rem;
		padding-inline: 0.8rem;
		font-size: 0.6rem;
	}

	.site-main section[id] {
		scroll-margin-top: 7rem;
	}

	.cy-equipment-selector[role="tablist"] {
		overflow-x: auto;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
	}

	.cy-equipment-selector[role="tablist"]::-webkit-scrollbar {
		display: none;
	}

	.cy-equipment-selector__item[role="tab"] {
		scroll-snap-align: start;
	}
}

@media (max-width: 24rem) {
	:root {
		--cypros-container-padding: 1rem;
	}

	.site-main :is(h1, h2) {
		overflow-wrap: anywhere;
	}
}

/* ==========================================================
   PRINT — PRODUCT TECHNICAL SHEET
========================================================== */

@media print {
	@page {
		margin: 14mm;
	}

	html,
	body {
		background: #fff !important;
	}

	.site-header,
	.site-system-rail,
	.site-breadcrumb,
	.site-footer,
	.site-mobile-actions,
	.cy-product-local-nav,
	.cy-product-hero__actions,
	.cy-product-related,
	.cy-product-cta,
	.cy-product-explore {
		display: none !important;
	}

	.cy-product-page,
	.cy-product-page * {
		box-shadow: none !important;
		text-shadow: none !important;
	}

	.cy-product-page :is(section, article, details) {
		break-inside: avoid;
	}

	.cy-product-hero,
	.cy-product-system {
		color: #111 !important;
		background: #fff !important;
	}

	.cy-product-hero::after,
	.cy-product-system::before,
	.cy-product-system::after {
		display: none !important;
	}

	.cy-product-hero__grid {
		grid-template-columns: 1fr 0.75fr !important;
		gap: 10mm !important;
	}

	.cy-product-hero__image {
		max-height: 85mm;
		object-fit: contain;
	}

	.cy-product-specs__details {
		border: 1px solid #bbb !important;
	}

	.cy-product-specs__details summary {
		display: none !important;
	}

	.cy-product-page a {
		color: #111 !important;
		text-decoration: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cy-product-local-nav__links :is(a, button),
	.cy-equipment-selector__item[role="tab"] {
		scroll-behavior: auto;
		transition: none;
	}
}

/* Equipment cards use one real link instead of a simulated link role. */
.cy-equipment-card__link {
	position: static;
}

.cy-equipment-card__link::after {
	position: absolute;
	inset: 0;
	content: "";
}

.cy-equipment-card:has(.cy-equipment-card__link:focus-visible) {
	outline: 2px solid var(--cypros-yellow);
	outline-offset: 2px;
	background: var(--cypros-gray-100);
}

.cy-equipment-card__link:focus-visible {
	outline: none;
}

/* ==========================================================
   V8.35 — CATALOG DECISION FEEDBACK
========================================================== */

.cy-equipment-filters__status {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-height: 2.25rem;
}

.cy-equipment-filters__status::before {
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: var(--cypros-yellow);
	box-shadow: 0 0 0 0.28rem rgba(255, 210, 0, 0.12);
	content: "";
	flex: 0 0 auto;
}

.cy-equipment-filters__status.is-empty::before {
	background: currentColor;
	box-shadow: none;
	opacity: 0.4;
}

.cy-equipment-catalog__empty {
	position: relative;
	min-height: 9rem;
	padding: clamp(1.4rem, 3vw, 2.1rem);
	border: 1px dashed rgba(17, 17, 17, 0.22);
	background:
		linear-gradient(90deg, var(--cypros-yellow) 0 0.24rem, transparent 0.24rem),
		linear-gradient(135deg, rgba(17, 17, 17, 0.035), transparent 42%);
}

.cy-equipment-catalog__empty::after {
	position: absolute;
	top: 1.4rem;
	right: 1.4rem;
	width: 2rem;
	height: 2rem;
	border-top: 1px solid rgba(17, 17, 17, 0.22);
	border-right: 1px solid rgba(17, 17, 17, 0.22);
	content: "";
}

@media (max-width: 40rem) {
	.cy-equipment-filters__status {
		align-items: flex-start;
		line-height: 1.5;
	}
}

/* ==========================================================
   V8.43 — Progressive enhancement / no-JS catalog fallback
========================================================== */

.cy-equipment-catalog__fallback {
	margin-top: 1.5rem;
	padding: clamp(1.1rem, 2vw, 1.6rem);
	border: 1px solid var(--cypros-color-border);
	background: rgba(255, 255, 255, 0.7);
}

.cy-equipment-catalog__fallback > p {
	margin: 0 0 1rem;
	max-width: 48rem;
}

.cy-equipment-catalog__fallback ul {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--cypros-color-border);
}

.cy-equipment-catalog__fallback li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.8rem 0;
	border-bottom: 1px solid var(--cypros-color-border);
}

.cy-equipment-catalog__fallback li:nth-child(odd) {
	padding-right: 1rem;
}

.cy-equipment-catalog__fallback li:nth-child(even) {
	padding-left: 1rem;
}

.cy-equipment-catalog__fallback a {
	font-weight: 750;
	color: inherit;
}

.cy-equipment-catalog__fallback span {
	flex: 0 0 auto;
	font-size: 0.72rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	opacity: 0.7;
}

[data-form-status]:focus {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

@media (max-width: 720px) {
	.cy-equipment-catalog__fallback ul {
		grid-template-columns: 1fr;
	}

	.cy-equipment-catalog__fallback li:nth-child(odd),
	.cy-equipment-catalog__fallback li:nth-child(even) {
		padding-right: 0;
		padding-left: 0;
	}
}
