/*
 * Macrigi Search 2027 — v0.1.3
 * Presentation layer for the proprietary AJAX product search.
 */

.mc-product-search,
.mc-mobile-search{
	position:relative;
}

.mc-search-form{position:relative}

/* Desktop scope selector, injected by Macrigi Search. */
.mc-product-search .mc-search-scope{
	position:relative;
	flex:0 0 116px;
	height:100%;
	border-right:1px solid #dbe4e8;
}
.mc-product-search .mc-search-form .mc-search-scope__toggle{
	width:116px!important;
	height:100%!important;
	min-width:116px!important;
	flex:0 0 116px!important;
	display:flex!important;
	align-items:center!important;
	justify-content:space-between!important;
	gap:8px!important;
	padding:0 12px!important;
	border:0!important;
	border-radius:0!important;
	background:#f7fbfd!important;
	color:#102e3a!important;
	font-size:13px!important;
	font-weight:800!important;
	cursor:pointer!important;
}
.mc-product-search .mc-search-scope__toggle:hover,
.mc-product-search .mc-search-scope__toggle[aria-expanded="true"]{
	background:#edf7fb!important;
}
.mc-search-scope__chevron{display:grid;place-items:center;flex:0 0 auto}
.mc-search-scope__chevron svg{width:14px!important;height:14px!important;stroke-width:2!important}
.mc-search-scope__toggle[aria-expanded="true"] .mc-search-scope__chevron{transform:rotate(180deg)}

