/**
 * Bee1 Search For WooCommerce — front-end styles.
 * Scoped under .bee1-search / .bee1-results to avoid theme collisions.
 *
 * @package Bee1_Search
 */

:root {
	--bee1-accent: #1e73be;
	--bee1-hover: #f7f7f7;
	--bee1-border: #e2e2e2;
	--bee1-text: #2b2b2b;
	--bee1-muted: #767676;
	--bee1-bg: #ffffff;
	--bee1-radius: 6px;
	--bee1-shadow: 0 8px 30px rgba( 0, 0, 0, 0.12 );
}

/* ------------------------------------------------------------------ *
 *  Form
 * ------------------------------------------------------------------ */
.bee1-search {
	position: relative;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	font-size: 15px;
	line-height: 1.4;
}

.bee1-search *,
.bee1-results * {
	box-sizing: border-box;
}

.bee1-search__field {
	position: relative;
	display: flex;
	align-items: stretch;
}

.bee1-search__input {
	flex: 1 1 auto;
	width: 100%;
	min-height: 44px;
	padding: 8px 44px 8px 14px;
	border: 1px solid var(--bee1-border);
	border-radius: var(--bee1-radius);
	background: var(--bee1-bg);
	color: var(--bee1-text);
	font-size: inherit;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bee1-search__input:focus {
	border-color: var(--bee1-accent);
	box-shadow: 0 0 0 3px rgba( 30, 115, 190, 0.15 );
}

.bee1-search__submit {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: 44px;
	border: 0;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--bee1-muted);
}

.bee1-search__submit:hover .bee1-search__submit-icon,
.bee1-search__submit:focus .bee1-search__submit-icon {
	border-color: var(--bee1-accent);
}

/* Inline-SVG magnifier (1.1.5): immune to third-party width/border overrides. */
svg.bee1-search__submit-icon {
	display: block;
	width: 18px !important;
	height: 18px !important;
	border: 0 !important;
	border-radius: 0 !important;
}
.bee1-search__submit-icon {
	position: relative;
}

.bee1-search__submit-icon::after {
	content: "";
	position: absolute;
	right: -6px;
	bottom: -4px;
	width: 8px;
	height: 2px;
	background: currentColor;
	transform: rotate( 45deg );
}

/* RTL: flip icon/submit to the left. */
[dir="rtl"] .bee1-search__input {
	padding: 8px 14px 8px 44px;
}

[dir="rtl"] .bee1-search__submit {
	right: auto;
	left: 0;
}

/* RTL: dropdown and details panel mirror. */
[dir="rtl"] .bee1-results {
	left: auto;
	right: 0;
	text-align: right;
}

[dir="rtl"] .bee1-details-panel {
	border-left: 0;
	border-right: 1px solid var(--bee1-border);
}

[dir="rtl"] .bee1-overlay__close {
	right: auto;
	left: 10px;
}

/* ------------------------------------------------------------------ *
 *  Results dropdown
 * ------------------------------------------------------------------ */
.bee1-results {
	position: absolute;
	z-index: 99999;
	top: calc( 100% + 6px );
	left: 0;
	width: 100%;
	max-height: 70vh;
	overflow: auto;
	background: var(--bee1-bg);
	border: 1px solid var(--bee1-border);
	border-radius: var(--bee1-radius);
	box-shadow: var(--bee1-shadow);
	display: flex;
}

.bee1-results[hidden] {
	display: none;
}

.bee1-results__list {
	flex: 1 1 auto;
	min-width: 0;
}

.bee1-results__heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px 4px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--bee1-muted);
}

.bee1-results__noresults {
	padding: 18px 14px;
	color: var(--bee1-muted);
	text-align: center;
}

.bee1-history__clear {
	border: 0;
	background: none;
	color: var(--bee1-accent);
	cursor: pointer;
	font-size: 11px;
	text-transform: none;
	letter-spacing: 0;
}

/* ------------------------------------------------------------------ *
 *  Suggestion rows
 * ------------------------------------------------------------------ */
.bee1-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 14px;
	text-decoration: none;
	color: var(--bee1-text);
	border-top: 1px solid rgba( 0, 0, 0, 0.04 );
}

.bee1-item:first-child {
	border-top: 0;
}

.bee1-item:hover,
.bee1-item.is-active,
.bee1-results__seeall:hover,
.bee1-results__seeall.is-active {
	background: var(--bee1-hover);
}

.bee1-item__thumb {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 4px;
	background: #fafafa;
}

.bee1-item__thumb img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
}

