/* =========================================================================
   TABELAMATIK HEADER — Astra header'ını ana temaya DOKUNMADAN modernize eder.
   v1.1 — TÜM kurallar masaüstüne (≥922px) kilitlidir:
   mobil/tablet header'ı Astra'nın orijinal, bozulmamış halidir.
   Kaldırmak için: home-setup.php içindeki 'tm-header' enqueue satırını silin.
   ========================================================================= */

@media (min-width: 922px) {

	/* ---- Header gölgesi + YAPIŞKAN MENÜ BARI ---------------------------- */

	#masthead.site-header {
		box-shadow: 0 2px 14px rgba(35, 36, 30, .08);
	}

	/* Yapışkan üst bar kuralları: dosya sonunda GLOBAL bölümde */

	/* ---- Üst bar: temiz beyaz ------------------------------------------- */

	#masthead .ast-above-header-bar {
		background: #ffffff !important;
		border-bottom: 1px solid #eceade;
	}

	/* Hesabım butonu: hap görünüm */
	#masthead .ast-header-account-wrap,
	#masthead .ast-header-account-link {
		border-radius: 999px;
	}

	#masthead .ast-header-account .ast-header-account-wrap {
		border: 1.5px solid #e3e1d6;
		padding: 6px 16px;
		transition: all .2s ease;
	}

	#masthead .ast-header-account .ast-header-account-wrap:hover {
		border-color: #1e7d3b;
		background: #f2f8f3;
	}

	/* Sepet rozeti: lime */
	#masthead .ast-site-header-cart .count,
	#masthead .ast-site-header-cart .ast-cart-menu-wrap .count,
	#masthead .ast-addon-cart-wrap .ast-count-text {
		background: #cbd50e !important;
		color: #26270e !important;
		font-weight: 800;
	}

	#masthead .ast-site-header-cart a,
	#masthead .ast-header-search .astra-search-icon {
		color: #23241e;
		transition: color .2s ease;
	}

	#masthead .ast-site-header-cart a:hover,
	#masthead .ast-header-search .astra-search-icon:hover {
		color: #1e7d3b;
	}

	/* ---- Menü barı: kırık beyaz zemin + yeşil yazılar --------------------- */

	#masthead .ast-below-header-bar {
		background: #f7f5ec !important;
		border: none;
		border-top: 1px solid #e9e6d9;
		border-bottom: 1px solid #e9e6d9;
	}

	/* Astra'nın satır yüksekliği/padding ayarlarını sıfırla —
	   barın yüksekliğini yalnızca link padding'i belirler (~46px) */
	#masthead .ast-below-header-bar,
	#masthead .ast-below-header-bar .ast-builder-grid-row,
	#masthead .ast-below-header-bar [class*="site-header-section"],
	#masthead .site-below-header-wrap {
		min-height: 0 !important;
		height: auto !important;
		padding-top: 0 !important;
		padding-bottom: 0 !important;
	}

	/* Menü hizalaması */
	#masthead .ast-below-header-bar .main-header-menu {
		align-items: center;
	}

	/* Menü linkleri */
	#masthead .ast-below-header-bar .main-header-menu > .menu-item > .menu-link {
		color: #1e7d3b !important;
		font-weight: 600;
		font-size: 13.5px;
		letter-spacing: .01em;
		padding: 13px 16px !important;
		line-height: 1.4;
		position: relative;
		transition: color .2s ease;
	}

	/* Menü öğeleri arası ince ayraç çizgisi */
	#masthead .ast-below-header-bar .main-header-menu > .menu-item + .menu-item:not(:last-child) > .menu-link::before {
		content: "";
		position: absolute;
		left: 0;
		top: 50%;
		transform: translateY(-50%);
		width: 1px;
		height: 14px;
		background: rgba(30, 125, 59, .25);
	}

	#masthead .ast-below-header-bar .main-header-menu > .menu-item > .menu-link:hover {
		color: #145a2a !important;
		background: transparent;
	}

	/* Alt çizgi: metne yakın, ince — yeşil */
	#masthead .ast-below-header-bar .main-header-menu > .menu-item > .menu-link::after {
		content: "";
		position: absolute;
		left: 16px;
		right: 16px;
		bottom: 7px;
		height: 2px;
		border-radius: 2px;
		background: #1e7d3b;
		transform: scaleX(0);
		transform-origin: left center;
		transition: transform .25s cubic-bezier(.22, .8, .36, 1);
	}

	#masthead .ast-below-header-bar .main-header-menu > .menu-item > .menu-link:hover::after,
	#masthead .ast-below-header-bar .main-header-menu > .menu-item.current-menu-item > .menu-link::after,
	#masthead .ast-below-header-bar .main-header-menu > .menu-item.current-menu-ancestor > .menu-link::after {
		transform: scaleX(1);
	}

	/* Aktif sayfa linki */
	#masthead .ast-below-header-bar .main-header-menu > .menu-item.current-menu-item > .menu-link {
		color: #145a2a !important;
		font-weight: 700;
	}

	/* B2B linkini öne çıkar (menüdeki son öğe) — kompakt hap */
	#masthead .ast-below-header-bar .main-header-menu > .menu-item:last-child {
		align-self: center;
	}

	#masthead .ast-below-header-bar .main-header-menu > .menu-item:last-child > .menu-link {
		background: transparent;
		border: 1px solid rgba(30, 125, 59, .55);
		border-radius: 999px;
		padding: 6px 15px !important;
		margin-left: 12px;
		line-height: 1.5;
		color: #1e7d3b !important;
		font-weight: 600;
		transition: all .2s ease;
	}

	#masthead .ast-below-header-bar .main-header-menu > .menu-item:last-child > .menu-link:hover {
		background: #1e7d3b;
		color: #ffffff !important;
	}

	#masthead .ast-below-header-bar .main-header-menu > .menu-item:last-child > .menu-link::after {
		display: none;
	}

	/* ---- Açılır alt menüler ---------------------------------------------- */

	#masthead .main-header-menu .sub-menu {
		background: #ffffff;
		border: 1px solid #eceade;
		border-radius: 12px;
		box-shadow: 0 12px 34px rgba(35, 36, 30, .16);
		padding: 8px;
		margin-top: 6px;
		overflow: hidden;
	}

	#masthead .main-header-menu .sub-menu .menu-item > .menu-link {
		color: #26271f !important;
		font-size: 13.5px;
		font-weight: 500;
		border-radius: 8px;
		padding: 10px 14px;
		border: none !important;
		transition: all .18s ease;
	}

	#masthead .main-header-menu .sub-menu .menu-item > .menu-link:hover {
		background: #f0f6f1;
		color: #1e7d3b !important;
		padding-left: 18px;
	}

	/* ---- Arama kutusu (AWS Search) genişliği ------------------------------ */

	#masthead .aws-container {
		width: 520px;          /* genişletmek/daraltmak için bu değeri değiştirin */
		max-width: 42vw;       /* dar ekranlarda taşmayı önler */
	}

	#masthead .aws-container .aws-search-form {
		height: 44px;
	}

	#masthead .aws-container .aws-search-form .aws-search-field {
		height: 44px;
		font-size: 14px;
	}

	/* Ortadaki header bölmesi kutuyu sıkıştırmasın */
	#masthead .ast-builder-layout-element.tm-has-aws {
		flex-grow: 1;
		justify-content: center;
	}

	/* İstek Listem (kalp) stilleri global bölümde — mobilde de çalışır */


	/* Hareket azaltma tercihi */
	@media (prefers-reduced-motion: reduce) {
		#masthead * { transition-duration: .01ms !important; }
	}
}

