/*
 * Rex Woo Search — frontend styles.
 */

/* ------------------------------------------------------------------ */
/* Search bar                                                         */
/* ------------------------------------------------------------------ */

.rws-search-wrapp {
	position: relative;
	width: 100%;
	margin: 0;
}

.rws-search-form {
	margin: 0;
	padding: 0;
}

.rws-form-inner {
	position: relative;
	display: flex;
	align-items: stretch;
}

.rws-search-input {
	flex: 1 1 auto;
	width: 100%;
	min-height: 44px;
	padding: 8px 40px 8px 14px;
	border: 1px solid #ddd;
	border-radius: 5px;
	background: #fff;
	color: #333;
	font-size: 15px;
	line-height: 1.4;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}

.rws-search-input:focus {
	outline: none;
	border-color: #999;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}

.rws-search-input::-webkit-search-decoration,
.rws-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.rws-input-magnifier {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: #888;
	pointer-events: none;
}

.rws-rtl .rws-input-magnifier {
	right: auto;
	left: 12px;
}

.rws-input-magnifier svg,
.rws-search-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.rws-search-submit {
	flex: 0 0 auto;
	margin: 0 0 0 6px;
	padding: 0 18px;
	min-height: 44px;
	border: none;
	border-radius: 5px;
	background: #333;
	color: #fff;
	font-size: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rws-search-submit svg {
	width: 18px;
	height: 18px;
}

.rws-search-submit:hover {
	opacity: .9;
}

/* Preloader */

.rws-preloader {
	position: absolute;
	top: 50%;
	right: 40px;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	display: none;
	color: #888;
}

.rws-loading .rws-preloader {
	display: block;
}

.rws-loading .rws-input-magnifier {
	visibility: hidden;
}

.rws-preloader svg {
	width: 100%;
	height: 100%;
	animation: rws-spin .7s linear infinite;
}

.rws-preloader-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

@keyframes rws-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Voice search */

.rws-voice-search {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

.rws-voice-btn {
	border: none;
	background: transparent;
	color: #888;
	cursor: pointer;
	padding: 0 10px;
	display: flex;
	align-items: center;
	align-self: stretch;
}

.rws-voice-btn svg {
	display: block;
	width: 18px;
	height: 18px;
}

.rws-voice-btn:hover {
	color: #333;
}

.rws-has-voice .rws-input-magnifier {
	display: none;
}

.rws-has-voice .rws-search-input {
	padding-right: 14px;
}

.rws-has-voice .rws-preloader {
	right: 46px;
}

.rws-voice-active .rws-voice-btn {
	color: #d63638;
	animation: rws-voice-pulse 1s ease-in-out infinite;
}

@keyframes rws-voice-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .35; }
}

/* ------------------------------------------------------------------ */
/* Icon layout                                                        */
/* ------------------------------------------------------------------ */

.rws-layout-icon .rws-search-form,
.rws-layout-icon-flexible.rws-mobile-mode .rws-search-form,
.rws-layout-icon-flexible-inv:not(.rws-mobile-mode) .rws-search-form {
	display: none;
}

.rws-layout-icon.rws-icon-open .rws-search-form,
.rws-layout-icon-flexible.rws-mobile-mode.rws-icon-open .rws-search-form,
.rws-layout-icon-flexible-inv:not(.rws-mobile-mode).rws-icon-open .rws-search-form {
	display: block;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 100000;
	min-width: 280px;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
	padding: 8px;
}

.rws-search-icon {
	display: inline-flex;
	width: 24px;
	height: 24px;
	color: #333;
	text-decoration: none;
}

.rws-layout-classic .rws-search-icon,
.rws-layout-icon-flexible:not(.rws-mobile-mode) .rws-search-icon,
.rws-layout-icon-flexible-inv.rws-mobile-mode .rws-search-icon {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Suggestions dropdown                                               */
/* ------------------------------------------------------------------ */

.rws-suggestions-wrapp {
	position: absolute;
	z-index: 100001;
	max-width: 600px;
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 0 0 6px 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
	box-sizing: border-box;
}

.rws-suggestion {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 14px;
	color: #333;
	text-decoration: none;
	border-bottom: 1px solid #f2f2f2;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.35;
}

.rws-suggestion:last-child {
	border-bottom: none;
}

.rws-suggestion.rws-selected {
	background: #f5f5f5;
}

.rws-suggestion strong {
	font-weight: 700;
}

.rws-suggestion-headline {
	padding: 8px 14px 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #999;
	background: #fafafa;
}

.rws-si {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	overflow: hidden;
	border-radius: 4px;
	background: #f7f7f7;
}

.rws-si img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rws-content {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.rws-title {
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rws-sku,
.rws-desc {
	font-size: 12px;
	color: #888;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.rws-badges {
	display: inline-flex;
	gap: 6px;
	margin: 2px 0;
}

.rws-badge {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 4px;
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	line-height: 1.5;
}

.rws-badge-sale { background: #fdecec; color: #c0392b; }
.rws-badge-featured { background: #fdf5e2; color: #9a7010; }

.rws-price {
	font-size: 13px;
	font-weight: 600;
	color: #222;
}

.rws-price del {
	color: #999;
	font-weight: 400;
	margin-right: 5px;
}

.rws-breadcrumbs {
	color: #999;
	font-weight: 400;
}

.rws-tax-count {
	flex: 0 0 auto;
	min-width: 24px;
	padding: 1px 8px;
	border-radius: 12px;
	background: #f0f0f0;
	color: #666;
	font-size: 12px;
	text-align: center;
}

.rws-suggestion-more {
	justify-content: center;
	font-weight: 600;
	color: #555;
	background: #fafafa;
}

.rws-suggestion-nores {
	display: block;
	padding: 14px;
	color: #777;
	cursor: default;
	text-align: center;
}

/* Search history */

.rws-history-headline {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.rws-history-clear {
	font-size: 11px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	color: #2f6df6;
	text-decoration: none;
}

.rws-history-clear:hover { text-decoration: underline; }

.rws-history-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	color: #9aa0ab;
}

.rws-history-ico svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ */
/* Details panel                                                      */
/* ------------------------------------------------------------------ */

.rws-details-wrapp {
	position: absolute;
	z-index: 100001;
	width: 320px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 0 6px 6px 0;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
	box-sizing: border-box;
	padding: 16px;
}

.rws-details-image-link {
	display: block;
	margin-bottom: 12px;
}

.rws-details-image {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

.rws-details-title {
	display: block;
	font-size: 16px;
	font-weight: 600;
	color: #222;
	text-decoration: none;
	margin-bottom: 6px;
}

.rws-details-sku {
	font-size: 12px;
	color: #888;
	margin-bottom: 6px;
}

.rws-details-rating {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
	font-size: 12px;
	color: #888;
}

.rws-details-price {
	font-size: 16px;
	font-weight: 700;
	margin-bottom: 8px;
}

.rws-details-desc {
	font-size: 13px;
	color: #666;
	margin-bottom: 10px;
}

.rws-details-stock {
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 12px;
}

.rws-in-stock {
	color: #1a7f37;
}

.rws-out-of-stock {
	color: #c0392b;
}

.rws-details-actions .button {
	display: inline-block;
}

.rws-details-atc-form {
	display: flex;
	align-items: stretch;
	gap: 8px;
}

.rws-details-qty {
	width: 64px;
	padding: 6px 8px;
	border: 1px solid #ddd;
	border-radius: 5px;
	font-size: 14px;
	text-align: center;
}

.rws-details-term-products {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 12px;
}

.rws-details-term-product {
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-decoration: none;
	color: #333;
	font-size: 12px;
}

.rws-details-term-product img {
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.rws-details-term-count {
	color: #999;
	font-weight: 400;
}

/* ------------------------------------------------------------------ */
/* Dark overlay                                                       */
/* ------------------------------------------------------------------ */

.rws-dark-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, .45);
}

/* ------------------------------------------------------------------ */
/* Mobile fullscreen overlay                                          */
/* ------------------------------------------------------------------ */

.rws-mobile-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: #fff;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}

.rws-mobile-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border-bottom: 1px solid #eee;
	flex: 0 0 auto;
}

.rws-mobile-bar .rws-search-form {
	flex: 1 1 auto;
}

.rws-mobile-back {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border: none;
	background: transparent;
	color: #333;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rws-mobile-back svg {
	width: 20px;
	height: 20px;
}

.rws-suggestions-mobile {
	position: static !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: none;
	max-height: none;
	flex: 1 1 auto;
	/* Override any style preset that also targets the panel (loaded later). */
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	margin: 0 !important;
}

html.rws-block-scroll,
html.rws-block-scroll body {
	overflow: hidden !important;
	height: 100%;
}

/* ------------------------------------------------------------------ */
/* Small screens                                                      */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	.rws-suggestions-wrapp {
		max-width: calc(100vw - 20px);
	}
}
