/**
 * Bausch Site Search
 * Accent colour comes from the theme's active colour scheme (--main_color),
 * with the layout07 teal as the fallback.
 */

:root {
	--bausch-search-accent: var(--main_color, #0097A0);
}

/* ---------------------------------------------------------------
   Header toggle button
   --------------------------------------------------------------- */

.bausch-search-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	margin: 0 0 0 18px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.bausch-search-toggle:hover,
.bausch-search-toggle:focus {
	background: rgba(0, 151, 160, 0.1);
	background: color-mix(in srgb, var(--bausch-search-accent) 12%, transparent);
	color: var(--bausch-search-accent);
	outline: none;
}

.bausch-search-toggle:focus-visible {
	box-shadow: 0 0 0 2px var(--bausch-search-accent);
}

.bausch-search-toggle .icon {
	width: 19px;
	height: 19px;
	fill: currentColor;
	display: block;
}

/* Below the theme's desktop breakpoint the nav collapses behind the burger,
   so the button is pinned next to it instead of flowing in the row. */
@media (max-width: 1023px) {
	.bausch-search-toggle {
		position: absolute;
		right: 56px;
		top: auto;
		z-index: 2;
		margin: 0;
		width: 36px;
		height: 36px;
	}

	.header-content.stuck .bausch-search-toggle {
		top: 50%;
		transform: translateY(-50%);
	}
}

@media (max-width: 767px) {
	.bausch-search-toggle {
		right: 38px;
		width: 32px;
		height: 32px;
	}

	.bausch-search-toggle .icon {
		width: 17px;
		height: 17px;
	}
}

/* ---------------------------------------------------------------
   Overlay
   --------------------------------------------------------------- */

/* Sized against the viewport rather than the containing block: several pages on
   this site scroll horizontally, and 100%/right:0 would inherit that width. */
.bausch-search-panel {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	z-index: 99999;
}

.bausch-search-panel[hidden] {
	display: none;
}

.bausch-search-backdrop {
	position: absolute;
	inset: 0;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(17, 27, 33, 0.55);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.bausch-search-dialog {
	position: relative;
	width: 100%;
	max-width: 100%;
	background: #fff;
	box-shadow: 0 18px 45px rgba(17, 27, 33, 0.18);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	transform: translateY(-18px);
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.bausch-search-panel.is-open .bausch-search-backdrop {
	opacity: 1;
}

.bausch-search-panel.is-open .bausch-search-dialog {
	transform: translateY(0);
	opacity: 1;
}

.admin-bar .bausch-search-dialog {
	margin-top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .bausch-search-dialog {
		margin-top: 46px;
	}
}

/* ---------------------------------------------------------------
   Form
   --------------------------------------------------------------- */

.bausch-search-form {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	max-width: 1170px;
	margin: 0 auto;
	padding: 22px 15px;
	border-bottom: 1px solid #e8ecef;
	box-sizing: border-box;
}

.bausch-search-form__icon {
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	fill: var(--bausch-search-accent);
}

.bausch-search-input.bausch-search-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	padding: 6px 0;
	margin: 0;
	height: auto;
	font-size: 20px;
	line-height: 1.4;
	color: #1f2d35;
	-webkit-appearance: none;
	appearance: none;
}

.bausch-search-input.bausch-search-input:focus {
	outline: none;
	border: 0;
	box-shadow: none;
}

.bausch-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.bausch-search-input::placeholder {
	color: #9aa7ae;
	opacity: 1;
}

.bausch-search-submit.bausch-search-submit {
	flex: 0 0 auto;
	border: 0;
	border-radius: 30px;
	background: var(--bausch-search-accent);
	color: #fff;
	padding: 11px 26px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.bausch-search-submit.bausch-search-submit:hover {
	opacity: 0.85;
	color: #fff;
}

.bausch-search-close {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #7d8b93;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.bausch-search-close:hover {
	background: #f1f4f6;
	color: #1f2d35;
}

.bausch-search-close svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
}

@media (max-width: 767px) {
	.bausch-search-form {
		gap: 8px;
		padding: 14px 15px;
	}

	.bausch-search-form__icon {
		display: none;
	}

	.bausch-search-input.bausch-search-input {
		font-size: 16px;
	}

	.bausch-search-submit.bausch-search-submit {
		padding: 9px 16px;
		font-size: 13px;
	}
}

/* ---------------------------------------------------------------
   Live results
   --------------------------------------------------------------- */

.bausch-search-results {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	width: 100%;
	max-width: 1170px;
	margin: 0 auto;
	padding: 0 15px;
	box-sizing: border-box;
}

.bausch-search-message {
	padding: 26px 0 30px;
	color: #7d8b93;
	font-size: 15px;
}

.bausch-search-message strong {
	color: #1f2d35;
}

.bausch-search-group {
	padding: 18px 0 6px;
	border-top: 1px solid #eef1f3;
}

.bausch-search-group:first-child {
	border-top: 0;
}

.bausch-search-group__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.bausch-search-group__title {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #9aa7ae;
}

.bausch-search-group__count {
	color: #b6c0c6;
	font-weight: 400;
	letter-spacing: 0;
}

.bausch-search-group__more {
	font-size: 13px;
	color: var(--bausch-search-accent);
	white-space: nowrap;
}

.bausch-search-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	margin: 0 -12px;
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.bausch-search-item:hover,
.bausch-search-item:focus,
.bausch-search-item.is-active {
	background: #f4f8f8;
	text-decoration: none;
	color: inherit;
	outline: none;
}

.bausch-search-item__thumb {
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
	border-radius: 6px;
	overflow: hidden;
	background: #f1f4f6;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bausch-search-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bausch-search-item__thumb--empty svg {
	width: 20px;
	height: 20px;
	fill: #c3ced4;
}

.bausch-search-item__body {
	flex: 1 1 auto;
	min-width: 0;
}

.bausch-search-item__title {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: #1f2d35;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bausch-search-item__text {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	line-height: 1.45;
	color: #7d8b93;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bausch-search-item__meta {
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: 600;
	color: var(--bausch-search-accent);
	text-align: right;
}

.bausch-search-item__meta del {
	color: #b6c0c6;
	font-weight: 400;
	margin-right: 4px;
}

.bausch-search-item__badge {
	flex: 0 0 auto;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #9aa7ae;
	border: 1px solid #e3e8eb;
	border-radius: 20px;
	padding: 3px 10px;
}

.bausch-search-footer {
	padding: 14px 0 22px;
	border-top: 1px solid #eef1f3;
	margin-top: 10px;
}

.bausch-search-footer a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--bausch-search-accent);
}

