/* Header arama (top-bar). Masaüstü/tablet: alan sola açılır. Mobil (<810px): tam ekran katman. Token-only. */
.tb-search {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	margin: 0;
}
.tb-search .screen-reader-text {
	position: absolute;
	inline-size: var(--wp--custom--border--width--hairline);
	block-size: var(--wp--custom--border--width--hairline);
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.tb-search__input {
	box-sizing: border-box;
	inline-size: 0;
	max-inline-size: 46vw;
	block-size: var(--wp--custom--size--lang-circle);
	padding: 0;
	border: var(--wp--custom--border--width--hairline) solid transparent;
	border-radius: var(--wp--custom--radius--sm);
	background-color: transparent;
	color: var(--wp--preset--color--navy);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--label);
	opacity: 0;
	visibility: hidden;
	transition: inline-size var(--wp--custom--transition--duration--base) var(--wp--custom--transition--easing--tween),
		padding var(--wp--custom--transition--duration--base) var(--wp--custom--transition--easing--tween),
		opacity var(--wp--custom--transition--duration--fast) var(--wp--custom--transition--easing--tween),
		border-color var(--wp--custom--transition--duration--fast) var(--wp--custom--transition--easing--tween),
		background-color var(--wp--custom--transition--duration--fast) var(--wp--custom--transition--easing--tween),
		visibility 0s linear var(--wp--custom--transition--duration--base);
}
.tb-search__input::placeholder {
	color: var(--wp--preset--color--navy);
	opacity: var(--wp--custom--opacity--muted);
}
.tb-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}
/* Açık arama kutusunda kalın odak halkası (gölge gibi görünüyordu) yok; odak ince kenarlığın turkuaz rengiyle belli olur. */
.tb-search .tb-search__input:is(:focus, :focus-visible) {
	outline: none;
	box-shadow: none;
}
.tb-search.is-open .tb-search__input:focus {
	border-color: var(--wp--preset--color--teal);
}
.tb-search.is-open .tb-search__input {
	inline-size: min(var(--wp--custom--size--search-field), 22vw);
	padding-inline: var(--wp--preset--spacing--30);
	border-color: var(--wp--preset--color--border);
	background-color: var(--wp--preset--color--white);
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

.tb-search__toggle,
.tb-search__close {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	inline-size: var(--wp--custom--size--lang-circle);
	block-size: var(--wp--custom--size--lang-circle);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--wp--custom--radius--full);
	background-color: transparent;
	color: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background-color var(--wp--custom--transition--duration--fast) var(--wp--custom--transition--easing--tween),
		color var(--wp--custom--transition--duration--fast) var(--wp--custom--transition--easing--tween),
		transform var(--wp--custom--transition--duration--fast) var(--wp--custom--transition--easing--tween);
}
.tb-search__toggle {
	margin-inline-start: var(--wp--preset--spacing--10);
}
.tb-search__toggle svg,
.tb-search__close svg {
	display: block;
	inline-size: var(--wp--custom--size--icon);
	block-size: var(--wp--custom--size--icon);
}
.tb-search__toggle:hover,
.tb-search.is-open .tb-search__toggle {
	background-color: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}
.tb-search__toggle:focus-visible,
.tb-search__close:focus-visible,
.tb-search__input:focus-visible {
	outline: var(--wp--custom--border--width--focus) solid var(--wp--preset--color--teal);
	outline-offset: 0;
}
.tb-search__close {
	display: none;
}

/* Şeffaf (hero üstü) header: açık renkli varyant. */
.site-header--overlay .tb-search__toggle:hover,
.site-header--overlay .tb-search.is-open .tb-search__toggle {
	background-color: var(--wp--custom--color-alpha--white-92);
	color: var(--wp--preset--color--navy);
}
.site-header--overlay .tb-search.is-open .tb-search__input {
	border-color: var(--wp--custom--color-alpha--white-38);
	background-color: var(--wp--custom--color-alpha--white-14);
	color: var(--wp--preset--color--white);
}
.site-header--overlay .tb-search__input::placeholder {
	color: var(--wp--custom--color-alpha--white-72);
	opacity: 1;
}

html.tb-search-open {
	overflow: hidden;
}

@media (max-width: 809px) {
	.tb-search.is-open {
		position: fixed;
		inset: 0;
		z-index: var(--wp--custom--z-index--search-overlay);
		align-items: flex-start;
		justify-content: center;
		gap: var(--wp--preset--spacing--30);
		padding: var(--wp--custom--size--search-overlay-top) var(--wp--preset--spacing--40) 0;
		background-color: var(--wp--custom--color-alpha--black-72);
		overscroll-behavior: contain;
	}
	.tb-search.is-open .tb-search__input {
		flex: 1 1 auto;
		inline-size: auto;
		min-inline-size: 0;
		max-inline-size: none;
		block-size: var(--wp--custom--size--search-control);
		padding-inline: var(--wp--preset--spacing--40);
		border-color: var(--wp--preset--color--white);
		background-color: var(--wp--preset--color--white);
		color: var(--wp--preset--color--navy);
		font-size: var(--wp--preset--font-size--body-small);
	}
	.tb-search.is-open .tb-search__input::placeholder {
		color: var(--wp--preset--color--navy);
		opacity: var(--wp--custom--opacity--muted);
	}
	.tb-search.is-open .tb-search__toggle,
	.tb-search.is-open .tb-search__close {
		display: inline-flex;
		inline-size: var(--wp--custom--size--search-control);
		block-size: var(--wp--custom--size--search-control);
		margin: 0;
		background-color: var(--wp--custom--color-alpha--white-16);
		color: var(--wp--preset--color--white);
	}
	.tb-search.is-open .tb-search__toggle:hover {
		background-color: var(--wp--custom--color-alpha--white-35);
		color: var(--wp--preset--color--white);
	}
	.tb-search.is-open .tb-search__toggle svg,
	.tb-search.is-open .tb-search__close svg {
		inline-size: var(--wp--custom--size--icon-lg);
		block-size: var(--wp--custom--size--icon-lg);
	}
}

/* Dar ekranlarda üst çubuk taşmasın: boşluklar daralır, en dar ekranda telefon yalnızca ikon olur. */
@media (max-width: 809px) {
	.top-bar__inner {
		gap: var(--wp--preset--spacing--30);
	}
	.top-bar__contact {
		gap: var(--wp--preset--spacing--30);
		min-inline-size: 0;
	}
	.top-bar__actions {
		gap: var(--wp--preset--spacing--10);
	}
}
@media (max-width: 479px) {
	.top-bar {
		padding-inline: var(--wp--preset--spacing--40);
	}
	/* Telefon yalnızca ikon: numara metni ekran okuyucuya açık kalır, görsel olarak gizlenir. */
	.top-bar__contact .icon-phone span {
		position: absolute;
		inline-size: var(--wp--custom--border--width--hairline);
		block-size: var(--wp--custom--border--width--hairline);
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
	.top-bar__contact .icon-phone::before {
		inline-size: var(--wp--custom--size--icon-lg);
		block-size: var(--wp--custom--size--icon-lg);
	}
}
