/* =============================================
   HivePress Ajax Search — Estilos
   ============================================= */

/* Variables — edita aquí para cambiar colores */
.hpas-wrapper {
	--hpas-primary:    #2b7de9;
	--hpas-primary-h:  #1a5fb8;
	--hpas-bg:         #ffffff;
	--hpas-border:     #dde1e7;
	--hpas-text:       #1a1a2e;
	--hpas-muted:      #6b7280;
	--hpas-radius:     10px;
	--hpas-shadow:     0 2px 16px rgba(0,0,0,.08);
	--hpas-card-bg:    #ffffff;
	font-family: inherit;
}

/* ── Formulario ────────────────────────────── */
.hpas-form {
	display: flex;
	flex-wrap: wrap;
	gap: .75em;
	align-items: stretch;
	background: var(--hpas-bg);
	border: 1px solid var(--hpas-border);
	border-radius: var(--hpas-radius);
	padding: 1em;
	box-shadow: var(--hpas-shadow);
	margin-bottom: 1.5em;
}

.hpas-field {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 200px;
	background: #f7f8fa;
	border: 1px solid var(--hpas-border);
	border-radius: 8px;
	padding: 0 .75em;
	transition: border-color .2s;
}

.hpas-field:focus-within {
	border-color: var(--hpas-primary);
	box-shadow: 0 0 0 3px rgba(43,125,233,.15);
}

.hpas-field-icon {
	font-size: 1em;
	margin-right: .5em;
	pointer-events: none;
	flex-shrink: 0;
}

.hpas-input,
.hpas-select {
	flex: 1;
	border: none;
	background: transparent;
	padding: .65em 0;
	font-size: .95em;
	color: var(--hpas-text);
	outline: none;
	min-width: 0;
}

.hpas-select {
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	padding-right: 1.5em;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .5em center;
}

/* Botones */
.hpas-btn {
	flex: 0 0 auto;
	padding: .65em 1.4em;
	background: var(--hpas-primary);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: .95em;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s, transform .1s;
	align-self: stretch;
}

.hpas-btn:hover  { background: var(--hpas-primary-h); }
.hpas-btn:active { transform: scale(.97); }

.hpas-btn--clear {
	background: transparent;
	color: var(--hpas-muted);
	border: 1px solid var(--hpas-border);
}

.hpas-btn--clear:hover {
	background: #f7f8fa;
	color: var(--hpas-text);
}

/* Autocompletar */
.hpas-suggestions {
	position: absolute;
	top: calc(100% + 6px);
	left: 0; right: 0;
	background: #fff;
	border: 1px solid var(--hpas-border);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,.12);
	z-index: 999;
	overflow: hidden;
}

.hpas-suggestions li {
	list-style: none;
	padding: .6em 1em;
	cursor: pointer;
	font-size: .9em;
	color: var(--hpas-text);
	transition: background .15s;
}

.hpas-suggestions li:hover,
.hpas-suggestions li.is-active {
	background: #f0f4ff;
	color: var(--hpas-primary);
}

/* ── Status / spinner ──────────────────────── */
.hpas-status {
	text-align: center;
	color: var(--hpas-muted);
	font-size: .9em;
	margin-bottom: 1em;
}

.hpas-spinner {
	display: flex;
	justify-content: center;
	padding: 2em 0;
}

.hpas-spinner__ring {
	width: 36px; height: 36px;
	border: 3px solid var(--hpas-border);
	border-top-color: var(--hpas-primary);
	border-radius: 50%;
	animation: hpas-spin .7s linear infinite;
}

@keyframes hpas-spin { to { transform: rotate(360deg); } }

/* ── Grid de resultados ────────────────────── */
.hpas-results {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax(260px, 1fr) );
	gap: 1.25em;
}

/* ── Tarjeta ───────────────────────────────── */
.hpas-card {
	background: var(--hpas-card-bg);
	border: 1px solid var(--hpas-border);
	border-radius: var(--hpas-radius);
	overflow: hidden;
	box-shadow: var(--hpas-shadow);
	display: flex;
	flex-direction: column;
	transition: transform .2s, box-shadow .2s;
}

.hpas-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0,0,0,.13);
}

.hpas-card__thumb {
	display: block;
	aspect-ratio: 16/9;
	overflow: hidden;
	background: #f0f4ff;
}

.hpas-card__thumb img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform .3s;
}

.hpas-card:hover .hpas-card__thumb img {
	transform: scale(1.04);
}

.hpas-card__no-img {
	width: 100%; height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.5em;
	color: #c5d0e6;
}

.hpas-card__body {
	padding: 1em;
	display: flex;
	flex-direction: column;
	gap: .4em;
	flex: 1;
}

.hpas-card__meta {
	display: flex;
	align-items: center;
	gap: .5em;
	flex-wrap: wrap;
}

.hpas-card__cat {
	font-size: .75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--hpas-primary);
	background: rgba(43,125,233,.08);
	padding: .2em .6em;
	border-radius: 20px;
}

.hpas-card__price {
	font-weight: 700;
	font-size: .9em;
	color: #16a34a;
	margin-left: auto;
}

.hpas-card__title {
	margin: 0;
	font-size: 1em;
	line-height: 1.35;
}

.hpas-card__title a {
	color: var(--hpas-text);
	text-decoration: none;
}

.hpas-card__title a:hover { color: var(--hpas-primary); }

.hpas-card__excerpt {
	margin: 0;
	font-size: .85em;
	color: var(--hpas-muted);
	line-height: 1.5;
}

.hpas-card__location {
	font-size: .8em;
	color: var(--hpas-muted);
	margin-top: auto;
	padding-top: .5em;
	border-top: 1px solid var(--hpas-border);
}

/* Resaltado de término buscado */
.hpas-highlight {
	background: #fef08a;
	color: inherit;
	border-radius: 2px;
	padding: 0 1px;
}

/* ── Paginación ────────────────────────────── */
.hpas-pagination {
	display: flex;
	justify-content: center;
	gap: .5em;
	margin-top: 2em;
	flex-wrap: wrap;
}

.hpas-page-btn {
	min-width: 38px;
	height: 38px;
	padding: 0 .75em;
	border: 1px solid var(--hpas-border);
	border-radius: 8px;
	background: #fff;
	color: var(--hpas-text);
	font-size: .9em;
	cursor: pointer;
	transition: all .2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hpas-page-btn:hover { border-color: var(--hpas-primary); color: var(--hpas-primary); }

.hpas-page-btn.is-active {
	background: var(--hpas-primary);
	border-color: var(--hpas-primary);
	color: #fff;
	font-weight: 700;
}

.hpas-page-btn:disabled {
	opacity: .4;
	cursor: default;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 600px) {
	.hpas-form { flex-direction: column; }
	.hpas-field { flex: 1 1 100%; }
	.hpas-btn  { width: 100%; justify-content: center; }
	.hpas-results { grid-template-columns: 1fr; }
}
