/* Rst Search Engine - style frontendowe */

.rse-search-form {
	position: relative;
	width: 100%;
	max-width: 480px;
}

.rse-search-input-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border: 1px solid #d7d7d7;
	border-radius: 8px;
	padding: 6px 10px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rse-search-input-wrap:focus-within {
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.rse-icon--search {
	display: flex;
	color: #777;
	flex-shrink: 0;
}

.rse-search-input {
	flex: 1;
	border: none;
	outline: none;
	font-size: 15px;
	padding: 6px 4px;
	background: transparent;
	min-width: 0;
}

.rse-icon-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: #777;
	display: flex;
	align-items: center;
	padding: 4px;
	border-radius: 6px;
	flex-shrink: 0;
}

.rse-icon-btn:hover {
	color: #2271b1;
	background: rgba(34, 113, 177, 0.08);
}

.rse-search-submit-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.rse-results-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
	z-index: 9999;
	max-height: 70vh;
	overflow-y: auto;
	padding: 10px;
}

.rse-results-grid {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.rse-result-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
}

.rse-result-item:hover,
.rse-result-item.is-active {
	background: #f3f6f8;
}

.rse-result-thumb img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 6px;
	background: #fff;
}

.rse-result-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.rse-result-title {
	font-size: 14px;
	font-weight: 500;
	color: #1d2327;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rse-result-price {
	font-size: 13px;
	color: #2271b1;
	font-weight: 600;
}

.rse-stock {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.rse-stock.in-stock { color: #1e7e34; }
.rse-stock.out-of-stock { color: #b32d2e; }

.rse-no-results,
.rse-loading,
.rse-visual-labels {
	padding: 16px 10px;
	color: #555;
	font-size: 14px;
	text-align: center;
}

.rse-see-all {
	display: block;
	text-align: center;
	padding: 10px;
	font-size: 13px;
	font-weight: 600;
	color: #2271b1;
	text-decoration: none;
	border-top: 1px solid #eee;
	margin-top: 6px;
}

.rse-popular-title {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #888;
	padding: 6px 8px 2px;
}

.rse-popular-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rse-popular-item {
	background: none;
	border: none;
	width: 100%;
	text-align: left;
	padding: 8px;
	font-size: 14px;
	cursor: pointer;
	border-radius: 6px;
}

.rse-popular-item:hover {
	background: #f3f6f8;
}

/* Rekomendacje: "często kupowane razem" / "inni klienci oglądali" */

.rse-recommendations {
	margin: 40px 0;
}

.rse-recommendations__title {
	font-size: 18px;
	margin-bottom: 16px;
}

.rse-recommendations__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 16px;
}

.rse-recommendations__item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-decoration: none;
	color: inherit;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 10px;
	transition: box-shadow 0.15s ease;
}

.rse-recommendations__item:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.rse-recommendations__thumb img {
	width: 100%;
	height: auto;
	border-radius: 6px;
}

.rse-recommendations__name {
	font-size: 13px;
	font-weight: 500;
}

.rse-recommendations__price {
	font-size: 13px;
	color: #2271b1;
	font-weight: 600;
}

@media (max-width: 480px) {
	.rse-search-form {
		max-width: 100%;
	}
}

/* iOS Safari automatycznie przybliża stronę po dotknięciu pola tekstowego, jeśli jego
   font-size jest mniejszy niż 16px - stąd wrażenie "przybliżenia" i możliwość przesuwania
   strony w lewo/prawo po dotknięciu wyszukiwarki. 16px na wąskich ekranach eliminuje ten efekt. */
@media (max-width: 782px) {
	.rse-search-input {
		font-size: 16px;
	}
}

/* ------------------------------------------------------------------ */
/* Mobilny "pływający" przycisk wyszukiwania - patrz render_mobile_search_fab()  */
/* w class-rse-frontend.php. Widoczny wyłącznie na wąskich ekranach, jako       */
/* niezależny od motywu punkt dostępu do wyszukiwarki.                         */
/* ------------------------------------------------------------------ */

.rse-mobile-fab {
	display: none;
}

.rse-mobile-search-bar {
	display: none;
}

@media (max-width: 782px) {
	.rse-mobile-fab {
		display: flex;
		align-items: center;
		justify-content: center;
		position: fixed;
		right: 16px;
		bottom: 16px;
		width: 52px;
		height: 52px;
		border-radius: 50%;
		border: none;
		background: #e2231a;
		color: #fff;
		cursor: pointer;
		box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
		z-index: 99995;
	}

	.rse-mobile-fab:active {
		transform: scale(0.94);
	}

	.rse-mobile-fab[hidden] {
		display: none;
	}

	.rse-mobile-search-bar[hidden] {
		display: none;
	}

	.rse-mobile-search-bar {
		display: flex;
		align-items: center;
		gap: 8px;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		/* WYŻEJ niż pełnoekranowy panel wyników (z-index 99998 w rse-overlay.css) - inaczej
		   panel zasłania pole wyszukiwania i nie widać tego, co się wpisuje. */
		z-index: 200000;
		background: #fff;
		padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
		box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
	}

	.rse-mobile-search-bar .rse-search-form {
		max-width: 100%;
		flex: 1;
	}

	.rse-mobile-bar-close {
		flex-shrink: 0;
		background: none;
		border: none;
		color: #1d2327;
		cursor: pointer;
		padding: 6px;
		display: flex;
	}
}
