/**
 * Cerca — lista simple de servicios (mobile-first).
 */

body.zp-cerca-list-page {
	--zp-cerca-header-offset: calc(env(safe-area-inset-top, 0px) + 108px);
	background: #ffffff !important;
}

/* El header fijo tapaba la primera card / el título. */
body.zp-cerca-list-page #page,
body.zp-cerca-list-page #wrapper,
body.zp-cerca-list-page #main,
body.zp-cerca-list-page .wrapper-mobile {
	padding-top: 0 !important;
	background: #ffffff !important;
}

/* Sin highlight celeste detrás del título / subtítulo. */
body.zp-cerca-list-page .zp-cerca__head,
body.zp-cerca-list-page .zp-cerca__title,
body.zp-cerca-list-page .zp-cerca__sub,
body.zp-cerca-list-page .zp-cerca__title::before,
body.zp-cerca-list-page .zp-cerca__title::after,
body.zp-cerca-list-page .zp-cerca__sub::before,
body.zp-cerca-list-page .zp-cerca__sub::after {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	outline: none !important;
}

body.zp-cerca-list-page .zp-cerca__title::selection,
body.zp-cerca-list-page .zp-cerca__sub::selection {
	background: #e2e8f0 !important;
	color: #0f172a !important;
}

.zp-cerca {
	--zp-cerca-pad-x: 16px;
	max-width: 640px;
	margin: 0 auto;
	padding:
		calc(var(--zp-cerca-header-offset) + 12px)
		var(--zp-cerca-pad-x)
		calc(96px + env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
}

.zp-cerca__head {
	margin: 0 0 14px;
	background: transparent !important;
	box-shadow: none !important;
}

.zp-cerca__title {
	margin: 0 0 6px;
	font-size: 1.625rem;
	font-weight: 700;
	line-height: 1.2;
	color: #0f172a !important;
	letter-spacing: -0.02em;
	background: transparent !important;
	box-shadow: none !important;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

.zp-cerca__sub {
	margin: 0;
	font-size: 15px;
	line-height: 1.35;
	color: #64748b !important;
	background: transparent !important;
	box-shadow: none !important;
}

/* —— Category selector —— */
.zp-cerca-cat {
	position: relative;
	margin: 0 0 14px;
	z-index: 5;
}

.zp-cerca-cat__label {
	display: block;
	margin: 0 0 6px;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #64748b;
}

.zp-cerca-cat__trigger {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	padding: 0 14px;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	background: #fff;
	text-align: left;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.zp-cerca-cat__trigger:focus-visible,
.zp-cerca-cat__trigger[aria-expanded='true'] {
	border-color: #94a3b8;
	outline: none;
	box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}

.zp-cerca-cat__icon {
	color: #64748b;
	font-size: 16px;
	flex: 0 0 auto;
}

.zp-cerca-cat__value {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 1rem;
	font-weight: 600;
	color: #0f172a;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.zp-cerca-cat__chev {
	color: #64748b;
	font-size: 16px;
	flex: 0 0 auto;
}

.zp-cerca-cat__panel {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	max-height: min(52vh, 360px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
	z-index: 80;
	padding: 6px;
}

.zp-cerca-cat__panel[hidden] {
	display: none !important;
}

.zp-cerca-cat__opt {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	text-align: left;
	font-size: 1rem;
	font-weight: 500;
	color: #0f172a;
	cursor: pointer;
}

.zp-cerca-cat__opt:hover,
.zp-cerca-cat__opt:focus-visible,
.zp-cerca-cat__opt[aria-selected='true'] {
	background: #f1f5f9;
	outline: none;
}

.zp-cerca__status:empty {
	display: none;
}

.zp-cerca-loading,
.zp-cerca-empty,
.zp-cerca-error {
	margin: 8px 0 0;
	padding: 18px;
	font-size: 0.975rem;
	line-height: 1.4;
	color: #475569;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
}

.zp-cerca-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.zp-cerca-item {
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	overflow: hidden;
}

.zp-cerca-item__link {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	min-height: 112px;
	padding: 14px 14px 15px;
	text-decoration: none;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
}

.zp-cerca-item__link:active {
	background: #f1f5f9;
}

.zp-cerca-item__thumb {
	flex: 0 0 84px;
	width: 84px;
	height: 84px;
	margin-top: 2px;
	border-radius: 14px;
	background-color: #e2e8f0;
	background-size: cover;
	background-position: center;
}

.zp-cerca-item__thumb--empty {
	background-image: none;
}

.zp-cerca-item__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding-top: 1px;
}

.zp-cerca-item__title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.zp-cerca-item__title {
	flex: 1 1 auto;
	min-width: 0;
	/* Piso IG / captions legibles */
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
	color: #0f172a;
	-webkit-text-size-adjust: 100%;
}

/* Badge PRO: mismo markup/estilo que home (.yrl-pro-badge / .zp-card-pro-inline). */
.zp-cerca-item__title-row .yrl-pro-badge.zp-pro-badge,
.zp-cerca-item__title-row .zp-card-pro-inline,
.zp-cerca-item__pro.yrl-pro-badge {
	position: static !important;
	flex: 0 0 auto;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	margin: 0;
	z-index: 1;
}

.zp-cerca-item__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	font-size: 15px;
	line-height: 1.4;
	color: #475569;
}

.zp-cerca-item__cat {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: #334155;
}

.zp-cerca-item__dist {
	font-size: 15px;
	font-weight: 650;
	color: #0f172a;
}

.zp-cerca-item__address {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
	overflow: hidden;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.35;
	color: #334155;
}

.zp-cerca-item__desc {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	font-size: 0.9rem;
	font-weight: 400;
	line-height: 1.4;
	color: #64748b;
}

.zp-cerca-item__chev {
	flex: 0 0 auto;
	align-self: center;
	font-size: 1.5rem;
	line-height: 1;
	color: #94a3b8;
}

.zp-cerca__more-wrap {
	margin-top: 14px;
}

.zp-cerca__more-wrap[hidden] {
	display: none !important;
}

.zp-cerca__more-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: 12px 16px;
	border: 1px solid #cbd5e1;
	border-radius: 14px;
	background: #fff;
	color: #0f172a;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.zp-cerca__more-btn:disabled {
	opacity: 0.55;
	cursor: wait;
}

.zp-cerca__sentinel {
	height: 1px;
	width: 100%;
	pointer-events: none;
}

@media (min-width: 900px) {
	body.zp-cerca-list-page {
		--zp-cerca-header-offset: calc(env(safe-area-inset-top, 0px) + 84px);
	}

	.zp-cerca {
		padding-top: calc(var(--zp-cerca-header-offset) + 24px);
		padding-bottom: 48px;
	}

	.zp-cerca__title {
		font-size: 1.875rem;
	}

	.zp-cerca-item__link {
		min-height: 120px;
		padding: 16px;
	}

	.zp-cerca-item__thumb {
		flex-basis: 92px;
		width: 92px;
		height: 92px;
	}
}