.mc-search-scope-menu[hidden]{display:none!important}
.mc-search-scope-menu{
	position:absolute;
	top:calc(100% + 8px);
	left:0;
	z-index:10060;
	width:275px;
	padding:7px;
	background:#fff;
	border:1px solid #dce6eb;
	border-radius:11px;
	box-shadow:0 18px 50px rgba(15,45,58,.16);
}
.mc-search-scope-menu__item{
	width:100%;
	min-height:58px;
	dis:grid;
	grid-template-columns:38px minmax(0,1fr);
	align-items:center;
	gap:10px;
	padding:7px 9px;
	border:0;
	border-radius:8px;
	background:#fff;
	color:#102e3a;
	text-align:left;
	cursor:pointer;
}
.mc-search-scope-menu__item:hover,
.mc-search-scope-menu__item:focus-visible,
.mc-search-scope-menu__item.is-active{
	background:#edf7fb;
	outline:0;
}
.mc-search-scope-menu__icon{
	width:36px;
	height:36px;
	dis:grid;
	place-items:center;
	border-radius:8px;
	background:#f1f8fb;
	color:#102e3a;
}
.mc-search-scope-menu__icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mc-search-scope-menu__copy{min-width:0;display:flex;flex-direction:column;gap:2px}
.mc-search-scope-menu__copy strong{font-size:13px;line-height:1.2}
.mc-search-scope-menu__copy small{font-size:11px;line-height:1.25;color:#6d808a}

/* Explicit clear action. */
.mc-search-form .mc-search-clear{
	width:34px!important;
	min-width:34px!important;
	flex:0 0 34px!important;
	height:100%!important;
	dis:grid!important;
	place-items:center!important;
	border:0!important;
	border-radius:0!important;
	background:#fff!important;
	color:#6c7d85!important;
	font-size:24px!important;
	font-weight:300!important;
	line-height:1!important;
	cursor:pointer!important;
	padding:0!important;
}
.mc-search-form .mc-search-clear[hidden]{display:none!important}
.mc-search-form .mc-search-clear:hover{color:#102e3a!important;background:#f7fafb!important}

.mc-search-live[hidden]{display:none!important}
.mc-search-live{
	position:absolute;
	top:calc(100% + 8px);
	left:0;
	right:0;
	z-index:10050;
	background:#fff;
	border:1px solid #dce6eb;
	border-radius:12px;
	box-shadow:0 18px 50px rgba(15,45,58,.16);
	overflow:hidden;
	color:#102e3a;
	text-align:left;
}

.mc-search-live__heading{
	min-height:42px;
	padding:9px 13px;
	dis:flex;
	align-items:center;
	justify-content:space-between;
	gap:14px;
	font-size:12px;
	font-weight:700;
	color:#617581;
	background:#f7fafb;
	border-bottom:1px solid #e7eef2;
}
.mc-search-live__heading>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mc-search-live__all-inline{
	flex:0 0 auto;
	dis:inline-flex;
	align-items:center;
	gap:7px;
	color:#168fd3;
	text-decoration:none;
	font-size:12px;
	font-weight:800;
	white-space:nowrap;
}
.mc-search-live__all-inline:hover,.mc-search-live__all-inline:focus-visible{color:#0b6f9d}

.mc-search-live__results{
	max-height:min(405px,58vh);
	overflow:auto;
	overscroll-behavior:contain;
}
.mc-search-live__item{
	display:grid;
	grid-template-columns:52px minmax(0,1fr) 18px;
	gap:11px;
	align-items:center;
	min-height:66px;
	padding:7px 12px;
	border-bottom:1px solid #edf2f4;
	color:#102e3a;
	text-decoration:none;
	background:#fff;
	transition:background-color .15s ease;
}
.mc-search-live__item:last-child{border-bottom:0}
.mc-search-live__item:hover,
.mc-search-live__item:focus,
.mc-search-live__item.is-active{
	background:#f1f8fb;
	color:#102e3a;
	outline:0;
}
.mc-search-live__thumb{
	width:52px;
	height:52px;
	display:flex;
	align-items:center;
	justify-content:center;
	border-radius:8px;
	overflow:hidden;
	background:#f4f7f8;
	border:1px solid #e6ecef;
}
.mc-search-live__thumb img{width:100%;height:100%;object-fit:contain;display:block}
.mc-search-live__placeholder{width:26px;height:26px;border-radius:6px;background:#dfe9ed}
.mc-search-live__copy{min-width:0;display:flex;flex-direction:column;gap:3px}
.mc-search-live__copy strong{
	display:block;
	font-size:13px;
	line-height:1.25;
	font-weight:750;
	white-space:nowrap;
	overflow:hidden;
	text-overflow:ellipsis;
}
.mc-search-live__sku{
	font-size:11.5px;
	font-weight:600;
	color:#637985;
	white-space:nowrap;
	overflow:hidden;
	text-overflow:ellipsis;
}
.mc-search-live__meta-sep{padding-inline:3px;color:#a1afb6}
.mc-search-live__arrow{font-size:16px;color:#5faece;text-align:right}
.mc-search-live__state{padding:18px 14px;font-size:13px;color:#637985;text-align:center}

/* Tablet uses the already-approved mobile search row. Keep it compact. */
@media (max-width:1024px){
	.mc-product-search .mc-search-scope{display:none!important}
}

@media (max-width:767px){
	.mc-mobile-search{overflow:visible}
	.mc-mobile-search .mc-search-live{
		top:calc(100% + 6px);
		left:0;
		right:0;
		width:100%;
		max-width:calc(100vw - 18px);
		box-sizing:border-box;
		overflow-x:hidden;
		border-radius:10px;
		box-shadow:0 16px 40px rgba(15,45,58,.18);
	}
	.mc-mobile-search .mc-search-live__heading{
		min-height:38px;
		padding:8px 10px;
		gap:8px;
		font-size:11px;
	}
	.mc-mobile-search .mc-search-live__all-inline{
		font-size:11px;
		gap:4px;
	}
	.mc-mobile-search .mc-search-live__all-inline span{display:none}
	.mc-mobile-search .mc-search-live__results{
		max-height:min(420px,52vh);
		overflow-x:hidden;
	}
	.mc-mobile-search .mc-search-live__item{
		grid-template-columns:44px minmax(0,1fr);
		min-height:62px;
		padding:8px 10px;
		gap:9px;
	}
	.mc-mobile-search .mc-search-live__thumb{width:44px;height:44px}
	.mc-mobile-search .mc-search-live__copy strong{
		font-size:13px;
		line-height:1.22;
		white-space:normal;
		display:-webkit-box;
		-webkit-line-clamp:2;
		-webkit-box-orient:vertical;
		overflow:hidden;
	}
	.mc-mobile-search .mc-search-live__arrow{display:none}
	.mc-mobile-search .mc-search-form .mc-search-clear{
		width:30px!important;
		min-width:30px!important;
		flex-basis:30px!important;
		font-size:21px!important;
	}
}

@media (max-width:430px){
	.mc-mobile-search .mc-search-live{max-width:calc(100vw - 14px)}
	.mc-mobile-search .mc-search-live__all-inline{max-width:48%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}

@media (prefers-reduced-motion:reduce){
	.mc-search-live__item{transition:none}
}