/* =========================================================================
   İSTEK LİSTEM (KALP) BUTONU — GLOBAL (masaüstü + mobil)
   ========================================================================= */

/* ---- İstek Listem (kalp) butonu — Header Builder HTML öğesi ----------- */

#masthead .tm-header-wish {
	/* Sade kalp — kullanıcı ikonu gibi, etrafında daire/çerçeve YOK.
	   Blok olarak çizilir: baseline kayması yaşanmaz. */
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 38px;  /* dokunma alanı (görünmez) */
	height: 38px;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	text-decoration: none !important;
	color: #23241e;
	margin: auto !important;
	font-size: 0;
	line-height: 0;
	transition: color .2s ease;
}

/* Mobil header hizalaması: sağ bölümdeki sepet + kalp + hamburger
   dikeyde tam aynı eksende. Kalbin sarmalayıcı zinciri
   (.ast-header-html-N > .ast-header-html > .ast-builder-html-element)
   ve sepetin zinciri halka halka flex-ortalanır. */
@media (max-width: 921px) {
	/* Satır bölümleri: her şey dikey ortada */
	#masthead .site-header-section,
	#masthead .ast-grid-right-section {
		align-items: center !important;
	}

	/* EMNİYET KEMERİ: header öğelerine Özelleştir'den girilmiş
	   kenar boşlukları (ör. sepetteki margin-top:15%) hizayı bozamaz */
	#masthead .site-header-section > .ast-builder-layout-element,
	#masthead .ast-grid-right-section > *,
	#masthead .ast-header-woo-cart .ast-site-header-cart .ast-addon-cart-wrap {
		margin: 0 !important;
		align-self: center !important;
	}

	#masthead .menu-toggle {
		line-height: 0 !important;
		align-self: center !important;
	}

	/* Kalp zinciri */
	#masthead [class*="ast-header-html-"],
	#masthead [class*="ast-header-html-"] .ast-header-html,
	#masthead [class*="ast-header-html-"] .ast-builder-html-element {
		display: flex !important;
		align-items: center !important;
		justify-content: center;
		margin: 0 !important;
		padding: 0 !important;
		line-height: 0;
	}

	/* Sepet zinciri */
	#masthead .ast-header-woo-cart,
	#masthead .ast-site-header-cart,
	#masthead .ast-site-header-cart .ast-site-header-cart-li,
	#masthead .ast-site-header-cart a.cart-container,
	#masthead .ast-addon-cart-wrap {
		display: flex !important;
		align-items: center !important;
		margin: 0 !important;
		padding-top: 0 !important;
		padding-bottom: 0 !important;
		height: auto !important;
	}

	/* Rozet ("0" sayacı) akıştan KESİN çıkar: sepet linkine çapa atılır,
	   ikonun satır yüksekliğine hiçbir etkisi kalmaz */
	#masthead .ast-site-header-cart a.cart-container {
		position: relative !important;
		display: flex !important;
		align-items: center !important;
		line-height: 0 !important;
		padding: 2px !important;
	}

	#masthead .ast-addon-cart-wrap {
		position: static !important;
		line-height: 0 !important;
	}

	#masthead .ast-site-header-cart .count,
	#masthead .ast-site-header-cart .ast-count-text,
	#masthead .ast-addon-cart-wrap .ast-count-text {
		position: absolute !important;
		top: -6px !important;
		right: -6px !important;
		left: auto !important;
		bottom: auto !important;
		transform: none !important;
		margin: 0 !important;
		min-width: 17px;
		height: 17px;
		line-height: 17px !important;
		font-size: 10.5px !important;
		border-radius: 999px;
		text-align: center;
		padding: 0 4px !important;
	}

	/* İkon boyutları eşitlenir: kullanıcı / sepet / kalp aynı görsel ağırlıkta */
	#masthead .ast-site-header-cart .ast-icon.icon-cart svg,
	#masthead .ast-site-header-cart .ast-icon.icon-cart {
		width: 26px !important;
		height: 26px !important;
		font-size: 26px !important;
		line-height: 1 !important;
	}

	#masthead .ast-header-account .ahfb-svg-iconset svg,
	#masthead .ast-header-account-link svg {
		width: 26px !important;
		height: 26px !important;
	}

	#masthead .tm-header-wish {
		width: 42px;
		height: 42px;
	}

	#masthead .tm-header-wish::before {
		width: 25px;
		height: 25px;
	}

	/* Sağdaki öğeler arası eşit nefes payı */
	#masthead .ast-grid-right-section {
		gap: 6px;
	}
}

