/* =========================
   SEARCH MODAL — DESKTOP
========================= */

@media (min-width: 1024px) {
	/* Bloqueia scroll em body E html para funcionar em todos os browsers */
	html.lubmix-search-desktop-open,
	body.lubmix-search-desktop-open {
		overflow: hidden;
	}

	#lubmix-header-main > div.bg-white:first-of-type {
		position: relative;
	}

	#lubmix-header .lubmix-search-modal.lubmix-search-modal--open:not(.lubmix-search-modal--mobile),
	#lubmix-header-main > div.bg-white:first-of-type > .lubmix-search-modal.lubmix-search-modal--open:not(.lubmix-search-modal--mobile) {
		position: fixed;
		top: 120px;
		left: calc((100vw - min(1280px, calc(100vw - 32px))) / 2);
		right: auto;
		bottom: auto;
		transform: none;

		width: min(1280px, calc(100vw - 32px));
		height: calc(100vh - 190px);
		max-height: calc(100vh - 190px);

		margin: 0;
		background: #fff;
		border-radius: 0;
		box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
		z-index: 10050;

		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	body.admin-bar #lubmix-header .lubmix-search-modal.lubmix-search-modal--open:not(.lubmix-search-modal--mobile),
	body.admin-bar #lubmix-header-main > div.bg-white:first-of-type > .lubmix-search-modal.lubmix-search-modal--open:not(.lubmix-search-modal--mobile) {
		top: 152px;
		height: calc(100vh - 190px);
		max-height: calc(100vh - 190px);
	}

	#lubmix-header .lubmix-search-modal__head {
		display: flex;
		align-items: center;
		gap: 1rem;
		padding: 1rem 3rem;
		border-bottom: 1px solid #e5e7eb;
		background: #fff;
		flex: 0 0 auto;
	}

	#lubmix-header .lubmix-search-modal__logo {
		display: flex;
		align-items: center;
		width: 260px;
		flex: 0 0 260px;
	}

	#lubmix-header .lubmix-search-modal__logo img {
		display: block;
		width: auto;
		max-width: 220px;
		max-height: 72px;
	}

	#lubmix-header .lubmix-search-modal__head-field {
		position: relative;
		width: 340px;
		max-width: 340px;
		flex: 0 0 340px;
		margin: 0 auto;
	}

	#lubmix-header .lubmix-search-modal__mirror {
		width: 100%;
		box-sizing: border-box;
		border: 1px solid #111;
		border-radius: 9999px;
		padding: 0.75rem 2.75rem 0.75rem 1.75rem;
		font-size: 1rem;
		color: #111;
		background: #fff;
		outline: none;
	}

	#lubmix-header .lubmix-search-modal__head-lupa {
		position: absolute;
		left: 0.8rem;
		top: 50%;
		transform: translateY(-50%);
		color: #9c9ca3;
		pointer-events: none;
	}

	#lubmix-header .lubmix-search-modal__clear {
		position: absolute;
		right: 0.75rem;
		top: 50%;
		transform: translateY(-50%);
		background: transparent;
		border: 0;
		padding: 0.25rem;
		color: #9c9ca3;
		border-radius: 9999px;
		cursor: pointer;
	}

	#lubmix-header .lubmix-search-modal__close--head {
		position: static;
		margin-left: auto;
		width: 40px;
		height: 40px;
		border-radius: 9999px;
		background: #f3f4f6;
	}

	#lubmix-header .lubmix-search-modal__body {
		flex: 1 1 auto;
		min-height: 0;
		overflow: hidden;
		padding: 0;
	}

	#lubmix-header .lubmix-search-modal__layout {
		display: grid;
		grid-template-columns: 320px minmax(0, 1fr);
		height: 100%;
		min-height: 0;
	}

	#lubmix-header .lubmix-search-modal__col--nav {
		border-right: 1px solid #d1d5db;
		overflow-y: auto;
		padding: 1.25rem 2rem;
	}

	#lubmix-header .lubmix-search-modal__col--products {
		overflow-y: auto;
		padding: 1.25rem 2rem;
		background: #fff;
	}

	#lubmix-header .lubmix-search-product-grid {
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 4rem 2rem;
	}

	#lubmix-header .lubmix-search-product-card {
		display: flex;
		flex-direction: column;
		gap: 0.7rem;
		min-width: 0;
		text-decoration: none;
		color: #00695c;
	}

	#lubmix-header .lubmix-search-product-card__img-wrap {
		display: block;
		width: 100%;
		aspect-ratio: 1 / 1;
		background: #fff;
		overflow: hidden;
		border: 0;
	}

	#lubmix-header .lubmix-search-product-card__img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: contain;
	}

	#lubmix-header .lubmix-search-product-card__title {
		font-size: 1rem;
		font-weight: 700;
		line-height: 1.2;
		color: #00695c;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	#lubmix-header .lubmix-search-product-card__ex {
		font-size: 0.875rem;
		line-height: 1.2;
		color: #444;
		display: -webkit-box;
		-webkit-line-clamp: 4;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	#lubmix-header .lubmix-search-products__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		margin-bottom: 1.5rem;
	}

	#lubmix-header .lubmix-search-products__all {
		display: inline-flex;
		align-items: center;
		gap: 0.25rem;
		font-size: 0.8125rem;
		font-weight: 700;
		color: #00695c;
		text-decoration: none;
		white-space: nowrap;
		padding: 0.25rem 0.75rem;
		border: 1px solid #00695c;
		border-radius: 9999px;
		transition: background 0.15s, color 0.15s;
	}

	#lubmix-header .lubmix-search-products__all:hover {
		background: #00695c;
		color: #fff;
	}
}

