/* ==========================================================================
   TTS Product Search
   Colours follow the TTS header (--tts-hd-bg / --tts-hd-underline) when present.
   ========================================================================== */
.tts-ps {
	--tts-ps-primary: var(--tts-hd-bg, #085ba5);
	--tts-ps-dark: #14315e;
	--tts-ps-accent: var(--tts-hd-underline, #ff8600);
	--tts-ps-light: #f2f7fe;
	--tts-ps-border: #d6e2f0;
	font-family: "Instrument Sans", sans-serif;
	box-sizing: border-box;
}
.tts-ps *,
.tts-ps *::before,
.tts-ps *::after { box-sizing: border-box; }
.tts-ps [hidden] { display: none !important; }
.tts-ps .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Header icon (plain icon, no circle) ---------- */
.tts-ps--toggle { flex: 0 0 auto; position: static; }
.tts-ps .tts-ps__toggle,
.tts-ps .tts-ps__toggle:hover,
.tts-ps .tts-ps__toggle:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--ttsmm-icon, #fff);
	cursor: pointer;
	transition: opacity .2s ease, color .2s ease;
	-webkit-tap-highlight-color: transparent;
}
.tts-ps .tts-ps__toggle:hover,
.tts-ps .tts-ps__toggle[aria-expanded="true"] { color: var(--tts-ps-accent); }
.tts-ps .tts-ps__toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tts-ps__toggle svg { display: block; width: 22px; height: 22px; }
.tts-ps__icon-close,
.tts-ps__toggle[aria-expanded="true"] .tts-ps__icon-open { display: none; }
.tts-ps__toggle[aria-expanded="true"] .tts-ps__icon-close { display: block; }

/* Desktop bar: icon sits right after the menu, just left of the CTA */
.tts-hd__inner > .tts-ps--desktop { margin-left: auto; }

/* Mobile bar: icon sits just left of the menu button */
.ttsmm-bar { position: relative; }
.ttsmm-bar > .tts-ps--mobile { margin-left: auto; margin-right: 8px; }

/* ---------- Dropdown panel (header) ---------- */
.tts-ps--toggle .tts-ps__panel {
	position: absolute;
	top: calc(100% - 8px);
	right: 25px;
	z-index: 1002;
	width: min(560px, calc(100% - 50px));
	padding: 16px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, .16);
	animation: tts-ps-in .2s ease;
}
.tts-ps--mobile .tts-ps__panel {
	top: 100%;
	left: 0;
	right: 0;
	width: auto;
	border-radius: 0 0 8px 8px;
	max-height: calc(100vh - 80px);
	max-height: calc(100dvh - 80px);
	overflow-y: auto;
}
@keyframes tts-ps-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tts-ps--toggle .tts-ps__panel { animation: none; } }

/* ---------- Form ---------- */
.tts-ps__form {
	position: relative;
	display: flex;
	align-items: stretch;
	margin: 0;
}
.tts-ps .tts-ps__input,
.tts-ps .tts-ps__input:focus {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 48px;
	margin: 0;
	padding: 0 16px;
	background: #fff;
	border: 1px solid var(--tts-ps-border);
	border-right: 0;
	border-radius: 4px 0 0 4px;
	box-shadow: none;
	color: var(--tts-ps-dark);
	font-family: inherit;
	font-size: 16px; /* 16px stops iOS zooming in */
	line-height: 1.3;
	-webkit-appearance: none;
	appearance: none;
}
.tts-ps .tts-ps__input:focus { border-color: var(--tts-ps-primary); outline: none; box-shadow: inset 0 0 0 1px var(--tts-ps-primary); }
.tts-ps .tts-ps__input::placeholder { color: #7a8597; opacity: 1; }
.tts-ps .tts-ps__input::-webkit-search-cancel-button { cursor: pointer; }
.tts-ps .tts-ps__submit,
.tts-ps .tts-ps__submit:hover,
.tts-ps .tts-ps__submit:focus {
	flex: 0 0 52px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	margin: 0;
	padding: 0;
	background: var(--tts-ps-primary);
	border: 1px solid var(--tts-ps-primary);
	border-radius: 0 4px 4px 0;
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	transition: background-color .2s ease;
}
.tts-ps .tts-ps__submit:hover { background: var(--tts-ps-dark); border-color: var(--tts-ps-dark); }
.tts-ps .tts-ps__submit:focus-visible { outline: 2px solid var(--tts-ps-accent); outline-offset: 2px; }

/* ---------- Suggestions ---------- */
.tts-ps__results {
	margin-top: 10px;
	color: var(--tts-ps-dark);
}
.tts-ps--inline { position: relative; }
.tts-ps--inline .tts-ps__results {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 50;
	margin-top: 6px;
	padding: 8px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, .16);
	text-align: left;
}
.tts-ps .tts-ps__item,
.tts-ps .tts-ps__item:visited {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 6px;
	color: var(--tts-ps-dark);
	text-decoration: none;
	transition: background-color .15s ease;
}
.tts-ps .tts-ps__item:hover,
.tts-ps .tts-ps__item.is-active { background: var(--tts-ps-light); color: var(--tts-ps-dark); }
.tts-ps__thumb {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border: 1px solid #e8eef6;
	border-radius: 4px;
	background: #fff center / contain no-repeat;
}
.tts-ps__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.tts-ps__text { display: flex; flex-direction: column; min-width: 0; }
.tts-ps__title {
	overflow: hidden;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tts-ps__title mark { padding: 0; background: none; color: var(--tts-ps-primary); font-weight: 700; }
.tts-ps__meta { margin-top: 2px; color: #6b768a; font-size: 13px; line-height: 1.3; }
.tts-ps .tts-ps__all,
.tts-ps .tts-ps__all:visited {
	display: block;
	margin-top: 6px;
	padding: 12px 8px 4px;
	border-top: 1px solid #e8eef6;
	color: var(--tts-ps-primary);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.tts-ps .tts-ps__all:hover,
.tts-ps .tts-ps__all.is-active { color: var(--tts-ps-accent); text-decoration: underline; }
.tts-ps__msg { margin: 0; padding: 10px 8px; color: #3b4252; font-size: 14px; line-height: 1.4; }

/* ---------- Results page ---------- */
.tts-products .tts-ps-hero .tts-pa-hero__title { text-transform: none; }
.tts-ps-hero__form { max-width: 640px; margin-top: 24px; }
.tts-ps-page__count {
	margin: 0 0 24px;
	color: #3b4252;
	font-family: "Instrument Sans", sans-serif;
	font-size: 16px;
}
.tts-ps-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.tts-ps-list__item a { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.tts-ps-list__item img { width: 80px; height: 80px; object-fit: contain; }

@media (max-width: 767px) {
	.tts-ps--toggle .tts-ps__panel { padding: 12px; }
	.tts-ps-hero__form { margin-top: 18px; }
}
