/*
Manticore Search storefront suggestions.

A theme replaces these rules by shipping its own copy at
catalog/view/theme/<theme>/stylesheet/manticore_search.css — the module picks
that file up instead of this one, exactly as OpenCart does with templates.

The panel carries no Bootstrap utility class and no icon font: every class that
changed name or meaning between Bootstrap 3.4 and 5.3 is replaced by a
manticore-* rule here, and the three icons are inline SVG in the background
properties below, so a theme without Font Awesome draws them all the same. A
replacement must keep position and display on .manticore-search: Bootstrap
hides .dropdown-menu by default, and Bootstrap 5 positions it only once Popper
has written its attributes.
*/

.manticore-search {
	position: absolute;
	display: block;
	top: 100%;
	/* Bootstrap 5 keeps the gutter in a variable and inherits it into the panel; 3 and 4 have no variable and spent 15px a side. */
	left: calc(var(--bs-gutter-x, 30px) * 0.5);
	right: calc(var(--bs-gutter-x, 30px) * 0.5);
	/* Bootstrap 5 dresses every direct child of .row: width, padding and a top margin would push the panel past the right edge of the field. */
	width: auto;
	max-width: none;
	margin: 0;
	padding: 8px 0;
	z-index: 1001;
	overflow-x: hidden;
	overflow-y: auto;
}

.manticore-body {
	padding: 0;
}

/* Rows run edge to edge so the hover band does, and the 16px indent lives on the rows themselves. */
.manticore-section {
	padding: 6px 0;
	border-top: 1px solid #ececec;
}

.manticore-section:first-child {
	border-top: 0;
}

/* The two query lists stand side by side: what this visitor searched on the left, what the shop suggests on the right. Own flex instead of .row and .col-sm-*, the part of Bootstrap that moved the most between 3 and 5. */
.manticore-queries {
	display: flex;
	flex-wrap: wrap;
}

/* Either block may be absent — the script removes the history when the browser has none — and the one left over grows to the full width on its own. */
.manticore-queries-item {
	flex: 1 1 50%;
	width: 50%;
	min-width: 0;
	box-sizing: border-box;
}

@media (max-width: 767px) {
	.manticore-queries-item {
		flex: 0 0 100%;
		width: 100%;
	}
}

.manticore-heading {
	margin: 6px 0;
	padding: 0 16px;
	color: #8a8a8a;
	font-size: 12px;
	line-height: 1.4;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.manticore-heading strong {
	font-weight: 500;
}

.manticore-note {
	margin: 0;
	padding: 4px 16px 8px;
	color: #8a8a8a;
}

.manticore-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.manticore-row {
	display: flex;
	align-items: center;
}

.manticore-row:hover {
	background: #f5f5f5;
}

/* The row the script clones for the search history. It is removed once the list is filled. */
.manticore-template {
	display: none;
}

/* The magnifier is a background image: a theme without an icon font still gets it, and no markup is spent on it. */
.manticore-link {
	flex: 1 1 auto;
	min-width: 0;
	padding: 9px 8px 9px 44px;
	background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 16px center;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* The second level of the category tree. The magnifier moves with the indent so the two levels stay on one axis. */
.manticore-child .manticore-link {
	padding-left: 64px;
	background-position: 36px center;
}

.manticore-link:hover,
.manticore-link:focus {
	color: inherit;
	text-decoration: none;
}

/* Puts the wording into the field instead of running it. The arrow points back at the input, the way search engines draw it. */
.manticore-fill {
	flex: 0 0 auto;
	width: 44px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 18L7 7'/%3E%3Cpath d='M7 15V7h8'/%3E%3C/svg%3E") no-repeat center;
	opacity: 0.55;
	cursor: pointer;
}

.manticore-fill:hover,
.manticore-fill:focus {
	opacity: 1;
}

.manticore-total {
	display: inline-block;
	margin-left: 6px;
	color: #8a8a8a;
	font-size: 85%;
	vertical-align: baseline;
}

.manticore-product {
	display: flex;
	align-items: center;
}

.manticore-product:hover {
	background: #f5f5f5;
}

.manticore-product-link {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	align-items: center;
	padding: 8px 8px 8px 16px;
	color: inherit;
	text-decoration: none;
}

.manticore-product-link:hover,
.manticore-product-link:focus {
	color: inherit;
	text-decoration: none;
}

.manticore-product-image {
	flex: 0 0 auto;
	margin-right: 12px;
}

/* The size comes from the thumbnail settings; the cap is only there so an empty setting, which falls back to the theme's product size, cannot fill the panel with one picture. */
.manticore-product-image img {
	display: block;
	width: auto;
	height: auto;
	max-width: 72px;
	max-height: 72px;
}

.manticore-product-text {
	flex: 1 1 auto;
	min-width: 0;
}

.manticore-product-name {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.manticore-product-meta {
	display: block;
	color: #8a8a8a;
	font-size: 12px;
}

.manticore-product-price {
	display: block;
	margin-top: 2px;
}

.manticore-discount {
	display: inline-block;
	margin-right: 6px;
	padding: 1px 5px;
	border-radius: 3px;
	background: #e03131;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	vertical-align: middle;
	white-space: nowrap;
}

/* The theme owns these three classes and a theme built on Bootstrap 5 may not have them at all. */
.manticore-product-price .price-old {
	margin-right: 6px;
	color: #8a8a8a;
	text-decoration: line-through;
}

.manticore-product-price .price-new {
	font-weight: 600;
}

.manticore-product-price .price-tax {
	display: block;
	color: #8a8a8a;
	font-size: 12px;
}

.manticore-stock {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 5px;
	border-radius: 3px;
	background: #5cb85c;
	color: #fff;
	font-size: 12px;
	line-height: 1.5;
	vertical-align: middle;
	white-space: nowrap;
}

.manticore-cart {
	flex: 0 0 auto;
	width: 44px;
	height: 36px;
	margin-right: 8px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1.5'/%3E%3Ccircle cx='18' cy='20' r='1.5'/%3E%3Cpath d='M2 3h3l2.6 11.4a1 1 0 0 0 1 .8h8.8a1 1 0 0 0 1-.8L21 7H6'/%3E%3C/svg%3E") no-repeat center;
	opacity: 0.7;
	cursor: pointer;
}

.manticore-cart:hover,
.manticore-cart:focus {
	opacity: 1;
}

.manticore-all {
	display: block;
	padding: 10px 16px;
	text-decoration: underline;
	text-decoration-style: dashed;
}