/* DESKTOP — remover header interno do modal */
@media (min-width: 1024px) {
	#lubmix-header .lubmix-search-modal__head {
		display: none;
	}

	/* sobe o conteúdo pra ocupar o espaço */
	#lubmix-header .lubmix-search-modal__body {
		padding-top: 1.25rem;
	}
}

/* =========================
   MOBILE
========================= */

@media (max-width: 1023px) {
	#lubmix-search-mobile {
		min-height: 100vh;
		min-height: 100dvh;
	}

	#lubmix-search-mobile .lubmix-search-mobile__form {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	#lubmix-search-mobile .lubmix-search-mobile__field {
		position: relative;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	#lubmix-search-mobile .lubmix-search-mobile__input {
		appearance: none;
		box-sizing: border-box;
		display: block;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		margin: 0;
		border: 1px solid #cfcfd4;
		border-radius: 9999px;
		background: #fff;
		color: var(--lubmix-text, #2f2f2f);
		font-size: 16px;
		line-height: 1.35;
		padding: 0.875rem 5rem 0.875rem 1rem;
		outline: none;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	#lubmix-search-mobile .lubmix-search-mobile__input::placeholder {
		color: #9c9ca3;
		opacity: 1;
	}

	#lubmix-search-mobile .lubmix-search-mobile__input:focus {
		border-color: var(--lubmix-secondary, #006bb4);
	}

	#lubmix-search-mobile .lubmix-search-mobile__clear {
		position: absolute;
		top: 50%;
		right: 2.45rem;
		left: auto;
		z-index: 2;
		transform: translateY(-50%);
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 2rem;
		height: 2rem;
		padding: 0;
		border: 0;
		border-radius: 9999px;
		background: transparent;
		color: #9c9ca3;
	}

	#lubmix-search-mobile .lubmix-search-mobile__lupa {
		position: absolute;
		top: 50%;
		right: 0.75rem;
		left: auto;
		z-index: 1;
		transform: translateY(-50%);
		display: flex;
		align-items: center;
		justify-content: center;
		pointer-events: none;
		color: #9c9ca3;
	}

	#lubmix-search-mobile .lubmix-search-mobile__lupa-icon {
		display: block;
		flex-shrink: 0;
	}

	#lubmix-search-mobile .lubmix-search-mobile__suggest {
		display: flex;
		flex-direction: column;
		flex: 1 1 0;
		min-height: 0;
	}

	#lubmix-search-mobile .lubmix-search-modal--mobile {
		position: relative;
		border: 0;
		box-shadow: none;
		display: flex;
		flex-direction: column;
		flex: 1 1 0;
		min-height: 0;
		width: 100%;
		overflow: hidden;
	}

	#lubmix-search-mobile .lubmix-search-modal__body {
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		flex: 1 1 0;
		min-height: 0;
		padding: 0;
	}

	#lubmix-search-mobile .lubmix-search-modal__layout {
		display: flex;
		flex-direction: column;
		gap: 0;
		min-height: 0;
	}

	#lubmix-search-mobile .lubmix-search-modal__col--nav {
		border: 0;
		border-bottom: 1px solid #e5e7eb;
		padding: 0.75rem 1rem;
		overflow: visible;
	}

	#lubmix-search-mobile .lubmix-search-modal__col--products {
		order: -1; /* Produtos aparecem acima de Buscas Populares no mobile */
		display: flex;
		flex-direction: column;
		width: 100%;
		padding: 1rem 0.75rem 1.5rem;
		background: #fff;
		overflow: visible;
	}

	#lubmix-search-mobile .lubmix-search-section:first-child {
		margin-top: 0;
	}

	#lubmix-search-mobile .lubmix-search-section__title {
		margin-top: 0;
		font-size: 1rem;
		font-weight: 700;
	}

	#lubmix-search-mobile .lubmix-search-cat-link {
		font-size: 0.875rem;
		color: #0f766e;
		text-decoration: underline;
	}

	#lubmix-search-mobile .lubmix-search-products__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		margin: 0.5rem 0 1rem;
	}

	#lubmix-search-mobile .lubmix-search-products__title {
		font-size: 14px;
		font-weight: 700;
		margin: 0;
		color: #111;
	}

	#lubmix-search-mobile .lubmix-search-products__all {
		font-size: 11px;
		font-weight: 700;
		color: #00695c;
		text-decoration: none;
		white-space: nowrap;
	}

	#lubmix-search-mobile .lubmix-search-product-grid {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1rem 0.75rem;
	}

	#lubmix-search-mobile .lubmix-search-product-card {
		display: flex;
		flex-direction: column;
		gap: 0.4rem;
		min-width: 0;
		text-decoration: none;
		color: #0f766e;
	}

	#lubmix-search-mobile .lubmix-search-product-card__img-wrap {
		display: block;
		width: 100%;
		aspect-ratio: 1 / 1;
		margin: 0;
		border-radius: 6px;
		background: #fff;
		overflow: hidden;
		border: 1px solid #f3f4f6;
	}

	#lubmix-search-mobile .lubmix-search-product-card__img {
		width: 100%;
		height: 100%;
		object-fit: contain;
		display: block;
	}

	#lubmix-search-mobile .lubmix-search-product-card__title {
		font-size: 11px;
		line-height: 1.25;
		font-weight: 700;
		color: #00695c;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	#lubmix-search-mobile .lubmix-search-product-card__ex {
		font-size: 10px;
		line-height: 1.3;
		color: #555;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
}

/* =========================
   COMUM
========================= */

#lubmix-header .lubmix-search-recent-chip.is-active,
#lubmix-search-mobile .lubmix-search-recent-chip.is-active {
	background: #e0f2fe;
	color: #0369a1;
}

/* MOBILE — esconder botão de fechar modal */
@media (max-width: 1023px) {
	#lubmix-search-mobile .lubmix-search-modal__close {
		display: none;
	}
}

/* Remove o X nativo do input type="search" */
#lubmix-search-mobile .lubmix-search-mobile__input::-webkit-search-cancel-button,
#lubmix-search-mobile .lubmix-search-mobile__input::-webkit-search-decoration,
#lubmix-search-mobile .lubmix-search-mobile__input::-webkit-search-results-button,
#lubmix-search-mobile .lubmix-search-mobile__input::-webkit-search-results-decoration {
	appearance: none;
	display: none;
}

#lubmix-search-mobile .lubmix-search-mobile__input {
	-webkit-appearance: none;
	appearance: none;
}