/**
 * Scout Search integration styling (Concept B).
 *
 * Loaded after the plugin's own assets/css/scout-search.css (bbt-scout-search
 * depends on the `scout-search` handle), so these rules win on equal
 * specificity without !important. Three layers, smallest first:
 *   1. --scout-* custom properties mapped onto bb-theme's own --bb-* tokens.
 *   2. Dropdown/overlay chrome tightened to the header's look (radius, border,
 *      focus ring) and to fit the mobile full-width search bar.
 *   3. The bb-theme additions inside scout-search/dropdown/item-product.php:
 *      the % off / BB-date badge over the thumbnail, the was/now price and
 *      the "Add to basket" action row.
 *
 * Rule: never yellow text on white, never white text on yellow
 * (docs/theme/THEME-ARCHITECTURE.md #6) - the accent stays --bb-ink on the
 * white dropdown panel; yellow is reserved for the add-to-basket button and
 * the %-off badge's background.
 *
 * @package BB_Theme
 */

/* 1. Tokens -------------------------------------------------------------- */

:root {
	--scout-bg: var(--bb-surface);
	--scout-text: var(--bb-ink);
	--scout-muted: var(--bb-muted);
	--scout-accent: var(--bb-ink);
	--scout-accent-text: #fff;
	--scout-border: var(--bb-border);
	--scout-hover: var(--bb-pale-yellow);
	--scout-mark-bg: var(--bb-soft-yellow);
	--scout-mark-text: var(--bb-ink);
	--scout-radius: var(--bb-r-panel);
	--scout-shadow: var(--bb-shadow);
	--scout-gap: 12px;
	--scout-pad: 12px 16px;
	--scout-font-size: 0.9375rem;
	--scout-img-size: 52px;
	--scout-max-height: 70vh;
	--scout-offset: 10px;
	--scout-z: 90;
	--scout-in-stock: var(--bb-success);
	--scout-out-of-stock: var(--bb-error);
	--scout-backorder: var(--bb-urgency);
	--scout-rating-color: var(--bb-urgency);
	--scout-overlay-backdrop: rgba(17, 17, 17, .55);
	--scout-overlay-width: 720px;
}

/* 2. Dropdown chrome ------------------------------------------------------ */

.bb-search .scout-dropdown {
	border: 1px solid var(--bb-border-2);
	font-family: var(--bb-font-body);
}

.bb-search.scout-is-open {
	border-color: var(--bb-ink);
	box-shadow: 0 0 0 3px rgba(255, 207, 2, .55);
}

.scout-view-all,
.scout-notice-link {
	color: var(--bb-ink);
	font-weight: 700;
	text-decoration: underline;
}

.scout-section {
	font-family: var(--bb-font-display);
	text-transform: uppercase;
	letter-spacing: .02em;
	font-size: .75rem;
	color: var(--bb-muted);
}

/* Up to 767px, main.css reflows `.bb-search` to full header width (order:
 * 4; flex: 1 1 100%), so the dropdown's own left:0 edge lines up with a
 * wide box and the plugin's built-in <=480px rule already keeps it inset.
 *
 * Between 768px and 1024px (main.css's own tablet breakpoint,
 * `@media (max-width: 1024px)`), `.bb-search` is still competing for
 * space with the fulfilment button, account and basket in one header
 * row and can measure under 220px wide - far narrower than the plugin's
 * 420px dropdown minimum, which then overflows the viewport on the
 * right (confirmed at 768px: scrollWidth - innerWidth was 41px before
 * this rule). Matching main.css's own breakpoint here, rather than a
 * one-off number, keeps this correct if the header's flex layout changes. */
@media (max-width: 1024px) {
	.bb-search .scout-dropdown {
		left: 0;
		right: 0;
		width: auto;
		max-width: 100vw;
		min-width: 0;
	}
}

/* 3. bb-theme additions inside the overridden item template -------------- */

.bb-scout-item__media {
	position: relative;
}

.bb-scout-item__badges {
	position: absolute;
	inset: 2px 2px auto auto;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	pointer-events: none;
}

.bb-scout-item__badges .bb-badge {
	height: 18px;
	padding: 0 5px;
	font-size: .625rem;
}

.scout-item__price .bb-price {
	font-size: 1rem;
}

.scout-item__price .bb-was {
	display: block;
	font-size: .6875rem;
}

/* Product row: the Add button sits inline, right of the price (not on its own row). */
.scout-option--product {
	display: flex;
	align-items: center;
}
.scout-option--product > .scout-item {
	flex: 1 1 auto;
	min-width: 0;
}
.scout-item__actions.bb-scout-item__actions {
	flex: none;
	display: flex;
	align-items: center;
	padding: 0 16px 0 0;
}
@media (max-width: 480px) {
	.scout-item__actions.bb-scout-item__actions { padding-right: 10px; }
	.scout-item__actions.bb-scout-item__actions .bb-btn { padding-inline: 12px; font-size: .8125rem; }
}

.scout-item__actions .bb-btn {
	min-height: var(--bb-touch);
	min-width: 44px;
	border-radius: var(--bb-r-small);
}

/* Cards layout (results-page cards, if ever enabled): same action slot. */
.scout-tile__actions .bb-btn {
	min-height: var(--bb-touch);
	border-radius: var(--bb-r-small);
}

/* Keep the strip row's own text readable at the theme's base size. */
.scout-item__title {
	font-size: var(--scout-font-size);
	color: var(--bb-ink);
}

.scout-item__sku {
	font-variant-numeric: tabular-nums;
}
