/* ==========================================================================
   TehnoMix — căutare live header (namespace: .tmx-search)
   ========================================================================== */

/* Elementul are clasa .ast-header-html-1 (nu .ast-header-html), iar părinții sunt
   containere flex: fără lățime explicită, caseta se strângea la ~270px în loc să
   umple coloana centrală (până la max-width din .tmx-search). */
#masthead .site-header-primary-section-center {
	width: 100%;
}

#masthead .ast-header-html-1 {
	flex: 1 1 auto;
	min-width: 0;
}

.ast-header-html-1 .tmx-search {
	width: 100%;
}

/* Coloana centrală a rândului principal din header e implicit "auto"
   (dimensionată după conținut) — o facem flexibilă (1fr), ca și caseta
   de căutare, cu lățime 100%, să aibă efectiv spațiu real. Logo-ul și
   iconițele din stânga/dreapta rămân la dimensiunea lor naturală. */
#masthead .ast-builder-grid-row.ast-grid-center-col-layout {
	grid-template-columns: auto 1fr auto;
}

.tmx-search {
	position: relative;
	max-width: 560px;
	margin: 0 auto;
}

.tmx-search__form {
	display: flex;
	align-items: center;
	background: var(--tmx-grey-100);
	border: 1px solid var(--tmx-grey-300);
	border-radius: 6px;
	padding: 0 6px 0 14px;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.tmx-search__form:focus-within {
	border-color: var(--tmx-navy);
	box-shadow: 0 0 0 3px rgba(15, 47, 87, .12);
	background: #fff;
}

.tmx-search__icon {
	display: flex;
	color: var(--tmx-grey-600);
	flex-shrink: 0;
}

.tmx-search__icon .tmx-icon {
	width: 18px;
	height: 18px;
}

.tmx-search__input {
	flex: 1 1 auto;
	min-width: 0;
	border: none;
	background: transparent;
	padding: 11px 10px;
	font-size: 14px;
	color: var(--tmx-ink);
	outline: none;
}

.tmx-search__input::placeholder {
	color: var(--tmx-grey-600);
}

.tmx-search__input::-webkit-search-cancel-button {
	cursor: pointer;
}

.tmx-search__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	background: var(--tmx-navy);
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color .15s ease;
}

.tmx-search__submit:hover {
	background: var(--tmx-navy-700);
}

.tmx-search__submit .tmx-icon {
	width: 16px;
	height: 16px;
}

.tmx-search.is-loading .tmx-search__icon {
	animation: tmx-search-pulse 1s ease-in-out infinite;
}

@keyframes tmx-search-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .35; }
}

/* ---------- Dropdown rezultate ---------- */
.tmx-search__results {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid var(--tmx-grey-300);
	border-radius: 8px;
	box-shadow: 0 12px 28px rgba(15, 27, 61, .16);
	max-height: 70vh;
	overflow-y: auto;
	z-index: 500;
}

.tmx-search__list {
	list-style: none;
	margin: 0;
	padding: 6px;
}

.tmx-search__item {
	border-radius: 6px;
}

.tmx-search__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 10px;
	text-decoration: none;
	color: var(--tmx-ink);
	border-radius: 6px;
}

.tmx-search__item.is-active .tmx-search__link,
.tmx-search__link:hover {
	background: var(--tmx-grey-100);
}

.tmx-search__thumb {
	width: 44px;
	height: 44px;
	object-fit: contain;
	background: var(--tmx-grey-100);
	border-radius: 4px;
	flex-shrink: 0;
}

.tmx-search__info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tmx-search__name {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--tmx-navy);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tmx-search__meta {
	font-size: 12px;
	color: var(--tmx-grey-600);
}

.tmx-search__price {
	flex-shrink: 0;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--tmx-navy);
	white-space: nowrap;
}

.tmx-search__view-all {
	display: block;
	text-align: center;
	padding: 12px;
	border-top: 1px solid var(--tmx-grey-300);
	color: var(--tmx-blue);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.tmx-search__view-all:hover {
	background: var(--tmx-grey-100);
}

.tmx-search__empty {
	margin: 0;
	padding: 20px 16px;
	text-align: center;
	color: var(--tmx-grey-600);
	font-size: 13.5px;
}

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
	.tmx-search__results {
		left: -16px;
		right: -16px;
		border-radius: 0;
		max-height: 60vh;
	}

	.tmx-search__thumb {
		width: 38px;
		height: 38px;
	}
}
