/**
 * CE Search — Front-end styles.
 *
 * BEM prefix: .ce-search
 * Overrides come from Elementor dynamic CSS selectors in widget.php.
 *
 * Default: pill-shaped input, search icon inside left,
 *          loading spinner / clear X inside right.
 *
 * @package Cenario_Core
 */

/* =============================================
   WRAPPER
   ============================================= */

.ce-search {
	position: relative;
	width: 100%;
}

/* =============================================
   LABEL
   ============================================= */

.ce-search__label {
	display: block;
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

/* =============================================
   FORM
   ============================================= */

.ce-search__form {
	display: flex;
	flex-direction: column;
	margin-bottom: 16px;
}

/* =============================================
   INPUT WRAP — the pill container
   ============================================= */

.ce-search__input-wrap {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

/* =============================================
   THE INPUT
   ============================================= */

.ce-search__input {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	padding: 14px 48px 14px 46px;
	font-size: 16px;
	line-height: 1.5;
	color: #1d2327;
	background-color: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 50px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06),
	            0 1px 2px rgba(0, 0, 0, 0.04);
	outline: none;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.ce-search__input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12),
	            0 1px 3px rgba(0, 0, 0, 0.06);
}

.ce-search__input::placeholder {
	color: #999999;
	opacity: 1;
}

/* When no icon is present, reduce left padding */
.ce-search__input-wrap > .ce-search__input:first-child {
	padding-left: 20px;
}

/* =============================================
   SEARCH ICON — inside left
   ============================================= */

.ce-search__icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	font-size: 16px;
	line-height: 1;
	color: #999999;
	background: transparent;
	border: none;
	border-radius: 0;
	cursor: pointer;
	pointer-events: auto;
	transition: color 0.2s ease;
}

.ce-search__icon:hover {
	color: #2271b1;
}

.ce-search__icon:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	border-radius: 4px;
}

/*
 * SVG inside the icon — inherit color only,
 * never override stroke/fill on custom SVGs.
 */
.ce-search__icon svg {
	display: block;
	width: 1em;
	height: 1em;
}

.ce-search__icon i {
	display: block;
	font-size: inherit;
	line-height: 1;
}

/* =============================================
   ACTION SLOT — right side of input
   Contains loading spinner + clear button.
   Only one is visible at a time.
   ============================================= */

.ce-search__action-slot {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin: 0;
	padding: 0;
	pointer-events: none;
}

/* ── Loading spinner ─── */

.ce-search__loading {
	display: none;
	align-items: center;
	justify-content: center;
	color: #999999;
	line-height: 0;
}

.ce-search__loading svg {
	display: block;
	width: 18px;
	height: 18px;
}

.ce-search--loading .ce-search__loading {
	display: inline-flex;
}

.ce-search--loading .ce-search__clear {
	display: none !important;
}

/* ── Clear button ─── */

.ce-search__clear {
	display: none;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin: 0;
	padding: 0;
	font-size: 0;
	line-height: 0;
	color: #666666;
	background-color: #e5e5e5;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	pointer-events: auto;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ce-search__clear--visible {
	display: inline-flex;
}

.ce-search__clear:hover {
	background-color: #cccccc;
	color: #333333;
}

.ce-search__clear:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.ce-search__clear svg {
	display: block;
	width: 10px;
	height: 10px;
}

/* Filter tabs, icons, and carousel styles have been moved to
   modules/category-filter/assets/ce-category-filter.css */

/* =============================================
   CE LOAD MORE — our own infinite scroll anchor
   ============================================= */

.ce-load-more-anchor {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	min-height: 60px;
	padding: 20px 0;
}

.ce-load-more-spinner {
	display: flex;
	gap: 6px;
	align-items: center;
	justify-content: center;
}

.ce-load-more-spinner span {
	display: block;
	width: 10px;
	height: 10px;
	background-color: #999;
	border-radius: 50%;
	animation: ce-load-more-bounce 1.4s ease-in-out infinite both;
}

.ce-load-more-spinner span:nth-child(1) {
	animation-delay: -0.32s;
}

.ce-load-more-spinner span:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes ce-load-more-bounce {
	0%, 80%, 100% {
		transform: scale(0);
		opacity: 0.4;
	}
	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* =============================================
   NO RESULTS (injected into Loop Grid)
   ============================================= */

.ce-search__no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px 20px;
	font-size: 15px;
	color: #646970;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 767px) {
	.ce-search__form {
		flex-direction: column !important;
	}

	.ce-search__input-wrap {
		width: 100% !important;
	}

}
