/**
 * SYZ Machine Site Search — front-end styles.
 *
 * Tokens follow DESIGN.md §"Color tokens"/"Typography and scale" exactly
 * (primary red #B2322E, dark-red hover #8A1F1C, ink #181818, Lexend +
 * DM Sans, DM Mono for technical labels, 6px button radius). Scoped
 * under its own custom properties on .syzm-search-root, matching the
 * per-page-CSS convention already used across
 * hello-theme-child-master/assets/css/syzmachine-html-*.css — no global
 * tokens file exists in this codebase to hook into instead.
 *
 * Perf budget (03 §6): no @font-face, no background-image, fixed
 * heights on the box itself so nothing here can cause CLS when it lands
 * in the hero.
 */

.syzm-search-box,
.syzm-search-page,
.syz-header-search-panel {
	--syzm-red: #B2322E;
	--syzm-red-dark: #8A1F1C;
	--syzm-red-bright: #FF6567;
	--syzm-ink: #181818;
	--syzm-muted: #666666;
	--syzm-border: #E0E0E0;
	--syzm-surface: #FFFFFF;
	--syzm-surface-alt: #F9F9F9;
	--syzm-radius: 6px;
	font-family: 'DM Sans', sans-serif;
}

/* ---------------------------------------------------------------
   Search box (hero / header / inline)
   --------------------------------------------------------------- */

.syzm-search-box {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0;
	width: 100%;
	height: 56px;
	background: var(--syzm-surface);
	border: 1px solid var(--syzm-border);
	border-radius: var(--syzm-radius);
	overflow: visible;
	box-sizing: border-box;
}

.syzm-search-box--header {
	display: block;
	height: auto;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	overflow: visible;
}

.syzm-search-header-field {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 58px;
	padding: 0 8px 0 18px;
	border: 1px solid #D6DCE2;
	border-radius: 10px;
	background: #F7F8F9;
	transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.syzm-search-header-field:focus-within {
	border-color: var(--syzm-red);
	background: #FFFFFF;
	box-shadow: 0 0 0 3px rgba(178, 50, 46, .12);
}

.syzm-search-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-left: 18px;
	color: var(--syzm-muted);
	flex-shrink: 0;
}

.syzm-search-icon svg {
	width: 18px;
	height: 18px;
}

.syzm-search-input {
	flex: 1 1 auto;
	height: 100%;
	border: none;
	outline: none;
	background: transparent;
	font-family: 'DM Sans', sans-serif;
	font-size: 16px; /* >=16px avoids iOS auto-zoom (02 §5) */
	color: var(--syzm-ink);
	padding: 0 12px;
	min-width: 0;
}

.syzm-search-input::placeholder {
	color: var(--syzm-muted);
}