#masthead .tm-header-wish:hover {
	color: #1e7d3b;
	background: transparent !important; /* daire/zemin yok — sadece renk değişir */
}

#masthead .tm-header-wish svg { display: block; }

/* Kalbin sarmalayıcıları da çerçevesiz/zeminsiz (Özelleştir'den öğeye
   çerçeve tanımlanmış olsa bile daire görünmez) */
#masthead [class*="ast-header-html-"],
#masthead [class*="ast-header-html-"] .ast-header-html,
#masthead [class*="ast-header-html-"] .ast-builder-html-element {
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

/* Kalp ikonu CSS'ten çizilir (Astra, HTML öğesindeki <svg>'yi siliyor) */
#masthead .tm-header-wish::before {
	content: "";
	width: 21px;
	height: 21px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.6l-1-1a5.5 5.5 0 0 0-7.8 7.8l1 1L12 21.2l7.8-7.8 1-1a5.5 5.5 0 0 0 0-7.8z'/></svg>") center / contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.6l-1-1a5.5 5.5 0 0 0-7.8 7.8l1 1L12 21.2l7.8-7.8 1-1a5.5 5.5 0 0 0 0-7.8z'/></svg>") center / contain no-repeat;
}

/* =========================================================================
   AWS ARAMA — canlı sonuç paneli (masaüstü + mobil)
   Gerçek AWS yapısına göre: .aws_results > .aws_result_item (div'ler, ul/li yok)
   IKEA tarzı: geniş panel + 3 sütunlu ürün kartları.
   ========================================================================= */

