/* ==========================================================================
   Agua de Baleares: Product Search Widget
   ========================================================================== */

.elementor-widget-abw-product-search,
.elementor-widget-abw-product-search > .elementor-widget-container {
	width: 100%;
}

/* ── Input wrap ─────────────────────────────────────────────────────────────── */

.abw-ps-input-wrap {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

.abw-ps-input {
	display: block;
	width: 100%;
	background: transparent;
	border: none;
	border-radius: 0;
	outline: none;
	color: inherit;
	font: inherit;
	padding: 8px 36px 8px 0;
	-webkit-appearance: none;
	appearance: none;
}

/* Ocultar el botón nativo de limpiar en Chrome/Safari */
.abw-ps-input::-webkit-search-cancel-button,
.abw-ps-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.abw-ps-clear {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 4px;
	cursor: pointer;
	color: inherit;
	line-height: 0;
	opacity: 0.6;
	transition: opacity 0.2s ease;
}

.abw-ps-clear:hover,
.abw-ps-clear:focus,
.abw-ps-clear:active {
	background: transparent !important;
	box-shadow: none !important;
	opacity: 1;
}

/* ── Results area ───────────────────────────────────────────────────────────── */

.abw-ps-results {
	width: 100%;
}

/* Grid: columnas controladas via JS con CSS custom property */
.abw-ps-grid {
	display: grid;
	grid-template-columns: repeat(var(--abw-ps-cols, 5), 1fr);
	column-gap: 16px;
	row-gap: 16px;
}

/* Cada item wrappea el HTML del Loop Item de Elementor */
.abw-ps-item {
	min-width: 0;
}

/* ── Forzar ocultación nativa [hidden] que algunos temas sobreescriben ────── */

.abw-product-search [hidden] {
	display: none !important;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */

.abw-ps-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 24px 0;
}

.abw-ps-loading-dot {
	display: block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.3;
	animation: abw-ps-pulse 1.2s ease-in-out infinite;
}

.abw-ps-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.abw-ps-loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes abw-ps-pulse {
	0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
	40%            { opacity: 1;   transform: scale(1.3); }
}

/* ── Carousel ────────────────────────────────────────────────────────────────── */

.abw-ps-carousel {
	position: relative;
	overflow: hidden;
	width: 100%;
}

.abw-ps-carousel-track {
	display: flex;
	gap: var( --abw-ps-gap, 16px );
	transition: transform 0.35s ease;
	will-change: transform;
	/* El track no debe desbordarse — el overflow:hidden del padre lo recorta */
	width: 100%;
}

.abw-ps-carousel-track .abw-ps-item {
	flex-shrink: 0;
	min-width: 0;
}

.abw-ps-carousel-track .abw-ps-item > * {
	width: 100%;
}

.abw-ps-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	cursor: pointer;
	line-height: 0;
	z-index: 2;
	color: inherit;
}

.abw-ps-arrow-prev { left: 0; }
.abw-ps-arrow-next { right: 0; }

.abw-ps-arrow svg {
	display: block;
	width: 20px;
	height: 20px;
}

.abw-ps-dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 16px;
}

.abw-ps-dot {
	display: block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.35;
	border: none;
	padding: 0;
	cursor: pointer;
	transition: opacity 0.2s;
}

.abw-ps-dot.is-active {
	opacity: 1;
}

/* ── No results ─────────────────────────────────────────────────────────────── */

.abw-ps-no-results {
	margin: 0;
	padding: 24px 0;
	text-align: center;
}

/* ── Fade-in suave al aparecer resultados ───────────────────────────────────── */

.abw-ps-grid.is-visible {
	animation: abw-ps-fadein 0.25s ease;
}

@keyframes abw-ps-fadein {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}
