/* Maresme Properties — todos los colores/medidas se controlan desde
   Ajustes > Maresme Properties mediante variables CSS. */

.mrp-grid {
	display: grid;
	gap: 24px;
	margin: 24px 0;
}
.mrp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.mrp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.mrp-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
	.mrp-cols-3, .mrp-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.mrp-grid { grid-template-columns: 1fr; }
}

/* Tarjetas */
.mrp-card {
	background: var(--mrp-card-bg, #fff);
	border-radius: var(--mrp-radius, 10px);
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	color: var(--mrp-text, #1f2933);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mrp-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}
.mrp-card-media {
	display: block;
	position: relative;
}
.mrp-card-media img {
	width: 100%;
	height: var(--mrp-card-img-h, 230px);
	object-fit: cover;
	display: block;
}
.mrp-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: var(--mrp-secondary, #c9a227);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: calc(var(--mrp-radius, 10px) / 2);
}
.mrp-badge--sale { background: var(--mrp-badge-sale, var(--mrp-secondary, #c9a227)); }
.mrp-badge--rent { background: var(--mrp-badge-rent, var(--mrp-primary, #12395b)); }
.mrp-badge--inline { position: static; margin-right: 10px; }

/* Variante horizontal (imagen a la izquierda) */
.mrp-card--h { display: flex; }
.mrp-card--h .mrp-card-media { flex: 0 0 42%; }
.mrp-card--h .mrp-card-media img { height: 100%; min-height: 190px; }
.mrp-card--h .mrp-card-body { flex: 1; }
@media (max-width: 600px) {
	.mrp-card--h { display: block; }
	.mrp-card--h .mrp-card-media img { height: var(--mrp-card-img-h, 230px); }
}

/* Variante compacta */
.mrp-card--c .mrp-card-media img { height: calc(var(--mrp-card-img-h, 230px) * 0.7); }
.mrp-card--c .mrp-card-body { padding: 12px 14px 14px; }
.mrp-card--c .mrp-card-price { font-size: 1.1em; }
.mrp-card--c .mrp-card-title { font-size: 0.94em; }

.mrp-section-title { margin: 0 0 4px; }

/* Grid de poblaciones / tipos */
.mrp-term-card {
	position: relative;
	display: block;
	border-radius: var(--mrp-radius, 10px);
	overflow: hidden;
	min-height: 170px;
	background: var(--mrp-primary, #12395b);
	text-decoration: none;
}
.mrp-term-card img {
	width: 100%;
	height: var(--mrp-card-img-h, 230px);
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}
.mrp-term-card:hover img { transform: scale(1.05); }
.mrp-term-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 16px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0) 60%);
}
.mrp-term-name { color: #fff; font-size: 1.15em; font-weight: 800; }
.mrp-term-count { color: #fff; opacity: 0.85; font-size: 0.85em; }

/* Listado con mapa lateral */
.mrp-split { display: grid; grid-template-columns: 1fr 42%; gap: 24px; align-items: start; }
.mrp-split-map { position: sticky; top: 20px; }
@media (max-width: 900px) {
	.mrp-split { grid-template-columns: 1fr; }
	.mrp-split-map { position: static; }
}

/* Mapa */
.mrp-map-canvas {
	width: 100%;
	border-radius: var(--mrp-radius, 10px);
	overflow: hidden;
	z-index: 0;
}
.mrp-popup { display: block; width: 180px; text-decoration: none; color: var(--mrp-text, #1f2933); }
.mrp-popup img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 6px; }
.mrp-popup strong { display: block; color: var(--mrp-primary, #12395b); }
.mrp-popup span { display: block; font-size: 0.9em; }

/* Lightbox */
#mrp-lb {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	z-index: 99999;
	align-items: center;
	justify-content: center;
}
#mrp-lb.mrp-lb-open { display: flex; }
.mrp-lb-img { max-width: 90vw; max-height: 88vh; object-fit: contain; border-radius: 4px; }
.mrp-lb-close,
.mrp-lb-prev,
.mrp-lb-next {
	position: fixed;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border: 0;
	font-size: 26px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
	line-height: 1;
}
.mrp-lb-close:hover, .mrp-lb-prev:hover, .mrp-lb-next:hover { background: rgba(255, 255, 255, 0.28); }
.mrp-lb-close { top: 18px; right: 18px; }
.mrp-lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.mrp-lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.mrp-lb-counter {
	position: fixed;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 14px;
	opacity: 0.85;
}
.mrp-gallery-main { position: relative; }
.mrp-gallery-main img { cursor: zoom-in; }
.mrp-gallery-expand {
	position: absolute;
	right: 12px;
	bottom: 12px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	border: 0;
	border-radius: 6px;
	width: 40px;
	height: 40px;
	font-size: 18px;
	cursor: pointer;
}

/* Formulario de contacto */
.mrp-form { text-align: left; }
.mrp-form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.mrp-form-row input { flex: 1 1 180px; }
.mrp-form input,
.mrp-form textarea {
	padding: 10px 12px;
	border: 1px solid #d5dbe1;
	border-radius: calc(var(--mrp-radius, 10px) / 2);
	font-size: 0.95em;
	width: 100%;
	color: var(--mrp-text, #1f2933);
	background: #fff;
	box-sizing: border-box;
}
.mrp-form textarea { margin-bottom: 12px; }
.mrp-hp { position: absolute !important; left: -9999px !important; height: 0; overflow: hidden; }
.mrp-form-ok { color: #1a7f37; font-weight: 600; }
.mrp-form-error { color: #b42318; font-weight: 600; }
#mrp-contact-form { margin-bottom: 16px; }

/* Similares */
.mrp-similares { margin-top: 36px; }
.mrp-card-body { padding: 16px 18px 18px; }
.mrp-card-price {
	color: var(--mrp-primary, #12395b);
	font-size: 1.3em;
	font-weight: 800;
}
.mrp-card-title { margin: 6px 0 2px; font-size: 1.02em; line-height: 1.35; }
.mrp-card-title a { color: inherit; text-decoration: none; }
.mrp-card-town { font-size: 0.9em; opacity: 0.75; }
.mrp-card-specs {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 12px 0 0;
	padding: 0;
	font-size: 0.86em;
	opacity: 0.85;
}

/* Toolbar y paginación */
.mrp-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin: 8px 0;
	color: var(--mrp-text, #1f2933);
}
.mrp-pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0; }
.mrp-pagination a {
	padding: 6px 13px;
	border: 1px solid var(--mrp-primary, #12395b);
	border-radius: calc(var(--mrp-radius, 10px) / 2);
	color: var(--mrp-primary, #12395b);
	text-decoration: none;
}
.mrp-pagination .mrp-page-current {
	background: var(--mrp-primary, #12395b);
	color: #fff;
}
.mrp-page-dots { padding: 6px 4px; opacity: 0.6; }

/* Buscador */
.mrp-search {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	background: var(--mrp-card-bg, #fff);
	padding: 18px;
	border-radius: var(--mrp-radius, 10px);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	margin: 18px 0;
}
.mrp-search select,
.mrp-search input {
	flex: 1 1 150px;
	padding: 10px 12px;
	border: 1px solid #d5dbe1;
	border-radius: calc(var(--mrp-radius, 10px) / 2);
	font-size: 0.95em;
	color: var(--mrp-text, #1f2933);
	background: #fff;
}

/* Botones */
.mrp-btn {
	display: inline-block;
	background: var(--mrp-primary, #12395b);
	color: #fff !important;
	border: 2px solid var(--mrp-primary, #12395b);
	padding: 10px 22px;
	border-radius: calc(var(--mrp-radius, 10px) / 2);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.15s ease;
}
.mrp-btn:hover { opacity: 0.88; }
.mrp-btn-outline {
	background: transparent;
	color: var(--mrp-primary, #12395b) !important;
}
.mrp-btn-whatsapp {
	background: #25d366;
	border-color: #25d366;
}

/* Ficha */
.mrp-single-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 16px;
}
.mrp-single-header .mrp-badge { position: static; margin-right: 10px; }
.mrp-single-town { font-weight: 600; }
.mrp-single-ref { opacity: 0.7; margin-left: 10px; font-size: 0.9em; }
.mrp-single-price {
	color: var(--mrp-primary, #12395b);
	font-size: 1.7em;
	font-weight: 800;
}

.mrp-gallery-main img {
	width: 100%;
	max-height: 540px;
	object-fit: cover;
	border-radius: var(--mrp-radius, 10px);
	display: block;
}
.mrp-gallery-thumbs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	margin-top: 8px;
	padding-bottom: 4px;
}
.mrp-gallery-thumbs img {
	width: 110px;
	height: 74px;
	object-fit: cover;
	border-radius: calc(var(--mrp-radius, 10px) / 2);
	cursor: pointer;
	opacity: 0.7;
	flex: 0 0 auto;
	border: 2px solid transparent;
}
.mrp-gallery-thumbs img:hover { opacity: 1; }
.mrp-gallery-thumbs .mrp-thumb-active {
	opacity: 1;
	border-color: var(--mrp-secondary, #c9a227);
}

.mrp-single-description { margin: 24px 0; }

.mrp-specs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px;
	margin: 16px 0 24px;
}
.mrp-spec {
	background: var(--mrp-card-bg, #fff);
	border: 1px solid #e3e8ee;
	border-radius: calc(var(--mrp-radius, 10px) / 2);
	padding: 10px 14px;
	display: flex;
	flex-direction: column;
}
.mrp-spec span { font-size: 0.8em; opacity: 0.7; }
.mrp-spec strong { color: var(--mrp-primary, #12395b); }

.mrp-features {
	list-style: none;
	padding: 0;
	margin: 0 0 24px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 6px 16px;
}
.mrp-features li::before {
	content: "✓ ";
	color: var(--mrp-secondary, #c9a227);
	font-weight: 700;
}

.mrp-map iframe {
	width: 100%;
	height: 380px;
	border: 0;
	border-radius: var(--mrp-radius, 10px);
}

.mrp-contact {
	margin-top: 32px;
	padding: 24px;
	background: var(--mrp-card-bg, #fff);
	border: 1px solid #e3e8ee;
	border-radius: var(--mrp-radius, 10px);
	text-align: center;
}
.mrp-contact-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
	margin-top: 12px;
}

.mrp-empty { padding: 24px 0; opacity: 0.8; }

/* ==========================================================================
   FICHA DE PROPIEDAD — refinado visual
   Solo CSS: no requiere ningún cambio en PHP ni en el HTML de la ficha.
   Todo sigue colgando de las variables de Ajustes (--mrp-primary, --mrp-secondary…).
   ========================================================================== */

/* --- 1. Cabecera: aire, jerarquía y el precio como protagonista ---------- */
.mrp-single-header {
	align-items: flex-end;
	gap: 16px 24px;
	padding-bottom: 20px;
	margin-bottom: 28px;
	border-bottom: 1px solid #e6e9ed;
}
.mrp-single-header > div:first-child {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 4px;
}
.mrp-single-header .mrp-badge {
	padding: 5px 12px;
	letter-spacing: 0.08em;
}
.mrp-single-town { font-size: 1.02em; }
.mrp-single-ref {
	margin-left: 6px;
	padding-left: 12px;
	border-left: 1px solid #d8dde3;
	opacity: 0.6;
}
.mrp-single-price {
	font-size: 2.15em;
	line-height: 1;
	letter-spacing: -0.02em;
	white-space: nowrap;
}

/* --- 2. Galería: marco cinematográfico y sin salto de layout ------------- */
.mrp-gallery-main img {
	aspect-ratio: 16 / 9;   /* reserva el hueco antes de cargar: elimina el CLS */
	max-height: none;
	height: auto;
	box-shadow: 0 6px 28px rgba(18, 57, 91, 0.13);
}
.mrp-gallery-thumbs {
	gap: 10px;
	margin-top: 12px;
	padding-bottom: 8px;
	scrollbar-width: thin;
	scrollbar-color: #c9ced6 transparent;
}
.mrp-gallery-thumbs::-webkit-scrollbar { height: 6px; }
.mrp-gallery-thumbs::-webkit-scrollbar-track { background: transparent; }
.mrp-gallery-thumbs::-webkit-scrollbar-thumb { background: #c9ced6; border-radius: 3px; }
.mrp-gallery-thumbs img {
	width: 132px;
	height: 88px;
	opacity: 0.55;
	transition: opacity 0.18s ease, border-color 0.18s ease;
}
.mrp-gallery-expand {
	width: 44px;
	height: 44px;
	transition: background 0.18s ease;
}
.mrp-gallery-expand:hover { background: rgba(0, 0, 0, 0.78); }

/* --- 3. Descripción: medida de lectura y ritmo editorial ----------------- */
.mrp-single-description {
	max-width: 74ch;        /* line-length óptima: el muro de texto es ilegible a 1.100 px */
	margin: 38px 0 8px;
	font-size: 1.04em;
	line-height: 1.8;
}
.mrp-single-description p { margin: 0 0 1.2em; }
.mrp-single-description p:last-child { margin-bottom: 0; }
/* Entradilla: solo si Witei manda párrafos reales (si viene un bloque único, no se aplica). */
.mrp-single-description p:first-of-type:not(:last-of-type) {
	font-size: 1.13em;
	line-height: 1.65;
	font-weight: 500;
	color: var(--mrp-primary, #12395b);
}
/* Respiro entre líneas cuando el feed separa con saltos simples en vez de párrafos. */
.mrp-single-description br {
	display: block;
	content: "";
	margin-top: 0.55em;
}

/* --- 4. Títulos de sección con filete de acento ------------------------- */
body.single-propiedad .mrp-single > h2,
body.single-propiedad .mrp-similares > h2 {
	font-size: 1.55em;
	line-height: 1.25;
	margin: 50px 0 18px;
	padding: 0;
	border: 0;
}
body.single-propiedad .mrp-single > h2::after,
body.single-propiedad .mrp-similares > h2::after {
	content: "";
	display: block;
	width: 52px;
	height: 3px;
	margin-top: 12px;
	border-radius: 2px;
	background: var(--mrp-secondary, #c9a227);
}

/* --- 5. Características: fichas con jerarquía real ----------------------- */
.mrp-specs-grid {
	gap: 14px;
	margin: 0 0 30px;
}
.mrp-spec {
	padding: 14px 16px;
	background: #fbfcfd;
	border-color: #e6ebf0;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.mrp-spec:hover {
	border-color: var(--mrp-secondary, #c9a227);
	box-shadow: 0 2px 10px rgba(18, 57, 91, 0.07);
}
.mrp-spec span {
	margin-bottom: 5px;
	font-size: 0.72em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	opacity: 0.6;
}
.mrp-spec strong {
	font-size: 1.12em;
	line-height: 1.3;
}

/* --- 6. Equipamiento: etiquetas en vez de lista de la compra ------------- */
.mrp-features {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin: 0 0 34px;
}
.mrp-features li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 15px;
	background: #f5f7f9;
	border: 1px solid #e6ebf0;
	border-radius: 999px;
	font-size: 0.9em;
	line-height: 1.2;
}
.mrp-features li::before {
	content: "✓";
	font-size: 0.85em;
}

/* --- 7. Mapa ------------------------------------------------------------ */
.mrp-single .mrp-map-canvas {
	border: 1px solid #e6ebf0;
	box-shadow: 0 2px 14px rgba(18, 57, 91, 0.06);
}

/* --- 8. Bloque de contacto: es el punto de conversión, que lo parezca ---- */
.mrp-contact {
	margin-top: 52px;
	padding: 46px 32px;
	border: 0;
	color: #fff;
	background: var(--mrp-primary, #12395b);
	background-image: linear-gradient(135deg, var(--mrp-primary, #12395b) 0%, rgba(0, 0, 0, 0.35) 190%);
	box-shadow: 0 10px 34px rgba(18, 57, 91, 0.22);
}
.mrp-contact h2 {
	margin: 0;
	font-size: 1.75em;
	line-height: 1.25;
	color: #fff;
}
.mrp-contact-actions {
	margin-top: 26px;
	gap: 14px;
}
.mrp-contact .mrp-btn {
	padding: 14px 34px;
	font-size: 1.02em;
	background: var(--mrp-secondary, #c9a227);
	border-color: var(--mrp-secondary, #c9a227);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.mrp-contact .mrp-btn-outline {
	background: transparent;
	color: #fff !important;
	border-color: rgba(255, 255, 255, 0.45);
	box-shadow: none;
}
.mrp-contact .mrp-btn-outline:hover {
	background: rgba(255, 255, 255, 0.1);
	opacity: 1;
}
.mrp-contact .mrp-btn-whatsapp {
	background: #25d366;
	border-color: #25d366;
}
/* Si solo hay un botón configurado, ese es la llamada a la acción principal. */
.mrp-contact-actions .mrp-btn:only-child {
	background: var(--mrp-secondary, #c9a227);
	border-color: var(--mrp-secondary, #c9a227);
	color: #fff !important;
}
/* Formulario legible sobre el fondo oscuro (modo "formulario" o "ambos"). */
.mrp-contact .mrp-form {
	max-width: 640px;
	margin: 24px auto 0;
}
.mrp-contact .mrp-form input,
.mrp-contact .mrp-form textarea {
	background: rgba(255, 255, 255, 0.97);
	border-color: transparent;
}
.mrp-contact .mrp-form-ok { color: #7ee2a8; }
.mrp-contact .mrp-form-error { color: #ffb4ab; }

/* Línea de apoyo bajo el título del bloque de contacto */
.mrp-contact-tagline {
	margin: 10px 0 0;
	color: rgba(255, 255, 255, 0.82);
	font-size: 1.02em;
}

/* --- 9. Similares ------------------------------------------------------- */
.mrp-similares { margin-top: 60px; }

/* --- 10. Móvil ---------------------------------------------------------- */
@media (max-width: 782px) {
	.mrp-single-header { align-items: flex-start; }
	.mrp-single-price { font-size: 1.75em; }
	.mrp-gallery-main img { aspect-ratio: 4 / 3; }
	.mrp-gallery-thumbs img { width: 104px; height: 70px; }
	.mrp-single-description { font-size: 1em; line-height: 1.75; }
	body.single-propiedad .mrp-single > h2,
	body.single-propiedad .mrp-similares > h2 { font-size: 1.32em; margin-top: 38px; }
	.mrp-contact { padding: 34px 20px; }
	.mrp-contact h2 { font-size: 1.35em; }
	.mrp-contact .mrp-btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
	.mrp-spec, .mrp-gallery-thumbs img, .mrp-gallery-expand { transition: none; }
}

/* --- Vendidas ------------------------------------------------------------ */
.mrp-badge--sold { background: #565e69; }
.mrp-card--sold .mrp-card-media img { filter: grayscale(45%); }
.mrp-card--sold:hover { transform: none; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }
.mrp-card--sold .mrp-card-price { color: #565e69; }

/* --- Vídeo de la propiedad ---------------------------------------------- */
.mrp-video-link { margin: 14px 0 0; }
