/**
 * Live Ajax Search — frontend dropdown.
 */

.ofcore-search-wrap {
	position: relative;
	width: 100%;
}

.ofcore-search-results {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	left: auto;
	width: max(100%, 440px);
	max-width: calc(100vw - 32px);
	max-height: min(72vh, 640px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .08);
	border-radius: 12px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, .14);
	z-index: 99999;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
.ofcore-search-results[hidden] { display: none !important; }

.ofcore-search-section + .ofcore-search-section { border-top: 1px solid rgba(0, 0, 0, .06); }

.ofcore-search-heading {
	padding: 14px 18px 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	color: #8a8a8a;
}

.ofcore-search-product-list { padding: 2px 8px 8px; }

.ofcore-search-item {
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
	padding: 8px 10px;
	border-radius: 8px;
	color: #111 !important;
	text-decoration: none !important;
	transition: background .12s;
}
.ofcore-search-item:not(:has(.ofcore-search-item__img)) { grid-template-columns: minmax(0, 1fr) auto; }
.ofcore-search-item:hover,
.ofcore-search-item.is-active { background: #f4f4f4; }

.ofcore-search-item__img {
	width: 52px;
	height: 65px;
	overflow: hidden;
	border-radius: 6px;
	background: #f2f2f2;
}
.ofcore-search-item__img img { display: block; width: 100%; height: 100%; object-fit: cover; }

.ofcore-search-item__info { display: contents; }
.ofcore-search-item__title {
	grid-column: 2;
	align-self: end;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: 0;
	text-transform: none;
}
.ofcore-search-item:not(:has(.ofcore-search-item__img)) .ofcore-search-item__title,
.ofcore-search-item:not(:has(.ofcore-search-item__img)) .ofcore-search-item__meta { grid-column: 1; }
.ofcore-search-item__meta {
	grid-column: 2;
	align-self: start;
	overflow: hidden;
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: #8a8a8a;
}
.ofcore-search-item__price {
	grid-column: -2 / -1;
	grid-row: 1 / span 2;
	align-self: center;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1px;
	font-size: 13px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.ofcore-search-item__price del { order: 2; margin: 0; font-size: 11.5px; font-weight: 400; color: #9a9a9a; }
.ofcore-search-item__price ins { text-decoration: none; background: none; }
.ofcore-search-item__img { grid-row: 1 / span 2; }

.ofcore-search-cat-list,
.ofcore-search-brand-list,
.ofcore-search-popular-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 2px 18px 14px;
}
.ofcore-search-cat-list a,
.ofcore-search-brand-list a,
.ofcore-search-popular-list button {
	display: inline-flex;
	align-items: center;
	height: 30px;
	padding: 0 12px;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 999px;
	background: #fff;
	color: #111 !important;
	font: inherit;
	font-size: 12.5px;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: none !important;
	cursor: pointer;
	transition: border-color .12s, background .12s;
}
.ofcore-search-cat-list a:hover,
.ofcore-search-brand-list a:hover,
.ofcore-search-popular-list button:hover,
.ofcore-search-cat-list a.is-active,
.ofcore-search-brand-list a.is-active { border-color: #111; background: #fafafa; }

.ofcore-search-viewall {
	position: sticky;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	border-top: 1px solid rgba(0, 0, 0, .08);
	background: #fff !important;
	color: #111 !important;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: none !important;
}
.ofcore-search-viewall:hover,
.ofcore-search-viewall.is-active { background: #f4f4f4 !important; }

.ofcore-search-noresults,
.ofcore-search-loading {
	padding: 28px 18px;
	text-align: center;
	font-size: 13px;
	color: #8a8a8a;
}

/* Sit inside theme search panel */
.search-panel .ofcore-search-wrap,
[data-search-panel] .ofcore-search-wrap {
	flex: 1;
	min-width: 0;
}

.search-panel.is-open .ofcore-search-results:not([hidden]),
[data-search-panel].is-open .ofcore-search-results:not([hidden]) {
	display: block;
}

@media (max-width: 640px) {
	.ofcore-search-results {
		position: fixed;
		top: auto;
		left: 8px;
		right: 8px;
		width: auto;
		max-width: none;
		max-height: 62vh;
	}
}

/* Tarayıcının mavi "temizle" düğmesi yerine sade gri çarpı */
input[data-ofcore-ls]::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 14px;
	margin-left: 6px;
	cursor: pointer;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}
