/* Trip Bagalil smart search: hero field, header dialog and the suggestion panel. Mobile first, RTL native. Tokens come from main.css. */

/* ---------- Field ---------- */
.tbg-sx-field { position: relative; flex: 1 1 auto; min-width: 0; }
.tbg-sx-box { position: relative; }
.tbg-sx-field__icon { position: absolute; top: 50%; inset-inline-start: 18px; width: 22px; height: 22px; transform: translateY(-50%); color: var(--c-green-700); pointer-events: none; }
.tbg-sx-field__icon svg, .tbg-sx-field__icon .tbg-icon { width: 100%; height: 100%; }
.tbg-sx-field__icon path { stroke: currentColor; }
.tbg-sx-input { width: 100%; min-height: 56px; padding: 10px 52px 10px 46px; border: 1px solid var(--c-border-mid); border-radius: var(--radius-pill); background: #fff; color: var(--c-green-800); font-size: 17px; font-weight: 500; text-align: right; appearance: none; -webkit-appearance: none; transition: border-color var(--dur), box-shadow var(--dur); }
.tbg-sx-input::placeholder { color: var(--c-green-muted); opacity: 1; font-weight: 400; }
.tbg-sx-input:hover { border-color: var(--c-green-700); }
.tbg-sx-input:focus { outline: none; border-color: var(--c-green-700); box-shadow: 0 0 0 4px rgba(7, 81, 61, 0.14); }
.tbg-sx-input:focus-visible { outline: 3px solid var(--c-orange); outline-offset: 2px; }
.tbg-sx-input::-webkit-search-decoration, .tbg-sx-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.tbg-sx-clear { position: absolute; top: 50%; inset-inline-end: 8px; width: 40px; height: 40px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: var(--c-green-muted); font-size: 24px; line-height: 1; }
.tbg-sx-clear:hover { background: var(--c-mint); color: var(--c-green-800); }
.tbg-sx-clear[hidden] { display: none; }

/* ---------- Suggestion panel ---------- */
.tbg-sx-panel { position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 60; max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; padding: 8px; background: #fff; border: 1px solid var(--c-border-soft); border-radius: 20px; box-shadow: var(--shadow-panel); }
.tbg-sx-panel[hidden] { display: none; }
.tbg-sx-list { margin: 0; padding: 0; list-style: none; }
.tbg-sx-group { margin: 0; padding: 0; }
.tbg-sx-group + .tbg-sx-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--c-border-soft); }
.tbg-sx-group__title { padding: 6px 12px 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--c-green-muted); }
.tbg-sx-group__list { margin: 0; padding: 0; list-style: none; }
.tbg-sx-note { padding: 10px 12px; font-size: 14px; color: var(--c-green-muted); }
.tbg-sx-opt { margin: 0; border-radius: 14px; }
.tbg-sx-opt__link { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; border-radius: 14px; color: var(--c-green-800); }
.tbg-sx-opt.is-active .tbg-sx-opt__link, .tbg-sx-opt__link:hover { background: var(--c-mint); }
.tbg-sx-opt__media { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; overflow: hidden; border-radius: 12px; background: var(--c-mint); color: var(--c-green-700); }
.tbg-sx-opt__media img { width: 100%; height: 100%; object-fit: cover; }
.tbg-sx-opt__media--c::before, .tbg-sx-opt__media--p::before, .tbg-sx-opt__media--b::before, .tbg-sx-opt__media--a::before { content: ''; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--sx-glyph) center / contain no-repeat; mask: var(--sx-glyph) center / contain no-repeat; }
.tbg-sx-opt__media--c { --sx-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L3 13V3h10l7.6 7.6a2 2 0 0 1 0 2.8Z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.2'/%3E%3C/svg%3E"); }
.tbg-sx-opt__media--p { --sx-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s7-6.2 7-11.5A7 7 0 0 0 5 9.5C5 14.8 12 21 12 21Z'/%3E%3Ccircle cx='12' cy='9.5' r='2.4'/%3E%3C/svg%3E"); }
.tbg-sx-opt__media--b { --sx-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 9 1.5-5h15L21 9'/%3E%3Cpath d='M4 9v11h16V9'/%3E%3Cpath d='M10 20v-6h4v6'/%3E%3C/svg%3E"); }
.tbg-sx-opt__media--a { --sx-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h11l3 3v15H5Z'/%3E%3Cpath d='M8 9h8M8 13h8M8 17h5'/%3E%3C/svg%3E"); }
.tbg-sx-opt__body { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tbg-sx-opt__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 700; }
.tbg-sx-opt__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--c-green-muted); }
.tbg-sx-opt--all { margin-top: 6px; border-top: 1px solid var(--c-border-soft); border-radius: 0 0 14px 14px; }
.tbg-sx-opt__link--all { justify-content: center; min-height: 48px; font-size: 15px; font-weight: 700; color: var(--c-green-700); text-align: center; }

/* ---------- Hero variant ---------- */
.tbg-search--smart { z-index: 40; gap: 12px; margin-top: -64px; padding: 14px; } /* above card hearts and badges (the panel lives inside this stacking context), below the sticky header (50) */
.tbg-smart__row { display: flex; align-items: center; gap: 10px; }
.tbg-smart__submit { flex: none; width: 56px; min-width: 56px; min-height: 56px; padding: 0; }
.tbg-smart__submit span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.tbg-smart__submit .tbg-icon { width: 24px; height: 24px; }
.tbg-smart__filters-toggle { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 8px 6px; border: 0; background: none; color: var(--c-green-700); font-size: 14px; font-weight: 700; }
.tbg-smart__filters-toggle .tbg-icon { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.tbg-smart__filters-toggle[aria-expanded="true"] .tbg-icon { transform: rotate(180deg); }
.tbg-smart__filter-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.tbg-search--smart.has-smart:not(.filters-open) .tbg-smart__filter-grid { display: none; }
.tbg-search--smart:not(.has-smart) .tbg-smart__filters-toggle { display: none; }
.tbg-smart__legend { display: none; }
@media (min-width: 768px) {
	.tbg-search--smart { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 14px; margin-top: -96px; padding: 20px; }
	.tbg-smart__filters-toggle { display: none !important; }
	.tbg-search--smart.has-smart:not(.filters-open) .tbg-smart__filter-grid, .tbg-smart__filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
	.tbg-smart__submit { width: auto; min-width: 200px; padding: 12px 26px; }
	.tbg-smart__submit span { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
}
@media (min-width: 1024px) {
	.tbg-search--smart { margin-top: -130px; padding: 24px; }
	.tbg-sx-input { min-height: 60px; font-size: 18px; padding-inline-start: 52px; }
	.tbg-smart__submit { min-width: 260px; min-height: 60px; }
}

/* ---------- Header: entry point and dialog ---------- */
.tbg-search-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--c-green-700); transition: background-color var(--dur); }
.tbg-search-toggle:hover { background: var(--c-mint); }
.tbg-search-toggle .tbg-icon { width: 24px; height: 24px; }
.tbg-search-toggle .tbg-icon path { stroke: currentColor; }
@media (min-width: 1200px) { .tbg-search-toggle .tbg-icon { width: 28px; height: 28px; } }

.tbg-sxd { position: fixed; inset: 0; z-index: 9700; } /* above the accessibility launcher (9600): a modal covers floating widgets */
.tbg-sxd[hidden] { display: none; }
.tbg-sxd__backdrop { position: absolute; inset: 0; background: rgba(0, 62, 48, 0.55); opacity: 0; transition: opacity 200ms var(--ease); }
.tbg-sxd__panel { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 20px; overflow-y: auto; background: #fff; transform: translateY(-12px); opacity: 0; transition: transform 200ms var(--ease), opacity 200ms var(--ease); }
.tbg-sxd.is-open .tbg-sxd__backdrop { opacity: 1; }
.tbg-sxd.is-open .tbg-sxd__panel { transform: none; opacity: 1; }
.tbg-sxd__form { display: flex; align-items: flex-start; gap: 8px; }
.tbg-sxd__close { flex: none; width: 48px; height: 48px; margin-top: 4px; border: 0; border-radius: 50%; background: var(--c-mint); font-size: 26px; line-height: 1; }
.tbg-sxd__close:hover { background: var(--c-mint-chip); }
.tbg-sxd .tbg-sx-panel { position: static; max-height: none; margin-top: 10px; padding: 0; border: 0; box-shadow: none; overflow: visible; }
body.tbg-sxd-open { overflow: hidden; }
@media (min-width: 768px) {
	.tbg-sxd__panel { inset: 72px auto auto 50%; width: min(720px, 94vw); max-height: calc(100vh - 110px); padding: 18px; border-radius: 28px; box-shadow: var(--shadow-panel); transform: translate(-50%, -12px); }
	.tbg-sxd.is-open .tbg-sxd__panel { transform: translate(-50%, 0); }
}

/* ---------- Results page: current text query ---------- */
.tbg-results__query { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 8px 6px 14px; border-radius: var(--radius-pill); background: var(--c-mint); color: var(--c-green-800); font-size: 14px; font-weight: 700; }
.tbg-results__query a { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; font-size: 18px; line-height: 1; }
.tbg-results__query a:hover { background: var(--c-mint-chip); }

@media (prefers-reduced-motion: reduce) {
	.tbg-sxd__backdrop, .tbg-sxd__panel { transition: none; }
}
