/* ==========================================================================
   Header arama paneli (27 Eki 2026) — panelin TEK stil dosyası
   Markup woocommerce/product-searchform.php (.pt-ara), davranış js/flatsome-live-search.js.
   Tasarım dili tasarim-dili.css'teki --td-* değişkenleri: Poppins, saf siyah metin,
   #165EC9 vurgu, gri kart #f5f5f7, kart köşesi 20px, kontrol köşesi 12px.

   Flatsome'un canlı arama kuralları (flatsome.css, bu dosyadan önce yüklenir) panel
   kapsamıyla (.pt-ara …) özgüllükte geçilir; !important yok.
   ========================================================================== */

.pt-ara {
	display: none;
	position: absolute;
	top: calc(100% + 10px);
	left: 50%;
	z-index: 1000;
	width: min(800px, calc(100vw - 32px));
	transform: translateX(calc(-50% + var(--pt-ara-x, 0px)));
	border: 1px solid var(--td-line-2, #ececf0);
	border-radius: var(--td-r-card, 20px);
	background: #fff;
	box-shadow: var(--td-shadow, 0 18px 48px rgba(0, 0, 0, .12));
	font-family: var(--td-font, 'Poppins', sans-serif);
	color: var(--td-ink, #000);
	text-align: left;
	overflow: hidden;
}
.pt-ara.pt-ara--acik { display: block; }

/* Flatsome düğme varsayılanlarını (büyük harf, min-height, sağ boşluk) sıfırla */
.pt-ara button {
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	font-family: inherit;
	letter-spacing: 0;
	line-height: inherit;
	text-transform: none;
	color: inherit;
	cursor: pointer;
}
.pt-ara svg { flex: none; }

.pt-ara__ust { display: none; }

.pt-ara__govde {
	display: flex;
	max-height: min(640px, calc(100vh - 180px));
}
.pt-ara__ana {
	flex: 1;
	min-width: 0;
	padding: 20px 22px 22px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

/* ---------- Bölümler ---------- */
.pt-ara__bolum + .pt-ara__bolum,
.pt-ara__sonuclar + .pt-ara__bolum { margin-top: 22px; }
.pt-ara__bolum--bos + .pt-ara__sonuclar + .pt-ara__bolum { margin-top: 0; }
.pt-ara__bolum--bos { display: none; }

.pt-ara__baslik {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}
.pt-ara__baslik-yazi,
.pt-ara__sonuc-baslik {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--td-soft, #6e6e73);
}
.pt-ara .pt-ara__temizle {
	font-size: 13px;
	font-weight: 500;
	color: var(--td-accent, #165ec9);
}
.pt-ara .pt-ara__temizle:hover { text-decoration: underline; }

/* Son / popüler arama hapları */
.pt-ara__etiketler {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.pt-ara .pt-ara__etiket {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 36px;
	padding: 0 15px;
	border: 1px solid var(--td-line, #d9d9d9);
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	font-weight: 400;
	line-height: 1;
	color: var(--td-ink, #000);
	white-space: nowrap;
	transition: background-color .15s, border-color .15s;
}
.pt-ara .pt-ara__etiket:hover,
.pt-ara .pt-ara__etiket:focus-visible {
	border-color: var(--td-ink, #000);
	background: var(--td-card, #f5f5f7);
}
.pt-ara__etiket--gecmis svg { color: var(--td-soft, #6e6e73); }
.pt-ara__etiket--gecmis span { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Sana özel ürünler ---------- */
.pt-ara__oklar { display: none; gap: 6px; }
.pt-ara__oneriler--kayar .pt-ara__oklar { display: inline-flex; }
.pt-ara .pt-ara__ok {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 1px solid var(--td-line, #d9d9d9);
	border-radius: 50%;
	background: #fff;
	color: var(--td-ink, #000);
	transition: border-color .15s, opacity .15s;
}
.pt-ara .pt-ara__ok:hover:not(:disabled) { border-color: var(--td-ink, #000); }
.pt-ara .pt-ara__ok:disabled { opacity: .35; cursor: default; }

.pt-ara__kartlar {
	display: grid;
	grid-auto-columns: calc((100% - 24px) / 3);
	grid-auto-flow: column;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.pt-ara__kartlar::-webkit-scrollbar { display: none; }

.pt-ara .pt-ara__kart {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 14px 14px 16px;
	border-radius: 16px;
	background: var(--td-card, #f5f5f7);
	color: var(--td-ink, #000);
	scroll-snap-align: start;
	transition: background-color .15s;
}
.pt-ara .pt-ara__kart:hover { background: var(--td-line-2, #ececf0); }
.pt-ara__kart-gorsel {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 104px;
	margin-bottom: 12px;
}
.pt-ara__kart-gorsel img {
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 104px;
	object-fit: contain;
	mix-blend-mode: multiply;
}
.pt-ara__kart-ad {
	display: -webkit-box;
	min-height: calc(2 * 1.38em);
	overflow: hidden;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.38;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}
.pt-ara__kart-etiket {
	margin-top: 10px;
	font-size: 11.5px;
	color: var(--td-soft, #6e6e73);
}
.pt-ara__kart-fiyat {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

/* ---------- Canlı sonuçlar ---------- */
.pt-ara .pt-ara__sonuclar .autocomplete-suggestions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 8px;
	position: static;
	max-height: none;
	overflow: visible;
	border: 0;
	background: none;
	box-shadow: none;
}
.pt-ara__sonuc-baslik {
	flex: 0 0 100%;
	margin: 14px 0 6px;
}
.pt-ara__sonuc-baslik:first-child { margin-top: 0; }

.pt-ara .autocomplete-suggestion {
	display: flex;
	flex: 0 0 calc(100% + 20px);
	align-items: center;
	gap: 14px;
	margin: 0 -10px;
	padding: 8px 10px;
	border: 0;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.4;
	color: var(--td-ink, #000);
	cursor: pointer;
	transition: background-color .12s;
}
.pt-ara .autocomplete-suggestion.autocomplete-selected { background: var(--td-card, #f5f5f7); }

.pt-ara-satir__ad {
	display: -webkit-box;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}
.pt-ara-satir__ad strong { font-weight: 600; }

.pt-ara-satir__gorsel {
	display: flex;
	flex: 0 0 56px;
	align-items: center;
	justify-content: center;
	height: 56px;
	border-radius: 12px;
	background: var(--td-card, #f5f5f7);
	color: var(--td-soft, #6e6e73);
	transition: background-color .12s;
}
.pt-ara .autocomplete-selected .pt-ara-satir__gorsel { background: #fff; }
.pt-ara .pt-ara-satir__gorsel img {
	display: block;
	width: 46px;
	height: 46px;
	margin: 0;
	border-radius: 0;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.pt-ara-satir__fiyat {
	flex: none;
	font-size: 14px;
	font-weight: 600;
	text-align: right;
	white-space: nowrap;
}
.pt-ara-satir__fiyat del {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: var(--td-soft, #6e6e73);
	opacity: 1;
}
.pt-ara-satir__fiyat ins { text-decoration: none; }

.pt-ara-satir__ok {
	color: var(--td-soft, #6e6e73);
	transition: transform .15s;
}
.pt-ara .autocomplete-selected .pt-ara-satir__ok { transform: translateX(2px); }

/* Kategori / marka: sonuçların üstünde yan yana haplar */
.pt-ara .pt-ara-satir--kategori {
	flex: 0 0 auto;
	gap: 7px;
	height: 36px;
	margin: 0 0 8px;
	padding: 0 15px;
	border: 1px solid var(--td-line, #d9d9d9);
	border-radius: 999px;
	font-size: 13px;
	line-height: 1;
	white-space: nowrap;
}
.pt-ara .pt-ara-satir--kategori.autocomplete-selected { border-color: var(--td-ink, #000); }
.pt-ara-satir--kategori svg { color: var(--td-soft, #6e6e73); }
.pt-ara-satir--kategori .pt-ara-satir__ad { display: block; flex: none; font-weight: 500; }
.pt-ara-satir__ek { font-size: 12px; color: var(--td-soft, #6e6e73); }

/* Sayfa / yazı satırı: görsel yerine belge ikonu */
.pt-ara .pt-ara-satir--sayfa .pt-ara-satir__gorsel { flex-basis: 40px; height: 40px; }

/* "Tüm sonuçlar": listenin sonunda eylem */
.pt-ara .pt-ara-satir--tum {
	flex-basis: 100%;
	justify-content: space-between;
	margin: 10px 0 0;
	padding: 13px 16px;
	background: var(--td-accent-bg, #e8f0fb);
	font-weight: 600;
	color: var(--td-accent, #165ec9);
}
.pt-ara .pt-ara-satir--tum.autocomplete-selected { background: #d8e6f9; }
.pt-ara-satir--tum .pt-ara-satir__ad { display: block; flex: none; }
.pt-ara-satir--tum .pt-ara-satir__ok { color: currentColor; }

/* "Sonuç bulunamadı": bilgi, eylem değil */
.pt-ara .pt-ara-satir--yok {
	padding: 4px 10px 4px;
	font-size: 14px;
	color: var(--td-soft, #6e6e73);
	cursor: default;
}
.pt-ara .pt-ara-satir--yok.autocomplete-selected { background: none; }
.pt-ara-satir--yok .pt-ara-satir__ad { -webkit-line-clamp: unset; }
.pt-ara-satir--yok strong { font-weight: 600; color: var(--td-ink, #000); }

/* ---------- Durumlar ---------- */
.pt-ara:not(.pt-ara--sonuc):not(.pt-ara--sonucsuz) .pt-ara__sonuclar,
.pt-ara--sonuc .pt-ara__gecmis,
.pt-ara--sonuc .pt-ara__populer,
.pt-ara--sonuc .pt-ara__oneriler,
.pt-ara--sonucsuz .pt-ara__gecmis,
.pt-ara--sonucsuz .pt-ara__oneriler { display: none; }

/* ---------- Avantajlar (masaüstünde sağ sütun) ---------- */
.pt-ara__yan {
	display: flex;
	flex: 0 0 210px;
	flex-direction: column;
	gap: 8px;
	padding: 20px 16px;
	border-left: 1px solid var(--td-line-2, #ececf0);
}
.pt-ara__avantaj {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-radius: 14px;
	background: var(--td-card, #f5f5f7);
	font-size: 12px;
	line-height: 1.35;
	color: var(--td-soft, #6e6e73);
}
.pt-ara__avantaj img {
	flex: none;
	width: 26px;
	height: 26px;
	filter: grayscale(1) brightness(0);
	opacity: .85;
}
.pt-ara__avantaj strong {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--td-ink, #000);
}

/* ---------- Telefon / tablet: arama kutusunun altından ekran sonuna sabit sayfa ---------- */
@media (max-width: 849px) {
	.pt-ara {
		position: fixed;
		top: var(--pt-ara-ust, 120px);
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		transform: none;
		border: 0;
		border-radius: var(--td-r-card, 20px) var(--td-r-card, 20px) 0 0;
		box-shadow: 0 -10px 40px rgba(0, 0, 0, .14);
	}
	.pt-ara.pt-ara--acik { display: flex; flex-direction: column; }

	.pt-ara__ust {
		display: flex;
		flex: none;
		align-items: center;
		justify-content: space-between;
		padding: 16px 16px 6px;
	}
	.pt-ara__ust-baslik { font-size: 15px; font-weight: 600; }
	.pt-ara .pt-ara__kapat {
		height: 32px;
		padding: 0 14px;
		border-radius: 999px;
		background: var(--td-card, #f5f5f7);
		font-size: 13px;
		font-weight: 500;
	}

	.pt-ara__govde {
		display: block;
		flex: 1;
		min-height: 0;
		max-height: none;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}
	.pt-ara__ana {
		padding: 10px 16px calc(28px + env(safe-area-inset-bottom));
		overflow: visible;
	}
	.pt-ara__yan { display: none; }

	.pt-ara__kartlar {
		grid-auto-columns: 42%;
		margin: 0 -16px;
		padding: 0 16px;
		scroll-padding: 0 16px;
	}
	.pt-ara__oneriler--kayar .pt-ara__oklar { display: none; }

	.pt-ara .autocomplete-suggestion { padding: 7px 10px; }
	.pt-ara-satir__ad { font-size: 14px; }
	.pt-ara-satir__gorsel { flex-basis: 52px; height: 52px; }

	html.pt-ara-kilit,
	html.pt-ara-kilit body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
	.pt-ara *,
	.pt-ara .autocomplete-suggestion { transition: none; }
	.pt-ara__kartlar { scroll-behavior: auto; }
}