/* Panel: arama kutusundan geniş, ortalanmış, yumuşak kart */
.aws-search-result {
	margin-top: 8px !important;
	width: 700px !important;
	max-width: calc(100vw - 24px) !important;
	left: 50% !important;
	right: auto !important;
	transform: translateX(-50%);
	border: 1px solid #e3e1d6 !important;
	border-radius: 14px !important;
	box-shadow: 0 16px 44px rgba(35, 36, 30, .16) !important;
	background: #fff !important;
	padding: 0 !important;
	overflow: hidden;
}

.aws-search-result .aws_result_scroll {
	max-height: 70vh;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #d8d6ca transparent;
}

.aws-search-result .aws_result_scroll::-webkit-scrollbar { width: 6px; }
.aws-search-result .aws_result_scroll::-webkit-scrollbar-thumb { background: #d8d6ca; border-radius: 6px; }

/* Sonuç listesi: 3 sütunlu kart ızgarası */
.aws-search-result .aws_results {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	padding: 10px;
}

/* Ürün kartı */
.aws-search-result .aws_result_item {
	position: relative !important;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	padding: 10px !important;
	border: 1px solid #f0eee2 !important;
	border-radius: 12px;
	background: #fff !important;
	transition: all .15s ease;
	box-sizing: border-box;
}

.aws-search-result .aws_result_item:hover,
.aws-search-result .aws_result_item.hovered {
	background: #faf9f4 !important;
	border-color: #d8d6ca !important;
	box-shadow: 0 6px 18px rgba(35, 36, 30, .1);
}

/* Tıklama linki: kartın tamamını kaplayan görünmez katman */
.aws-search-result .aws_result_item > a.aws_result_link_top {
	position: absolute !important;
	inset: 0 !important;
	z-index: 2;
	font-size: 0 !important;
	color: transparent !important;
	overflow: hidden;
}

/* Büyük kare görsel: kartın üstü, krem zeminde oranlı.
   KRİTİK: eklenti float:left + height:100% verir — temizlenmezse
   metin bloğu görselin yanında 0px genişliğe sıkışıp kaybolur. */
.aws-search-result .aws_result_image {
	display: flex !important;
	align-items: center;
	justify-content: center;
	float: none !important;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1;
	padding: 0 !important;
	border-radius: 10px;
	background: #f5f4ee;
	overflow: hidden;
	flex: none;
}

.aws-search-result .aws_result_image img {
	width: 100% !important;
	height: 100% !important;
	object-fit: contain !important;
	mix-blend-mode: multiply;
}

.aws-search-result .aws_result_content {
	display: flex !important;
	flex-direction: column;
	gap: 4px;
	flex: 1;
	min-width: 0;
	width: 100%;
}

.aws-search-result .aws_result_head {
	display: block !important;
	margin: 0 !important;
}

.aws-search-result .aws_result_title {
	display: -webkit-box !important;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #23241e !important;
	line-height: 1.4 !important;
	min-height: calc(13px * 1.4 * 2);
	padding: 0 !important; /* eklentinin sağ 20px dolgusunu kaldır */
}

/* Sade kart: açıklama, SKU ve kategori satırları gizli */
.aws-search-result .aws_result_excerpt,
.aws-search-result .aws_result_sku,
.aws-search-result .aws_result_term {
	display: none !important;
}

.aws-search-result .aws_result_price {
	display: block;
	margin-top: auto;
	font-size: 14px !important;
	font-weight: 800 !important;
	color: #23241e !important;
	font-variant-numeric: tabular-nums;
}

.aws-search-result .aws_result_price del { color: #8b8b80; font-weight: 500; margin-right: 6px; }
.aws-search-result .aws_result_price ins { color: #d64848; text-decoration: none; }

/* Eşleşen kelime vurgusu */
.aws-search-result .aws_result_title strong,
.aws-search-result .aws_result_excerpt strong {
	font-weight: 800;
	color: #1e7d3b;
	background: transparent;
}

/* Kategori/etiket önerileri: kart değil, tam genişlik kompakt satır */
.aws-search-result .aws_result_item.aws_result_tag {
	grid-column: 1 / -1;
	flex-direction: row;
	align-items: center;
	padding: 8px 12px !important;
}

/* "Daha fazla göster": tam genişlik yeşil şerit */
.aws-search-result .aws_result_item.aws_search_more {
	grid-column: 1 / -1;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	border: none !important;
	padding: 10px !important;
	font-weight: 700 !important;
	font-size: 13.5px !important;
	color: #1e7d3b !important;
	text-align: center;
}

.aws-search-result .aws_result_item.aws_search_more:hover {
	background: #f0f6f1 !important;
	box-shadow: none;
}

/* "Sonuç yok" mesajı */
.aws-search-result .aws_no_result {
	grid-column: 1 / -1;
	display: block;
	padding: 16px;
	text-align: center;
	color: #6f6f66;
	font-size: 13.5px;
}

/* Mobil: panel kutu genişliğinde, 2 sütun */
@media (max-width: 767px) {
	.aws-search-result {
		width: 100% !important;
		left: 0 !important;
		transform: none;
	}

	.aws-search-result .aws_results {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* =========================================================================
   YAPIŞKAN ÜST BAR (logo + arama + hesap/sepet/kalp) — GLOBAL
   JS (sticky-nav.js) scroll'da .is-stuck verir. Kurallar medya bloğu
   dışında ve !important'lı: Astra'nın header kurallarına yenilmez.
   'fixed' bir atanın transform/filter'ından etkilenir — o yüzden header
   sarmalayıcılarında transform/filter da sıfırlanır.
   ========================================================================= */

#masthead,
#masthead .ast-main-header-wrap,
#masthead .ast-above-header-wrap,
#masthead .site-above-header-wrap { transform: none !important; filter: none !important; }

#masthead .ast-above-header-bar.is-stuck {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	width: 100% !important;
	z-index: 99990 !important;
	background: rgba(255, 255, 255, .96) !important;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 6px 18px rgba(35, 36, 30, .10) !important;
	animation: tmStickIn .22s ease-out;
	margin: 0 !important;
}

body.admin-bar #masthead .ast-above-header-bar.is-stuck { top: 32px !important; }

/* Yapışıkken satır sıkışsın */
#masthead .ast-above-header-bar.is-stuck .ast-builder-grid-row {
	padding-top: 6px !important;
	padding-bottom: 6px !important;
	min-height: 0 !important;
}

@keyframes tmStickIn {
	from { transform: translateY(-100%); }
	to   { transform: translateY(0); }
}