.syzm-search-submit {
	flex-shrink: 0;
	height: 100%;
	padding: 0 24px;
	background: var(--syzm-red);
	color: #FFFFFF;
	border: none;
	border-top-right-radius: var(--syzm-radius);
	border-bottom-right-radius: var(--syzm-radius);
	font-family: 'Lexend', sans-serif;
	font-weight: 700;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.syzm-search-submit:hover {
	background: var(--syzm-red-dark);
	transform: translateY(-1px);
}

.syzm-search-box--hero {
	height: 64px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.syzm-search-box--hero .syzm-search-submit {
	padding: 0 32px;
	font-size: 1rem;
}

.syzm-search-submit svg {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

.syzm-search-submit--icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 8px;
}

.syzm-search-box--header .syzm-search-icon {
	width: 21px;
	height: 21px;
	margin-left: 0;
	color: var(--syzm-red);
}

.syzm-search-box--header .syzm-search-input {
	height: 54px;
	padding: 0;
	font: 500 16px/1.2 'DM Sans', sans-serif;
}

/* Popular-category chips under the box */

.syzm-search-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

.syzm-search-chip {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid var(--syzm-border);
	border-radius: 999px;
	font-family: 'DM Sans', sans-serif;
	font-size: 0.85rem;
	color: var(--syzm-ink);
	text-decoration: none;
	background: var(--syzm-surface);
	transition: border-color 0.2s ease, color 0.2s ease;
}

.syzm-search-chip:hover {
	border-color: var(--syzm-red);
	color: var(--syzm-red);
}

/* ---------------------------------------------------------------
   Suggest dropdown (P1)
   --------------------------------------------------------------- */

.syzm-search-suggest {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: var(--syzm-surface);
	border: 1px solid var(--syzm-border);
	border-radius: 10px;
	box-shadow: 0 14px 30px rgba(24, 24, 24, .10);
	max-height: 420px;
	overflow-y: auto;
	z-index: 60;
}

.syzm-search-box--header .syzm-search-suggest {
	position: static;
	margin-top: 8px;
	max-height: min(46vh, 420px);
	border-color: #D6DCE2;
}

.syzm-search-suggest[hidden] {
	display: none;
}

.syzm-search-suggest-group-label {
	display: none;
}

.syzm-search-suggest-item {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 60px;
	padding: 10px 14px;
	border: 0;
	border-bottom: 1px solid #EDF0F2;
	background: #FFFFFF;
	color: var(--syzm-ink);
	text-decoration: none;
	font: 500 14px/1.3 'DM Sans', sans-serif;
	cursor: pointer;
}

.syzm-search-suggest-item:last-child {
	border-bottom: 0;
}

.syzm-search-suggest-item:hover,
.syzm-search-suggest-item[aria-selected="true"] {
	background: #F5F6F7;
	outline: 0;
}

.syzm-search-suggest-item img {
	width: 38px;
	height: 38px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
	background: #F0F1F2;
}

.syzm-search-suggest-thumb-placeholder {
	width: 38px;
	height: 38px;
	border-radius: 6px;
	flex: 0 0 38px;
	background: #F0F1F2;
}

.syzm-search-suggest-copy {
	min-width: 0;
	display: grid;
	gap: 3px;
}

.syzm-search-suggest-title,
.syzm-search-suggest-meta {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.syzm-search-suggest-title {
	color: var(--syzm-ink);
	font: 600 14px/1.3 'DM Sans', sans-serif;
}

.syzm-search-suggest-meta {
	color: var(--syzm-muted);
	font: 400 12px/1.3 'DM Sans', sans-serif;
}

/* ---------------------------------------------------------------
   Header toggle button + expandable panel (02 §1.1)
   --------------------------------------------------------------- */

.syz-header-search-toggle {
	box-sizing: border-box !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-height: 40px !important;
	padding: 0 !important;
	border: 1px solid var(--syz-header-icon-border, var(--syz-header-border, rgba(255,255,255,.24))) !important;
	border-radius: 50% !important;
	background: transparent !important;
	background-image: none !important;
	color: var(--syz-header-link, #181818) !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: color .25s ease, border-color .25s ease, background .25s ease;
}

.syz-header-search-toggle:hover,
.syz-header-search-toggle:focus,
.syz-header-search-toggle:focus-visible,
.syz-header-search-toggle:active,
.syz-header-search-toggle[aria-expanded="true"] {
	border-color: var(--syz-header-link-hover, var(--syzm-red)) !important;
	background: transparent !important;
	background-image: none !important;
	color: var(--syz-header-link-hover, var(--syzm-red)) !important;
	box-shadow: none !important;
}

.syz-header-search-toggle svg {
	width: 20px;
	height: 20px;
}

.syz-header-search-toggle--noscript {
	text-decoration: none;
	font-family: 'DM Sans', sans-serif;
	font-size: 0.85rem;
}

.syz-header-search-panel {
	position: fixed;
	inset: 0;
	z-index: 100020;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: clamp(92px, 13vh, 148px) 16px 32px;
	overflow-y: auto;
	color: var(--syzm-ink);
	font-family: 'DM Sans', sans-serif;
}

.syz-header-search-panel[hidden] {
	display: none !important;
}

.syz-header-search-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(24, 24, 24, .62);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.syz-header-search-dialog {
	position: relative;
	width: min(680px, 100%);
	padding: 34px 36px 28px;
	border: 1px solid rgba(24, 24, 24, .1);
	border-radius: 18px;
	background: #FFFFFF;
	box-shadow: 0 24px 80px rgba(24, 24, 24, .24);
}

.syz-header-search-close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid #E0E0E0;
	border-radius: 50%;
	background: #FFFFFF;
	color: var(--syzm-ink);
	cursor: pointer;
	transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.syz-header-search-close:hover,
.syz-header-search-close:focus-visible {
	border-color: rgba(178, 50, 46, .45);
	background: #FAF4F4;
	color: var(--syzm-red);
}

.syz-header-search-close svg {
	width: 18px;
	height: 18px;
}

.syz-header-search-heading {
	padding-right: 40px;
}

.syz-header-search-eyebrow {
	display: block;
	margin-bottom: 8px;
	color: var(--syzm-red);
	font: 700 11px/1 'Lexend', sans-serif;
	letter-spacing: .16em;
}

.syz-header-search-heading h2 {
	margin: 0;
	color: var(--syzm-ink);
	font: 800 clamp(25px, 3vw, 34px)/1.05 'Lexend', sans-serif;
}

.syz-header-search-heading p {
	margin: 10px 0 20px;
	color: var(--syzm-muted);
	font: 400 14px/1.55 'DM Sans', sans-serif;
}

.syz-header-search-hint {
	margin: 14px 0 0;
	color: #777777;
	font: 400 12px/1.4 'DM Sans', sans-serif;
	text-align: right;
}

body.syzm-search-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------
   Results page
   --------------------------------------------------------------- */

.syzm-search-page {
	max-width: 1400px;
	margin: 0 auto;
	padding: 48px 40px 80px;
	color: var(--syzm-ink);
}

.syzm-search-container {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.syzm-search-form--results {
	max-width: 720px;
}

.syzm-search-empty-prompt,
.syzm-search-count {
	font-family: 'DM Sans', sans-serif;
	color: var(--syzm-muted);
}

.syzm-search-partial-note {
	font-style: italic;
	margin-left: 6px;
}

.syzm-search-section-title {
	font-family: 'Lexend', sans-serif;
	font-weight: 700;
	font-size: 1.25rem;
	margin: 0 0 16px;
	color: var(--syzm-ink);
}

.syzm-search-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 20px;
}

.syzm-search-cards--product_cat,
.syzm-search-cards--post,
.syzm-search-cards--page,
.syzm-search-cards--product_brand {
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.syzm-search-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--syzm-border);
	border-radius: var(--syzm-radius);
	overflow: hidden;
	background: var(--syzm-surface);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.syzm-search-card:hover {
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.syzm-search-card-thumb {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--syzm-surface-alt);
}

.syzm-search-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.syzm-search-card-body {
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

.syzm-search-card-title {
	font-family: 'Lexend', sans-serif;
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--syzm-ink);
	text-decoration: none;
	line-height: 1.35;
}

.syzm-search-card-title:hover {
	color: var(--syzm-red);
}

.syzm-search-card-subtitle {
	font-family: 'DM Mono', monospace;
	font-size: 0.75rem;
	color: var(--syzm-muted);
	margin: 0;
}

.syzm-search-card-count {
	font-family: 'DM Sans', sans-serif;
	font-size: 0.8rem;
	color: var(--syzm-muted);
	margin: 0;
}

.syzm-search-card-actions {
	margin-top: auto;
	display: flex;
	gap: 10px;
	padding-top: 8px;
}

.syzm-search-card-view,
.syzm-search-card-rfq {
	font-family: 'DM Sans', sans-serif;
	font-size: 0.8rem;
	font-weight: 700;
	text-decoration: none;
	padding: 6px 12px;
	border-radius: var(--syzm-radius);
}

.syzm-search-card-view {
	border: 1px solid var(--syzm-border);
	color: var(--syzm-ink);
}

.syzm-search-card-view:hover {
	border-color: var(--syzm-ink);
}

.syzm-search-card-rfq {
	background: var(--syzm-red);
	color: #FFFFFF;
}

.syzm-search-card-rfq:hover {
	background: var(--syzm-red-dark);
}

.syzm-search-pagination {
	display: flex;
	justify-content: space-between;
	font-family: 'Lexend', sans-serif;
	font-weight: 600;
}

.syzm-search-pagination a {
	color: var(--syzm-red);
	text-decoration: none;
}

/* RFQ band — always present, per 02 §3.2/§4 */

.syzm-search-rfq-band {
	background: var(--syzm-ink);
	color: #FFFFFF;
	border-radius: var(--syzm-radius);
	padding: 40px;
}

.syzm-search-rfq-band h1,
.syzm-search-rfq-band h2 {
	font-family: 'Lexend', sans-serif;
	color: #FFFFFF;
	margin-top: 0;
}

.syzm-search-rfq-band p {
	color: #C2C2BA;
	font-family: 'DM Sans', sans-serif;
	max-width: 640px;
}

.syzm-search-rfq-fallback {
	color: var(--syzm-red-bright);
	font-weight: 700;
}

/* Zero-results page */

.syzm-search-zero-title {
	font-family: 'Lexend', sans-serif;
	font-weight: 800;
	font-size: clamp(1.6rem, 4vw, 2.2rem);
	margin: 0 0 20px;
}

.syzm-search-zero-custom {
	background: var(--syzm-surface-alt);
	border: 1px solid var(--syzm-border);
	border-radius: var(--syzm-radius);
	padding: 28px 32px;
	margin-bottom: 32px;
}

.syzm-search-zero-alt-group {
	margin-bottom: 24px;
}

.syzm-search-zero-alt-label a {
	color: var(--syzm-red);
	font-family: 'Lexend', sans-serif;
	font-weight: 700;
	text-decoration: none;
}

.syzm-search-zero-cat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}

/* ---------------------------------------------------------------
   Mobile (02 §5)
   --------------------------------------------------------------- */

@media (max-width: 782px) {
	.syzm-search-page {
		padding: 32px 20px 56px;
	}

	.syzm-search-box,
	.syzm-search-box--hero {
		height: 52px;
	}

	.syzm-search-box--header {
		height: auto;
	}

	.syz-header-search-panel {
		padding: 88px 16px 24px;
	}

	.syz-header-search-dialog {
		padding: 30px 20px 22px;
		border-radius: 16px;
	}

	.syz-header-search-close {
		top: 12px;
		right: 12px;
	}

	.syz-header-search-heading h2 {
		font-size: clamp(24px, 7vw, 30px);
	}

	.syzm-search-header-field {
		gap: 8px;
		padding: 0 6px 0 12px;
	}

	.syzm-search-submit--icon {
		width: 42px;
		height: 42px;
	}

	.syzm-search-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 4px;
	}

	.syzm-search-cards {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	}

	.syzm-search-rfq-band {
		padding: 28px 20px;
	}
}