.bausch-search-hl {
	background: rgba(0, 151, 160, 0.18);
	background: color-mix(in srgb, var(--bausch-search-accent) 20%, transparent);
	color: inherit;
	padding: 0;
	border-radius: 2px;
}

@media (max-width: 767px) {
	.bausch-search-item__badge,
	.bausch-search-item__text {
		display: none;
	}

	.bausch-search-item__thumb {
		flex-basis: 44px;
		width: 44px;
		height: 44px;
	}
}

/* Keep the page behind the overlay from scrolling. */
body.bausch-search-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------
   Search results page
   --------------------------------------------------------------- */

.bausch-results-summary {
	font-size: 16px;
	color: #7d8b93;
	margin-bottom: 18px;
}

.bausch-results-summary strong {
	color: #1f2d35;
}

.bausch-results-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 30px;
	padding: 0;
	list-style: none;
}

.bausch-results-filters a {
	display: inline-block;
	padding: 8px 18px;
	border: 1px solid #e3e8eb;
	border-radius: 30px;
	font-size: 14px;
	color: #5c6b73;
	transition: all 0.2s ease;
}

.bausch-results-filters a:hover {
	border-color: var(--bausch-search-accent);
	color: var(--bausch-search-accent);
	text-decoration: none;
}

.bausch-results-filters .is-current a {
	background: var(--bausch-search-accent);
	border-color: var(--bausch-search-accent);
	color: #fff;
}

.bausch-results-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 22px;
	margin-bottom: 40px;
}

.bausch-result-card {
	display: flex;
	gap: 16px;
	padding: 18px;
	border: 1px solid #eef1f3;
	border-radius: 10px;
	background: #fff;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bausch-result-card:hover {
	box-shadow: 0 10px 26px rgba(17, 27, 33, 0.08);
	transform: translateY(-2px);
}

.bausch-result-card__thumb {
	flex: 0 0 92px;
	width: 92px;
	height: 92px;
	border-radius: 8px;
	overflow: hidden;
	background: #f1f4f6;
}

.bausch-result-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bausch-result-card__body {
	flex: 1 1 auto;
	min-width: 0;
}

.bausch-result-card__badge {
	display: inline-block;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bausch-search-accent);
	margin-bottom: 6px;
}

.bausch-result-card__title {
	font-size: 18px;
	line-height: 1.35;
	margin: 0 0 6px;
}

.bausch-result-card__title a {
	color: #1f2d35;
}

.bausch-result-card__title a:hover {
	color: var(--bausch-search-accent);
	text-decoration: none;
}

.bausch-result-card__text {
	font-size: 14px;
	line-height: 1.6;
	color: #7d8b93;
	margin: 0;
}

.bausch-result-card__price {
	display: block;
	margin-top: 8px;
	font-weight: 600;
	color: var(--bausch-search-accent);
}

.bausch-results-none {
	max-width: 620px;
}

.bausch-results-none .bausch-search-form {
	border: 1px solid #e3e8eb;
	border-radius: 8px;
	margin: 22px 0 0;
	padding: 8px 16px;
}

.bausch-results-none .bausch-search-close {
	display: none;
}

@media (max-width: 575px) {
	.bausch-result-card {
		flex-direction: column;
	}

	.bausch-result-card__thumb {
		width: 100%;
		height: 160px;
		flex-basis: auto;
	}
}

/* ---------------------------------------------------------------
   RTL
   --------------------------------------------------------------- */

.rtl .bausch-search-toggle {
	margin: 0 18px 0 0;
}

@media (max-width: 1023px) {
	.rtl .bausch-search-toggle {
		right: auto;
		left: 56px;
		margin: 0;
	}
}

@media (max-width: 767px) {
	.rtl .bausch-search-toggle {
		left: 38px;top: 16px;
	}
}

.rtl .bausch-search-item__meta {
	text-align: left;
}

.rtl .bausch-search-item__meta del {
	margin-right: 0;
	margin-left: 4px;
}
