/* AW Catalog — homepage dual search widget */

.aw-sw {
	/* Always fill the parent column so width is stable across tabs and dropdowns. */
	width: 100%;
	max-width: 100%;
	margin: 1.5rem 0;
	background: #fff;
	border: 1px solid #e6e6e8;
	border-radius: 10px;
	box-shadow: 0 6px 22px rgba( 0,0,0,0.06 );
	/* NOT overflow:hidden — it would clip the typeahead dropdown that extends past
	 * the widget's bottom edge. The tab row keeps its own rounded top corners below. */
	overflow: visible;
	font-family: inherit;
	color: #111;
	/* Lock minimum height so switching tabs doesn't make the widget jump. */
	min-height: 180px;
	box-sizing: border-box;
}
.aw-sw *, .aw-sw *::before, .aw-sw *::after { box-sizing: border-box; }
.aw-sw select, .aw-sw input { box-sizing: border-box; }

/* Tabs */
.aw-sw-tabs {
	display: flex;
	background: #f7f7f8;
	border-bottom: 1px solid #e6e6e8;
	/* keeps the rounded top now that .aw-sw no longer clips with overflow:hidden */
	border-top-left-radius: 10px;
	border-top-right-radius: 10px;
	overflow: hidden;
}
.aw-sw-tab {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0 0.5rem;
	padding: 0.95rem 1rem 0.85rem;
	margin: 0;
	font: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.25;
	text-align: center;
	color: #6b6b70;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: color 150ms ease, background-color 150ms ease;
}
.aw-sw-tab + .aw-sw-tab { border-left: 1px solid #e6e6e8; }
/* Active underline: an inset bar, so the label never shifts when it toggles. */
.aw-sw-tab::after {
	content: "";
	position: absolute;
	left: 18%;
	right: 18%;
	bottom: -1px;
	height: 2px;
	border-radius: 2px;
	background: #c00;
	transform: scaleX( 0 );
	transition: transform 180ms ease;
}
.aw-sw-tab:hover { color: #111; background: #fbfbfc; }
.aw-sw-tab-active,
.aw-sw-tab-active:hover { color: #111; background: #fff; }
.aw-sw-tab-active::after { transform: scaleX( 1 ); }
.aw-sw-tab:focus-visible { outline: 2px solid #c00; outline-offset: -4px; }

.aw-sw-tab-icon {
	flex: none;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.aw-sw-tab-active .aw-sw-tab-icon { stroke: #c00; }
.aw-sw-tab-label { white-space: nowrap; }

/* "Find by Diagram" promotion: a quiet line under the label on desktop, a badge on phones. */
.aw-sw-tab-promo {
	flex-basis: 100%;
	margin-top: 4px;
	font-size: 0.68rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: none;
	color: #c00;
}
.aw-sw-tab-new {
	display: none;
	position: absolute;
	top: 7px;
	right: 7px;
	padding: 2px 5px 1px;
	font-size: 0.55rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
	color: #fff;
	background: #c00;
	border-radius: 3px;
}

@media ( max-width: 700px ) {
	.aw-sw-tab {
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 6px;
		padding: 1rem 0.35rem 0.85rem;
		font-size: 0.66rem;
		letter-spacing: 0.07em;
	}
	.aw-sw-tab-icon { width: 22px; height: 22px; }
	.aw-sw-tab-label { white-space: normal; max-width: 9em; }
	.aw-sw-tab::after { left: 22%; right: 22%; }
	.aw-sw-tab-promo { display: none; }
	.aw-sw-tab-new { display: block; }
}

/* Panels */
.aw-sw-panel {
	display: none;
	padding: 1.4rem 1.6rem 1.5rem;
}
.aw-sw-panel-show { display: block; }

.aw-sw-row {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 1rem;
	margin-bottom: 0;       /* no buttons / hint follow now, kill the bottom gap */
	width: 100%;
}
/* Stop long option labels from forcing the select wider than its grid cell. */
.aw-sw-field { min-width: 0; }
.aw-sw-field select { text-overflow: ellipsis; }
.aw-sw-panel[data-panel="part"] .aw-sw-row { grid-template-columns: 1fr; }
/* FiboSearch widget should fill the panel cleanly */
.aw-sw-fibo { width: 100%; }
.aw-sw-fibo .dgwt-wcas-search-wrapp,
.aw-sw-fibo .dgwt-wcas-search-form { width: 100% !important; max-width: 100% !important; }
.aw-sw-fibo .dgwt-wcas-search-input { width: 100% !important; }
@media ( max-width: 700px ) {
	.aw-sw-row { grid-template-columns: 1fr; gap: 0.75rem; }
	.aw-sw-panel { padding: 1rem 1rem 1.1rem; }
}

/* Item 11 — the diagram search widget lives in a homepage hero container that
 * Avada hides on small screens (fusion-no-small-visibility), so it never showed
 * on mobile. Force the container that holds THIS widget visible on small screens
 * so the "Find by Diagram" search is reachable on phones. Scoped via :has() to the
 * exact container with the widget, so other desktop-only sections stay hidden. */
@media ( max-width: 640px ) {
	.fusion-fullwidth.fusion-no-small-visibility:has( .aw-sw ) { display: flex !important; }
}

.aw-sw-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.aw-sw-field-grow { flex-grow: 2; }
.aw-sw-label {
	font-size: 0.7rem;
	font-weight: 700;
	color: #666;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.aw-sw-field select,
.aw-sw-field input[type="search"] {
	width: 100%;
	padding: 8px 10px;
	font: inherit;
	font-size: 0.95rem;
	border: 1px solid #ccc;
	border-radius: 5px;
	background: #fff;
	box-sizing: border-box;
}
.aw-sw-field select:focus,
.aw-sw-field input:focus {
	outline: none;
	border-color: #c00;
	box-shadow: 0 0 0 3px rgba( 204,0,0,0.12 );
}
.aw-sw-field select:disabled { background: #fafafa; color: #999; }

.aw-sw-actions {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	flex-wrap: wrap;
}
.aw-sw-btn {
	padding: 0.7rem 1.4rem;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	border-radius: 5px;
	border: 0;
	cursor: pointer;
	letter-spacing: 0.02em;
}
.aw-sw-btn-primary {
	background: #c00;
	color: #fff;
}
.aw-sw-btn-primary:hover { background: #a00; }
.aw-sw-hint {
	color: #666;
	font-size: 0.78rem;
}

/* Autocomplete suggestions for the part tab */
.aw-sw-suggest {
	position: relative;
	margin: 0.6rem 0 0;
	padding: 0;
	list-style: none;
	border: 1px solid #e0e0e2;
	border-radius: 5px;
	background: #fff;
	max-height: 280px;
	overflow-y: auto;
}
.aw-sw-suggest-item a {
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: 10px;
	align-items: center;
	padding: 6px 10px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #f3f3f5;
}
.aw-sw-suggest-item a:hover { background: #fffae5; }
.aw-sw-suggest-thumb { width: 40px; height: 40px; object-fit: contain; background: #fafafa; border-radius: 3px; }
.aw-sw-suggest-noimg { width: 40px; height: 40px; background: #f3f3f5; border-radius: 3px; }
.aw-sw-suggest-text code { font-family: monospace; font-size: 0.8rem; color: #c00; margin-right: 4px; }
.aw-sw-suggest-text span { font-size: 0.85rem; color: #333; }
.aw-sw-suggest-empty {
	padding: 0.7rem 0.85rem;
	color: #888;
	font-style: italic;
	font-size: 0.85rem;
}
