/* TMM Product Search — white inline box with a live results panel. */

.tmm-search {
	position: relative;
	display: block;
	width: 100%;
	max-width: 520px;
	margin: 0;
}

/* Inside the Kadence header the item shrinks to its content, so give it a width. */
.site-header .tmm-search {
	width: min(520px, 42vw);
}

#mobile-header .tmm-search {
	width: min(520px, 52vw);
}

/* Kadence's HTML header item can wrap the shortcode in empty paragraphs. */
.header-html p:empty {
	display: none;
}

.tmm-search input.tmm-search__input {
	display: block;
	width: 100%;
	height: 34px;
	margin: 0;
	padding: 0 40px 0 12px;
	font-size: 13px;
	line-height: 34px;
	color: #222222;
	background: #ffffff;
	border: 1px solid #d5d5d5;
	border-radius: 3px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.site-header .tmm-search input.tmm-search__input {
	border-color: #ffffff;
}

.tmm-search input.tmm-search__input:focus {
	outline: 2px solid rgba(255, 255, 255, 0.55);
	outline-offset: 1px;
	color: #222222;
	background: #ffffff;
}

.tmm-search input.tmm-search__input::placeholder {
	color: #9a9a9a;
	opacity: 1;
}

/* hide the browser's own clear "x" so it doesn't collide with the icon */
.tmm-search input.tmm-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.tmm-search button.tmm-search__submit {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 34px;
	margin: 0;
	padding: 0;
	color: #7a7a7a;
	background: transparent;
	border: 0;
	border-radius: 0 3px 3px 0;
	box-shadow: none;
	cursor: pointer;
}

.tmm-search button.tmm-search__submit:hover,
.tmm-search button.tmm-search__submit:focus {
	color: #14509e;
	background: transparent;
	box-shadow: none;
}

.tmm-search.is-loading button.tmm-search__submit svg {
	animation: tmm-search-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes tmm-search-pulse {
	from { opacity: 1; }
	to { opacity: 0.25; }
}

/* Results panel */
.tmm-search__results {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 99999;
	min-width: 300px;
	max-height: min(70vh, 520px);
	overflow-y: auto;
	text-align: left;
	background: #ffffff;
	border: 1px solid #e3e3e3;
	border-radius: 3px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.tmm-search__results[hidden] {
	display: none;
}

.tmm-search a.tmm-search__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	color: #222222 !important;
	text-decoration: none;
	border-bottom: 1px solid #efefef;
}

.tmm-search a.tmm-search__item:hover,
.tmm-search a.tmm-search__item.is-active {
	color: #222222;
	background: #f5f5f5;
}

.tmm-search__thumb {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 3px;
}

.tmm-search__text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tmm-search__title {
	font-size: 13px;
	line-height: 1.35;
	color: #222222;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.tmm-search__sku {
	font-size: 11px;
	line-height: 1.3;
	color: #6b6b6b;
}

.tmm-search__results mark {
	padding: 0;
	font-weight: 700;
	color: inherit;
	background: transparent;
}

.tmm-search__price {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 700;
	color: #14509e;
	white-space: nowrap;
}

.tmm-search__price del {
	font-weight: 400;
	color: #6b6b6b;
}

.tmm-search__price ins {
	text-decoration: none;
}

.tmm-search a.tmm-search__all {
	display: block;
	padding: 10px;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	color: #14509e !important;
	text-decoration: none;
	background: #fafafa;
}

.tmm-search a.tmm-search__all:hover,
.tmm-search a.tmm-search__all.is-active {
	color: #ffffff !important;
	background: #14509e;
}

.tmm-search__empty {
	padding: 14px 12px;
	font-size: 13px;
	color: #6b6b6b;
}

@media (max-width: 767px) {
	.tmm-search__results {
		min-width: 0;
	}
}

/* ==========================================================================
   [tmm_categories] — "All Categories" button + panel
   ========================================================================== */

/* When both shortcodes share one Kadence HTML item, sit them side by side. */
.header-html-inner:has(.tmm-cats),
.header-html-inner > p:has(.tmm-cats) {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
}

.tmm-cats {
	position: relative;
	flex: 0 0 auto;
}

.tmm-cats button.tmm-cats__toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 34px;
	margin: 0;
	padding: 0 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	color: #ffffff;
	background: rgba(0, 0, 0, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 3px;
	box-shadow: none;
	cursor: pointer;
}

.tmm-cats button.tmm-cats__toggle:hover,
.tmm-cats button.tmm-cats__toggle:focus-visible,
.tmm-cats.is-open button.tmm-cats__toggle {
	color: #ffffff;
	background: rgba(0, 0, 0, 0.32);
	box-shadow: none;
}

.tmm-cats__chevron {
	transition: transform 0.15s ease;
}

.tmm-cats.is-open .tmm-cats__chevron {
	transform: rotate(180deg);
}

.tmm-cats__panel {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 99999;
	width: 280px;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	text-align: left;
	background: #ffffff;
	border: 1px solid #e3e3e3;
	border-top: 3px solid #e8212b;
	border-radius: 0 0 3px 3px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.tmm-cats__panel[hidden] {
	display: none;
}

.tmm-cats ul.tmm-cats__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tmm-cats li.tmm-cats__li {
	margin: 0;
	padding: 0;
}

.tmm-cats a.tmm-cats__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 9px 14px;
	font-size: 13px;
	line-height: 1.35;
	color: #222222 !important;
	text-decoration: none;
	border-bottom: 1px solid #efefef;
}

.tmm-cats a.tmm-cats__link:hover,
.tmm-cats a.tmm-cats__link:focus-visible,
.tmm-cats a.tmm-cats__link.is-current {
	color: #14509e !important;
	background: #f5f5f5;
}

.tmm-cats a.tmm-cats__link.is-current {
	font-weight: 700;
}

.tmm-cats__list--d1 a.tmm-cats__link {
	padding-left: 28px;
	font-size: 12px;
	color: #4d4d4d !important;
}

.tmm-cats__count {
	flex: 0 0 auto;
	font-size: 11px;
	color: #8c8c8c;
}

@media (max-width: 767px) {
	/* icon-only button on phones so the search box keeps its room */
	.tmm-cats__label,
	.tmm-cats__chevron {
		display: none;
	}

	.tmm-cats button.tmm-cats__toggle {
		padding: 0 10px;
	}

	.tmm-cats__panel {
		width: min(280px, 86vw);
	}
}
