/* PBN Search - frontend styles */

.pbn-search {
	position: relative;
	width: 100%;
	max-width: 560px;
	box-sizing: border-box;
}

.pbn-search * {
	box-sizing: border-box;
}

.pbn-search__form {
	display: flex;
	align-items: stretch;
	width: 100%;
	background: #fff;
	border: 1px solid #d9dee3;
	border-radius: 999px;
	overflow: hidden;
	box-shadow: none;
	padding: 0;
	margin: 0;
}

.pbn-search__form:focus-within {
	border-color: var(--pbn-primary, #1f3a5f);
	box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.12);
}

/* Reset theme (Astra/WooCommerce) input styling so the pill wins. */
.pbn-search .pbn-search__input,
.pbn-search input.pbn-search__input[type="search"] {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	width: auto !important;
	border: 0 !important;
	outline: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	padding: 0 18px !important;
	margin: 0 !important;
	height: 46px !important;
	line-height: 46px !important;
	/* 16px prevents iOS auto-zoom on focus. */
	font-size: 16px !important;
	color: #1f2329 !important;
	-webkit-appearance: none;
	appearance: none;
}

.pbn-search__input::placeholder {
	color: #98a2ad;
	opacity: 1;
}

/* Hide the native search-input clear/decoration in WebKit. */
.pbn-search__input::-webkit-search-decoration,
.pbn-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.pbn-search .pbn-search__btn {
	flex: 0 0 auto !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 52px !important;
	min-width: 52px !important;
	height: auto !important;
	border: 0 !important;
	border-radius: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	color: #fff !important;
	background: var(--pbn-primary, #1f3a5f) !important;
}

.pbn-search .pbn-search__btn:hover {
	filter: brightness(1.08);
}

.pbn-search__btn svg {
	width: 20px;
	height: 20px;
	display: block;
}

/* Suggestions panel */
.pbn-search__panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 99990;
	background: #fff;
	border: 1px solid #e4e8ec;
	border-radius: 14px;
	box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
	overflow: hidden;
	max-height: min(70vh, 520px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.pbn-search__panel[hidden] {
	display: none;
}

.pbn-search__opt {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none;
	color: #1f2329;
	border-bottom: 1px solid #f1f3f5;
}

.pbn-search__opt:last-child {
	border-bottom: 0;
}

.pbn-search__opt.is-active,
.pbn-search__opt:hover {
	background: #f6f8fa;
}

.pbn-search__opt img {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 8px;
	background: #f1f3f5;
}

.pbn-search__opt-body {
	flex: 1 1 auto;
	min-width: 0;
}

.pbn-search__opt-name {
	display: block;
	font-size: 14px;
	line-height: 1.35;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pbn-search__opt-price {
	display: block;
	font-size: 13px;
	color: #5a6470;
	margin-top: 2px;
}

.pbn-search__opt-price del {
	color: #98a2ad;
	margin-right: 6px;
}

.pbn-search__opt-oos {
	font-size: 11px;
	color: #b42318;
	margin-left: 6px;
}

.pbn-search__msg {
	padding: 16px 14px;
	font-size: 14px;
	color: #5a6470;
	text-align: center;
}

.pbn-search__foot {
	display: block;
	padding: 12px 14px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--pbn-primary, #1f3a5f);
	text-decoration: none;
	background: #f6f8fa;
}

.pbn-search__foot:hover {
	text-decoration: underline;
}

/* Header takeover: centered desktop box.
   The injected box lives inside Astra's auto-sized centre column, so an
   explicit width (not 100%) is needed or the cell collapses to min-content. */
.pbn-search--header {
	width: clamp(280px, 42vw, 640px);
	max-width: 100%;
	margin: 0 auto;
	flex: 1 1 auto;
}

/* Let the host header cell grow so the box can sit centered and wide. */
body.pbn-search-center .ast-search-menu-icon,
body.pbn-search-center .site-header-section-center,
body.pbn-search-center .ast-header-search {
	flex: 1 1 auto !important;
	display: flex !important;
	justify-content: center;
	max-width: none !important;
}

/* Mobile full-width bar injected as its own row under the whole header. */
.pbn-search--mobile {
	max-width: none;
	width: 100%;
	padding: 10px 16px;
	background: #fff;
	border-bottom: 1px solid #eef1f4;
}

.pbn-search--mobile .pbn-search__form {
	max-width: none;
}

/* Mobile bar only on phones; desktop header box only on larger screens. */
@media (min-width: 922px) {
	.pbn-search--mobile {
		display: none !important;
	}
}

@media (max-width: 921px) {
	.pbn-search--header {
		display: none !important;
	}
}

/* -------------------------------------------------------------------- */
/* Results page                                                          */
/* -------------------------------------------------------------------- */

.pbn-search-results-page {
	width: 100%;
}

.pbn-results__head {
	margin-bottom: 18px;
}

.pbn-results__title {
	margin: 0 0 4px;
	font-size: 26px;
	line-height: 1.2;
}

.pbn-results__count {
	margin: 0;
	color: #5a6470;
	font-size: 14px;
}

.pbn-results__sort {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin-bottom: 16px;
}

.pbn-results__sort-label {
	font-size: 13px;
	color: #5a6470;
}

.pbn-results__sort select {
	padding: 7px 10px;
	border: 1px solid #d9dee3;
	border-radius: 8px;
	font-size: 14px;
}

.pbn-results__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(var(--pbn-cols, 4), minmax(0, 1fr));
	gap: 22px;
}

.pbn-results__item {
	display: flex;
	flex-direction: column;
}

.pbn-results__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.pbn-results__thumb {
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	overflow: hidden;
	background: #f1f3f5;
}

.pbn-results__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pbn-results__name {
	display: block;
	margin: 10px 0 4px;
	font-size: 15px;
	line-height: 1.4;
}

.pbn-results__price {
	display: block;
	font-weight: 600;
	color: #1f2329;
}

.pbn-results__oos {
	display: inline-block;
	margin-top: 4px;
	font-size: 12px;
	color: #b42318;
}

.pbn-results__cart {
	margin-top: 10px;
	text-align: center;
}

.pbn-results__pager {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	margin-top: 32px;
}

.pbn-results__pg {
	min-width: 38px;
	padding: 8px 12px;
	text-align: center;
	border: 1px solid #d9dee3;
	border-radius: 8px;
	text-decoration: none;
	color: #1f2329;
	font-size: 14px;
}

.pbn-results__pg.is-current {
	background: var(--pbn-primary, #1f3a5f);
	border-color: var(--pbn-primary, #1f3a5f);
	color: #fff;
}

.pbn-results__none {
	text-align: center;
	padding: 28px 0;
}

.pbn-results__none-msg {
	font-size: 18px;
	color: #1f2329;
	margin-bottom: 18px;
}

.pbn-results__popular {
	margin: 0 auto 20px;
}

.pbn-results__popular-label {
	display: block;
	font-size: 13px;
	color: #5a6470;
	margin-bottom: 8px;
}

.pbn-results__popular ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.pbn-results__popular a {
	display: inline-block;
	padding: 6px 14px;
	border: 1px solid #d9dee3;
	border-radius: 999px;
	text-decoration: none;
	color: #1f3a5f;
	font-size: 13px;
}

.pbn-results__popular a:hover {
	background: #f6f8fa;
}

.pbn-results--prompt {
	text-align: center;
	padding: 40px 0;
}

.pbn-results--prompt .pbn-search {
	margin: 18px auto 0;
}

@media (max-width: 1024px) {
	.pbn-results__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	.pbn-results__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}

	.pbn-results__title {
		font-size: 21px;
	}
}
