/* ============================================================
 * Rooster X ↔ FiboFilters — brand accent inheritance.
 *
 * FiboFilters ships with its own magenta accent (#FF00B0 / #C12380
 * approximately) for checked controls and the price-slider active
 * track. Override site-wide so every "active" surface honours the
 * theme's accent color (--wp--preset--color--accent), giving a
 * cohesive look between FiboSearch + FiboFilters + the rest of the
 * theme. Applies to the navigator clone AND the on-page sidebar.
 * ============================================================ */
.fibofilters-item__interactive[aria-checked="true"] .fibofilters-item__control,
.fibofilters-item--checkbox .fibofilters-item__interactive[aria-checked="true"] .fibofilters-item__control,
.fibofilters-item--radio    .fibofilters-item__interactive[aria-checked="true"] .fibofilters-item__control {
	background-color: var(--wp--preset--color--accent, #F46767) !important;
	border-color:     var(--wp--preset--color--accent, #F46767) !important;
}
/* Native input fallback for browsers / FiboFilters builds that use
 * actual <input type="checkbox/radio"> elements. */
.fibofilters-block input[type="checkbox"],
.fibofilters-block input[type="radio"] {
	accent-color: var(--wp--preset--color--accent, #F46767);
}
/* Range slider — active segment + handles. The plugin's default
 * magenta on the active strip dominates the eye; align with the
 * theme accent for the same reason as the checkboxes. */
.fibofilters-range__segment--active {
	background-color: var(--wp--preset--color--accent, #F46767) !important;
}
.fibofilters-range__handle {
	border-color: var(--wp--preset--color--accent, #F46767) !important;
}
/* Histogram bars — muted version of the accent so the visual
 * hierarchy reads "active range = saturated accent, surrounding
 * histogram = paler accent". */
.fibofilters-slider-histogram__item--active {
	background-color: var(--wp--preset--color--accent, #F46767) !important;
}
/* Section heading underline / chevron icon stroke when present. */
.fibofilters-block__chevron-btn-icon path {
	stroke: var(--wp--preset--color--fg, #1f2937);
}
/* "Apply" / submit buttons inside filter blocks — accent fill. */
.fibofilters-button--primary,
.fibofilters-show-results-button {
	background-color: var(--wp--preset--color--accent, #F46767) !important;
	border-color:     var(--wp--preset--color--accent, #F46767) !important;
	color: var(--wp--preset--color--bg, #ffffff) !important;
}

/* ============================================================
 * Rooster X ↔ FiboFilters — text-scale alignment inside the
 * navigator's archive-filter wrap.
 *
 * When the navigator clones FiboFilters into its left pane on
 * archive pages, the plugin's default font sizes (block headings
 * ~16-20px, item labels ~14-16px) feel huge next to the rest of
 * the navigator's 14px rows / 10px section headers. Scope these
 * rules to `.aieo-nav-archive-filters` so they only kick in inside
 * the navigator — the page-level FiboFilters sidebar stays at its
 * native scale.
 * ============================================================ */
.aieo-nav-archive-filters .fibofilters-block__headline,
.aieo-nav-archive-filters .fibofilters-block__headline-box,
.aieo-nav-archive-filters .fibofilters-block__headline-box-inner {
	font-size: 11px !important;
	font-weight: 600 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.05em !important;
	line-height: 1.4 !important;
	margin: 0 !important;
	padding: 12px 0 6px !important;
}
.aieo-nav-archive-filters .fibofilters-block__headline-desc {
	font-size: 11px !important;
	line-height: 1.3 !important;
}
.aieo-nav-archive-filters .fibofilters-item,
.aieo-nav-archive-filters .fibofilters-item__interactive,
.aieo-nav-archive-filters .fibofilters-item__label,
.aieo-nav-archive-filters .fibofilters-item__label span {
	font-size: 13px !important;
	line-height: 1.35 !important;
}
.aieo-nav-archive-filters .fibofilters-item__counter {
	font-size: 11px !important;
	line-height: 1 !important;
	color: var(--wp--preset--color--muted, #6b7280);
}
.aieo-nav-archive-filters .fibofilters-range__label {
	font-size: 10px !important;
}
.aieo-nav-archive-filters .fibofilters-block__chevron-btn {
	transform: scale(0.8);    /* shrink the chevron to match the heading */
}
/* Reduce the histogram + slider track height so the price block
 * doesn't dominate vertically. */
.aieo-nav-archive-filters .fibofilters-slider-histogram {
	height: 28px !important;
}
.aieo-nav-archive-filters .fibofilters-range__track {
	margin-top: 4px !important;
}
/* Tighter row gap between filter items. */
.aieo-nav-archive-filters .fibofilters-block__items-list .fibofilters-item {
	padding-top: 4px !important;
	padding-bottom: 4px !important;
}

/* ============================================================
 * Rooster X ↔ FiboSearch — variable-driven styling
 *
 * Companion to `inc/fibosearch-integration.php`. The PHP file
 * publishes the default values; this stylesheet wires those values
 * to the actual selectors. Every visual aspect — borders, radius,
 * padding, alignment, colour, modal dock position — is exposed as
 * a `--rx-search-*` custom property so child themes (or per-site
 * overrides) can retune any of them without touching markup or
 * plugin code.
 *
 * Two surfaces are styled here, independently:
 *
 *   1. Mobile FiboSearch — lives inside `.aieo-search-modal__slot`
 *      (the AIEO Side Cart bottom-bar's search modal).
 *   2. Desktop FiboSearch — lives inside `.dgwt-wcas-search-wrapp`
 *      anywhere else on the page (typically the site header).
 *
 * The selector scope on each rule prevents desktop rules from
 * leaking into the modal, and vice versa, so each instance can be
 * styled completely independently.
 * ============================================================ */

/* ── Desktop FiboSearch instance ────────────────────────────── */
.dgwt-wcas-search-input {
	font-family:    var(--rx-search-desktop-font, inherit);
	font-size:      var(--rx-search-desktop-font-size, 1rem);
	border:         var(--rx-search-desktop-border, 0) !important;
	border-bottom:  var(--rx-search-desktop-border-bottom, 1px solid currentColor) !important;
	background:     var(--rx-search-desktop-bg, transparent) !important;
	border-radius:  var(--rx-search-desktop-radius, 0) !important;
	padding-left:   var(--rx-search-desktop-padding-x, 0) !important;
	padding-right:  var(--rx-search-desktop-padding-x, 0) !important;
	color:          var(--rx-search-desktop-color, inherit);
	letter-spacing: var(--rx-search-desktop-tracking, 0);
}
.dgwt-wcas-search-wrapp input[type="search"].dgwt-wcas-search-input,
body input[type="search"].dgwt-wcas-search-input,
input[id^="dgwt-wcas-search-input"] {
	text-align:  var(--rx-search-desktop-text-align, left) !important;
	font-style:  var(--rx-search-desktop-font-style, normal) !important;
	line-height: var(--rx-search-desktop-line-height, 36px) !important;
	height:      var(--rx-search-desktop-height, 36px) !important;
}
.dgwt-wcas-search-wrapp input[type="search"].dgwt-wcas-search-input::placeholder,
body input[type="search"].dgwt-wcas-search-input::placeholder,
input[id^="dgwt-wcas-search-input"]::placeholder {
	color:       var(--rx-search-desktop-placeholder-color, currentColor);
	opacity:     var(--rx-search-desktop-placeholder-opacity, 0.6);
	font-style:  var(--rx-search-desktop-placeholder-style, normal) !important;
	text-align:  var(--rx-search-desktop-placeholder-align, left) !important;
}

/* ── Mobile FiboSearch (inside AIEO Side Cart's search modal) ── */
@media (max-width: 720px) {
	.aieo-search-modal {
		align-items: stretch !important;
		justify-content: flex-end !important;
	}
	.aieo-search-modal__panel {
		margin: auto auto var(--rx-search-mobile-margin-bottom, 58px) auto !important;
		background: var(--rx-search-mobile-bg, #ffffff) !important;
		border: var(--rx-search-mobile-border, 0) !important;
		border-top-left-radius:     var(--rx-search-mobile-radius-top, 0) !important;
		border-top-right-radius:    var(--rx-search-mobile-radius-top, 0) !important;
		border-bottom-left-radius:  var(--rx-search-mobile-radius-bottom, 0) !important;
		border-bottom-right-radius: var(--rx-search-mobile-radius-bottom, 0) !important;
		padding:    var(--rx-search-mobile-padding, 8px 14px) !important;
		box-shadow: var(--rx-search-mobile-shadow, 0 -8px 24px rgba(0,0,0,0.10)) !important;
		display: flex !important;
		align-items: center !important;
		gap: 8px !important;
	}
	/* Close button moves into the same flex row as the input instead
	 * of floating absolute above it. With both elements in the same
	 * row the panel's top and bottom padding feel symmetric — the
	 * × no longer competes with the input for vertical space. */
	.aieo-search-modal__close {
		position: static !important;
		top: auto !important;
		right: auto !important;
		flex: 0 0 auto !important;
		width: 32px !important;
		height: 32px !important;
		font-size: 22px !important;
		line-height: 32px !important;       /* match height so × is vertically centred */
		padding: 0 !important;
		margin: 0 !important;
		order: 2 !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		text-align: center !important;
	}
	.aieo-search-modal__slot {
		flex: 1 1 auto !important;
		min-width: 0 !important;
		order: 1 !important;
	}
	/* Zero out everything inside the modal slot so the input is the
	 * only element contributing height. Even one stray descendant
	 * margin (line-height ghost, default <p> ~16px from wpautop, a
	 * 1px label, an empty <div>) breaks the visual symmetry of the
	 * input within the panel. Nuking from orbit is the only way to
	 * be sure. */
	.aieo-search-modal__slot,
	.aieo-search-modal__slot * {
		margin: 0 !important;
		padding: 0 !important;
		line-height: 0 !important;
	}
	.aieo-search-modal__slot {
		display: flex !important;
		align-items: center !important;
	}
	/* Selectively restore line-height ONLY on the input itself + its
	 * placeholder so the typed text doesn't collapse. Everything else
	 * stays line-height:0 (= no ghost-line-of-text contribution). */
	.aieo-search-modal__slot .dgwt-wcas-search-input,
	.aieo-search-modal__slot .dgwt-wcas-search-input::placeholder {
		line-height: 1.2 !important;
	}
	.aieo-search-modal__slot .dgwt-wcas-search-input {
		background:    var(--rx-search-mobile-input-bg, #f6f6f6) !important;
		color:         var(--rx-search-mobile-input-color, #1f2937) !important;
		border:        var(--rx-search-mobile-input-border, 1px solid rgba(0,0,0,0.08)) !important;
		border-radius: var(--rx-search-mobile-input-radius, 0) !important;
		padding:       var(--rx-search-mobile-input-padding, 10px 14px) !important;
		margin:        var(--rx-search-mobile-input-margin, 0) !important;
		text-align:    var(--rx-search-mobile-input-align, left) !important;
		line-height:   normal !important;
		height:        auto !important;
	}
	/* Hide FiboSearch's own mobile-overlay artefacts — we own the
	 * chrome inside the modal. Suppress the close button, voice-
	 * search icon, preloader, and the arrow indicators that the
	 * plugin's mobile-overlay mode tries to add. */
	.aieo-search-modal__slot .dgwt-wcas-close,
	.aieo-search-modal__slot .dgwt-wcas-overlay-mobile-magnifier,
	.aieo-search-modal__slot .dgwt-wcas-preloader,
	.aieo-search-modal__slot .dgwt-wcas-voice-search,
	.aieo-search-modal__slot .dgwt-wcas-search-submit,
	.aieo-search-modal__slot .dgwt-wcas-arrow,
	.aieo-search-modal__slot .dgwt-wcas-details-arrow {
		display: none !important;
	}
	/* Suggestions panel — fixed at TOP so it grows away from the
	 * keyboard. FiboSearch appends `.dgwt-wcas-suggestions-wrapp`
	 * to <body> rather than keeping it inside the input wrapper
	 * (standard autocomplete pattern to escape parent
	 * `overflow: hidden` contexts), so the selector below targets
	 * it at body-level — not scoped to `.aieo-search-modal__slot`.
	 * On mobile (≤720px) we always want the suggestions to float
	 * to the top of the viewport, even though the desktop FiboSearch
	 * suggestions use the same class — the @media gate keeps them
	 * untouched on desktop. */
	.aieo-search-modal__slot .dgwt-wcas-search-wrapp {
		position: relative !important;
	}
	/* Suggestions / search history wrapper. FiboSearch reuses the
	 * same `.dgwt-wcas-suggestions-wrapp` element to show BOTH the
	 * autocomplete suggestions list AND the search-history panel
	 * (the "Το ιστορικό των αναζητήσεών σας" view shown when the
	 * input is focused but empty). Both go through the same rules.
	 *
	 * Selector specificity is bumped via the `body` prefix and the
	 * `[class]` attribute trick so we beat any inline style
	 * FiboSearch's JS might set (the plugin positions its dropdown
	 * by writing `style="..."` to the same element on focus). */
	body div[class~="dgwt-wcas-suggestions-wrapp"] {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		/* Suggestions panel ends ABOVE the modal panel — strictly no
		 * overlap (z-index ordering can't be relied on when FiboSearch
		 * appends suggestions inside the modal slot). The 60px is
		 * the modal panel's approximate rendered height: input ~36px
		 * + 8px+8px panel padding + 8px breathing gap. Override
		 * `--rx-search-mobile-panel-h` if you've increased input padding. */
		bottom: calc(var(--rx-search-mobile-margin-bottom, 58px) + var(--rx-search-mobile-panel-h, 60px)) !important;
		max-height: none !important;
		height: auto !important;
		overflow-y: auto !important;
		background:    var(--rx-search-mobile-results-bg, #ffffff) !important;
		border-radius: 0 0 var(--rx-search-mobile-results-radius, 0) var(--rx-search-mobile-results-radius, 0) !important;
		box-shadow:    var(--rx-search-mobile-results-shadow, 0 6px 18px rgba(0,0,0,0.18)) !important;
		z-index: 999999 !important;
		width: auto !important;
		min-width: 0 !important;
		margin: 0 !important;
		transform: none !important;
	}
	/* Note: previously used `flex-direction: column-reverse` on
	 * `.dgwt-wcas-st` to put most-relevant matches closest to the
	 * input. That broke product-result internal layout (title /
	 * description / price ordering, image-vs-details row direction)
	 * because the same class also wraps individual product cards.
	 * Natural top-down order is fine — the user is already looking
	 * up at suggestions while typing on the bottom-anchored keyboard. */
	/* Z-index hierarchy:
	 *   backdrop (999998) — bottom; just the gray overlay
	 *   suggestions (999999) — middle; clickable, scrollable
	 *   panel (1000000) — top; input + × always above
	 * The modal ROOT itself drops to z-index:auto + isolation:auto
	 * so it doesn't create its own stacking context — without that,
	 * the backdrop child would inherit the root's high z-index and
	 * sit ABOVE the suggestions panel, intercepting every click and
	 * scroll attempt on a result.
	 *
	 * `pointer-events: auto` on the suggestions is also asserted so
	 * any inherited `pointer-events: none` from a wrapper can't
	 * leak through. */
	.aieo-search-modal {
		z-index: auto !important;
		isolation: auto !important;
	}
	.aieo-search-modal__backdrop {
		z-index: 999998 !important;
	}
	body div[class~="dgwt-wcas-suggestions-wrapp"] {
		pointer-events: auto !important;
	}
	.aieo-search-modal__panel {
		z-index: 1000000 !important;
	}
}