.bee1-item__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bee1-item__title {
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bee1-item--term .bee1-item__title {
	font-weight: 500;
}

.bee1-item__sku,
.bee1-item__desc {
	font-size: 12px;
	color: var(--bee1-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bee1-item__count {
	flex: 0 0 auto;
	font-size: 12px;
	color: var(--bee1-muted);
	background: rgba( 0, 0, 0, 0.05 );
	border-radius: 10px;
	padding: 1px 8px;
}

.bee1-item__price {
	flex: 0 0 auto;
	font-weight: 700;
	color: var(--bee1-text);
	white-space: nowrap;
}

.bee1-item__price del {
	color: var(--bee1-muted);
	font-weight: 400;
	margin-right: 4px;
}

.bee1-results__seeall {
	display: block;
	padding: 11px 14px;
	text-align: center;
	font-weight: 600;
	color: var(--bee1-accent);
	text-decoration: none;
	border-top: 1px solid var(--bee1-border);
	position: sticky;
	bottom: 0;
	background: var(--bee1-bg);
}

/* ------------------------------------------------------------------ *
 *  Details panel
 * ------------------------------------------------------------------ */
.bee1-details-panel {
	flex: 0 0 300px;
	order: 2;
	border-left: 1px solid var(--bee1-border);
	padding: 16px;
}

.bee1-details-panel[hidden] {
	display: none;
}

.bee1-details__media {
	text-align: center;
	margin-bottom: 12px;
}

.bee1-details__media img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

.bee1-details__title {
	display: block;
	font-weight: 700;
	font-size: 16px;
	color: var(--bee1-text);
	text-decoration: none;
	margin-bottom: 6px;
}

.bee1-details__price {
	font-weight: 700;
	margin-bottom: 8px;
}

.bee1-details__desc {
	font-size: 13px;
	color: var(--bee1-muted);
	margin-bottom: 12px;
}

.bee1-details__cart {
	display: flex;
	gap: 8px;
	align-items: center;
}

.bee1-details__qty {
	width: 60px;
	min-height: 38px;
	padding: 6px 8px;
	border: 1px solid var(--bee1-border);
	border-radius: 4px;
}

.bee1-details__add,
.bee1-details__select {
	flex: 1 1 auto;
	min-height: 38px;
	border: 0;
	border-radius: 4px;
	background: var(--bee1-accent);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 12px;
}

.bee1-details__add.loading {
	opacity: 0.7;
	cursor: default;
}

.bee1-details__add.added {
	background: #46b450;
}

/* ------------------------------------------------------------------ *
 *  Preloader
 * ------------------------------------------------------------------ */
.bee1-is-loading .bee1-search__submit-icon {
	animation: bee1-spin 0.7s linear infinite;
	border-right-color: transparent;
}

@keyframes bee1-spin {
	to {
		transform: rotate( 360deg );
	}
}

/* ------------------------------------------------------------------ *
 *  Mobile overlay
 * ------------------------------------------------------------------ */
html.bee1-overlay-open {
	overflow: hidden;
}

.bee1-search.bee1-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: var(--bee1-bg);
	padding: 14px;
	max-width: none;
}

.bee1-search.bee1-overlay .bee1-results {
	position: static;
	box-shadow: none;
	border: 0;
	margin-top: 12px;
	max-height: calc( 100vh - 80px );
}

/* Stack the details panel below the list inside the mobile overlay. */
.bee1-search.bee1-overlay .bee1-results {
	flex-direction: column;
	width: 100% !important;
	max-width: 100% !important;
}

.bee1-search.bee1-overlay .bee1-details-panel {
	flex-basis: auto;
	order: 0;
	border-left: 0;
	border-top: 1px solid var(--bee1-border);
}

/* Stack the details panel below the list and force full-width on mobile screens. */
@media ( max-width: 768px ) {
	.bee1-results {
		flex-direction: column;
		width: 100% !important;
		max-width: 100% !important;
	}

	.bee1-details-panel {
		flex-basis: auto;
		order: 0;
		border-left: 0;
		border-top: 1px solid var(--bee1-border);
	}
}

.bee1-overlay__close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 40px;
	height: 40px;
	border: 0;
	background: none;
	font-size: 30px;
	line-height: 1;
	color: var(--bee1-muted);
	cursor: pointer;
}

.bee1-overlay__close[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ *
 *  Dark scheme (only if the theme opts in via prefers-color-scheme)
 * ------------------------------------------------------------------ */
@media ( prefers-color-scheme: dark ) {
	.bee1-search--dark {
		--bee1-bg: #1e1e1e;
		--bee1-text: #f0f0f0;
		--bee1-muted: #a5a5a5;
		--bee1-border: #3a3a3a;
		--bee1-hover: #2a2a2a;
	}
}

/* Accessibility helper (matches WP core). */
.bee1-search .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* ===== XPASS: enlarge search dropdown fonts for readability (claude) ===== */
.bee1-results__heading { font-size: 14px !important; }
.bee1-item__title { font-size: 17px !important; }
.bee1-item__price { font-size: 16px !important; }
.bee1-item__sku, .bee1-item__count { font-size: 14px !important; }
.bee1-details__title { font-size: 20px !important; line-height: 1.35 !important; }
.bee1-details__price { font-size: 18px !important; }
.bee1-details__desc { font-size: 15px !important; line-height: 1.6 !important; }
.bee1-search__input { font-size: 16px !important; }
.bee1-item__meta, .bee1-results a, .bee1-panel a { font-size: 15px !important; }
