/* Products page: search box, Jobsite360 badge, match lines, card fade-in (2026-11-05, D-79).
   Loaded only on /products/ and the product category addresses (inc/products-page.php). The rest of the page
   (head, category buttons, groups, cards) is the "Products page" block in assets/lind-site.css. */

/* ---------- Search box (above the category buttons) ---------- */
.lind-products__search { max-width: 640px; margin: 40px 0 0; }
.lind-products__search[hidden] { display: none !important; }
.lind-products__search + .lind-products__filter { margin-top: 28px; }

/* Plain grey field (no cut corner: Lucas, 2026-11-05) with a Lind Blue line that draws in under it on focus. */
.lind-products__search-field {
	position: relative;
	background: #f5f5f5;
	border-radius: 2px;
	overflow: hidden;
	transition: background-color 0.2s ease;
}
.lind-products__search-field::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: #118cc9;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.3s ease;
	pointer-events: none;
}
.lind-products__search-field:focus-within { background: #e8f4fa; }
.lind-products__search-field:focus-within::after { transform: scaleX(1); }

.lind-products .lind-products__search input[type="search"] {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 60px;
	margin: 0;
	padding: 0 56px 0 54px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #1f1f1f;
	font-family: "Lato", sans-serif;
	font-size: 17px;
	line-height: 60px;
	outline: none; /* focus shows as the blue line and the light blue field */
}
.lind-products .lind-products__search input[type="search"]::placeholder { color: #666; opacity: 1; }
.lind-products .lind-products__search input[type="search"]::-webkit-search-cancel-button,
.lind-products .lind-products__search input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }

.lind-products__search-icon {
	position: absolute;
	top: 50%;
	left: 18px;
	color: #666;
	transform: translateY(-50%);
	transition: color 0.2s ease;
	pointer-events: none;
}
.lind-products__search-field:focus-within .lind-products__search-icon { color: #118cc9; }

.lind-products .lind-products__search-clear {
	position: absolute;
	top: 50%;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: transparent;
	color: #666;
	cursor: pointer;
	transform: translateY(-50%);
	transition: color 0.2s ease, background-color 0.2s ease;
}
.lind-products .lind-products__search-clear[hidden] { display: none; }
.lind-products .lind-products__search-clear:hover { color: #118cc9; background: rgba(17, 140, 201, 0.08); }
.lind-products .lind-products__search-clear:focus-visible { outline: 2px solid #118cc9; outline-offset: -2px; color: #118cc9; }

/* Hint under the box; while searching it gives way to the result count (the live region). */
.lind-products__search-line { min-height: 1.5em; margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: #666; }
.lind-products__search-hint[hidden] { display: none; }
.lind-products__search-status { color: #1f1f1f; }
.lind-products__search-status:empty { display: none; }

/* The empty block sits after the groups, so the last group is no longer :last-child. */
.lind-products__results > .lind-products__group:last-of-type { margin-bottom: 0; }

/* No match (or only the closest part numbers): a help card with the Lind cut corner. */
.lind-products__empty {
	--lind-empty-cut: 28px;
	max-width: 640px;
	margin-top: 8px;
	padding: 30px 36px;
	background: #f5f5f5;
	clip-path: polygon(0 0, calc(100% - var(--lind-empty-cut)) 0, 100% var(--lind-empty-cut), 100% 100%, 0 100%);
}
.lind-products__group:not([hidden]) ~ .lind-products__empty { margin-top: 70px; }
.lind-products__empty[hidden] { display: none; }
.lind-products__empty p { margin: 0; font-size: 17px; line-height: 1.6; }
.lind-products__empty .lind-products__empty-title {
	margin-bottom: 8px;
	font-family: "Raleway", sans-serif;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: #1f1f1f;
}
.lind-products__empty a { color: #118cc9; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.lind-products__empty a:hover { color: #0d6fa1; }

/* ---------- Cards ---------- */
.lind-product-card[hidden] { display: none !important; }
.lind-products .lind-product-card a { position: relative; }

/* Jobsite360 badge = the small Jobsite360 logo (Lucas, 2026-11-05, D-80), top left on the photo card; commercial
   Jobsite360 products only. In the page it comes after the name, so screen readers read "Beacon360 Blaze, Part of
   Jobsite360". */
.lind-products .lind-product-card__badge {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 1;
	display: block;
	width: 84px;
	height: auto;
	margin: 0;
	border-radius: 0;
	pointer-events: none;
}
@media (max-width: 767px) { .lind-products .lind-product-card__badge { top: 10px; left: 10px; width: 64px; } }

/* Why a card matched ("Matches old part number LED360LED-CLAMP"). */
.lind-product-card__match { display: block; margin-top: 8px; font-size: 14px; line-height: 1.4; color: #666; overflow-wrap: anywhere; }
.lind-product-card__match[hidden] { display: none; }

@media (max-width: 767px) {
	.lind-products__search { margin-top: 32px; }
	.lind-products__search + .lind-products__filter { margin-top: 24px; }
	.lind-products .lind-products__search input[type="search"] { height: 54px; line-height: 54px; padding: 0 50px 0 48px; font-size: 16px; }
	.lind-products__search-icon { left: 15px; width: 20px; height: 20px; }
	.lind-products__search-line { font-size: 14px; }
	.lind-products__empty { padding: 24px 22px; }
	.lind-products__empty .lind-products__empty-title { font-size: 19px; }
	.lind-products__empty p { font-size: 16px; }
	.lind-product-card__match { font-size: 13px; }
}

/* ---------- Motion: cards fade up when a search or a category shows them (not on page load) ---------- */
@keyframes lind-card-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}
.lind-products--animate .lind-product-card:not([hidden]) {
	animation: lind-card-in 0.35s cubic-bezier(0.2, 0.7, 0.3, 1) both;
	animation-delay: calc(var(--i, 0) * 45ms);
}
.lind-products--animate .lind-products__empty:not([hidden]) { animation: lind-card-in 0.3s ease both; }

@media (prefers-reduced-motion: reduce) {
	.lind-products--animate .lind-product-card:not([hidden]),
	.lind-products--animate .lind-products__empty:not([hidden]) { animation: none; }
	.lind-products__search-field,
	.lind-products__search-field::after,
	.lind-products__search-icon { transition: none; }
}
