/*
Theme Name: TerraHome — Apple Style
Theme URI: https://www.terrahome.cc
Author: TerraHome
Author URI: https://www.terrahome.cc
Description: Theme de WordPress para TerraHome (bienes raíces en Honduras) inspirado en el lenguaje visual de apple.com: tipografía grande, mucho espacio en blanco, secciones a pantalla completa y micro-animaciones al hacer scroll. Incluye un tipo de contenido "Propiedad" y puntos de conexión para el chatbot TH Agent, el formulario de contacto y las calculadoras existentes.
Version: 1.11.2
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: terrahome
*/

/* =========================================================================
   0. RESET
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body, h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
/* Salvaguarda: cualquier bloque de contenido (tabla ancha, video incrustado,
   texto sin espacios) que se salga de su columna no debe generar una barra
   de scroll horizontal en todo el sitio ni cortar el contenido visible. */
body { overflow-x: hidden; width: 100%; }
table, iframe, video, embed, object { max-width: 100%; }
pre, code { max-width: 100%; overflow-x: auto; }

/* =========================================================================
   1. VARIABLES
   ========================================================================= */
:root {
	--th-black: #1d1d1f;
	--th-white: #ffffff;
	--th-gray-bg: #f5f5f7;
	--th-gray-bg-dark: #eceef1;
	--th-gray-text: #6e6e73;
	--th-accent: #159a7c; /* teal del logo TerraHome */
	--th-accent-dark: #0f7a63;
	--th-border: #d2d2d7;
	--th-radius-sm: 12px;
	--th-radius-md: 18px;
	--th-radius-lg: 28px;
	--th-container: 1200px;
	--th-font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
		"Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--th-ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

/* =========================================================================
   2. BASE
   ========================================================================= */
body {
	font-family: var(--th-font);
	color: var(--th-black);
	background: var(--th-white);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	line-height: 1.5;
}

.th-container {
	max-width: var(--th-container);
	margin: 0 auto;
	padding: 0 24px;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; }

.th-eyebrow {
	display: block;
	font-size: 15px;
	font-weight: 600;
	color: var(--th-accent);
	margin-bottom: 8px;
	letter-spacing: 0;
}

.th-section-title {
	font-size: clamp(32px, 5vw, 56px);
	line-height: 1.05;
	text-align: center;
	margin-bottom: 16px;
}

.th-section-subtitle {
	text-align: center;
	color: var(--th-gray-text);
	font-size: clamp(17px, 2vw, 21px);
	max-width: 640px;
	margin: 0 auto 56px;
}

/* =========================================================================
   3. BOTONES
   ========================================================================= */
.th-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 28px;
	border-radius: 999px;
	font-size: 17px;
	font-weight: 500;
	border: 1px solid transparent;
	overflow: hidden;
	isolation: isolate;
	transition: transform 0.2s var(--th-ease), background 0.2s var(--th-ease), box-shadow 0.2s var(--th-ease);
	cursor: pointer;
}
.th-btn::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.35) 40%, rgba(255,255,255,0.35) 50%, transparent 70%);
	transform: translateX(-120%);
	transition: transform 0.6s var(--th-ease);
}
.th-btn:hover::before { transform: translateX(120%); }
.th-btn:active { transform: scale(0.96); }
.th-btn-primary { background: var(--th-accent); color: var(--th-white); box-shadow: 0 8px 20px rgba(21,154,124,0.28); }
.th-btn-primary:hover { background: var(--th-accent-dark); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(21,154,124,0.38); }
.th-btn-primary:active { transform: translateY(0) scale(0.96); }
.th-btn-secondary { background: transparent; color: var(--th-accent); border-color: var(--th-accent); }
.th-btn-secondary:hover { background: rgba(21,154,124,0.08); transform: translateY(-2px); }
.th-btn-light { background: var(--th-white); color: var(--th-black); }
.th-btn-light:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.16); }
.th-btn-ghost { background: transparent; color: var(--th-white); border-color: rgba(255,255,255,0.6); }
.th-btn-ghost:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.th-btn-sm { padding: 10px 20px; font-size: 15px; }

/* =========================================================================
   4. HEADER
   ========================================================================= */
.th-header {
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid rgba(0,0,0,0.06);
	transition: box-shadow 0.3s var(--th-ease);
}
/*
 * El fondo con blur vive en un ::before en vez de directamente en .th-header
 * a propósito: un elemento con backdrop-filter/filter crea un "containing
 * block" nuevo para sus descendientes position:fixed. Si el blur estuviera
 * en .th-header, el menú móvil (position:fixed) quedaría atrapado dentro de
 * los 72/84px del header en vez de ocupar la pantalla completa. Con el blur en
 * un pseudo-elemento aislado, .th-header ya no crea ese containing block y
 * el menú móvil vuelve a posicionarse contra la ventana del navegador.
 */
.th-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(255,255,255,0.8);
	backdrop-filter: saturate(180%) blur(20px);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
}
.th-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 84px;
	overflow: visible;
	transition: height 0.3s var(--th-ease);
}
.th-header--scrolled .th-header-inner { height: 64px; }
.th-header--scrolled .th-logo img,
.th-header--scrolled .th-logo .custom-logo { max-height: 42px; }
.th-header--scrolled { box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 12px 24px rgba(0,0,0,0.05); }
.th-logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	height: 100%;
}
.th-logo img,
.th-logo .custom-logo {
	display: block;
	height: auto;
	max-height: 56px;
	width: auto;
	max-width: 240px;
	object-fit: contain;
}
.th-nav-primary { display: flex; align-items: center; gap: 32px; }
.th-nav-primary a {
	position: relative;
	font-size: 14px;
	font-weight: 590;
	letter-spacing: -0.01em;
	color: var(--th-black);
	opacity: 0.78;
	transition: opacity 0.2s;
	padding-bottom: 4px;
}
.th-nav-primary a::after {
	content: "";
	position: absolute;
	left: 0; right: 100%; bottom: 0;
	height: 2px;
	background: var(--th-accent);
	border-radius: 2px;
	transition: right 0.25s var(--th-ease);
}
.th-nav-primary a:hover { opacity: 1; }
.th-nav-primary a:hover::after { right: 0; }
.th-nav-actions { display: flex; align-items: center; gap: 12px; }
.th-nav-toggle {
	display: none;
	position: relative;
	z-index: 101;
	background: none;
	border: none;
	width: 32px; height: 32px;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
}
.th-nav-toggle span { display: block; height: 2px; background: var(--th-black); border-radius: 2px; transition: transform 0.25s var(--th-ease), opacity 0.2s var(--th-ease); }
body.th-nav-open .th-nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.th-nav-open .th-nav-toggle span:nth-child(2) { opacity: 0; }
body.th-nav-open .th-nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.th-nav-scrim {
	position: fixed;
	top: 84px; right: 0; bottom: 0; left: 0;
	background: rgba(0,0,0,0.45);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s var(--th-ease);
	z-index: 98;
}
body.th-nav-open .th-nav-scrim { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
	.th-nav-primary {
		position: fixed;
		top: 84px; right: 0; bottom: 0;
		width: min(320px, 84vw);
		background: var(--th-white);
		flex-direction: column;
		align-items: stretch;
		padding: 24px 28px 40px;
		gap: 0;
		box-shadow: -16px 0 48px rgba(0,0,0,0.18);
		transform: translateX(100%);
		transition: transform 0.35s var(--th-ease);
		z-index: 99;
		overflow-y: auto;
	}
	.th-nav-primary a {
		font-size: 18px;
		width: 100%;
		padding: 16px 4px;
		border-bottom: 1px solid rgba(0,0,0,0.08);
		opacity: 1;
		color: var(--th-black);
	}
	.th-nav-primary a::after { display: none; }
	body.th-nav-open .th-nav-primary { transform: translateX(0); }
	.th-nav-toggle { display: flex; }
	body.th-nav-open { overflow: hidden; }
}

/* =========================================================================
   5. HERO
   ========================================================================= */
.th-hero {
	position: relative;
	min-height: 92vh;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	overflow: hidden;
	color: var(--th-white);
	background: linear-gradient(180deg, #0b0b0c 0%, #1d1d1f 100%);
}
.th-hero::before {
	content: "";
	position: absolute;
	top: -20%;
	left: 50%;
	width: 1100px;
	height: 1100px;
	transform: translateX(-50%);
	background: radial-gradient(circle, rgba(21,154,124,0.28) 0%, rgba(21,154,124,0) 62%);
	z-index: 0;
	pointer-events: none;
}
.th-hero-media {
	position: absolute;
	inset: 0;
	z-index: 0;
}
.th-hero-slide {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 1.6s ease;
}
.th-hero-slide.is-active { opacity: 1; }
.th-hero-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.66) 100%);
}
.th-hero-content { position: relative; z-index: 1; max-width: 900px; padding: 0 24px; }
.th-hero-content h1 {
	font-size: clamp(40px, 7vw, 88px);
	line-height: 1.02;
	letter-spacing: -0.03em;
	margin-bottom: 20px;
}
.th-hero-content p {
	font-size: clamp(18px, 2.4vw, 26px);
	color: rgba(255,255,255,0.86);
	max-width: 620px;
	margin: 0 auto 36px;
}
.th-hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.th-hero-scroll {
	position: absolute;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 13px;
	color: rgba(255,255,255,0.7);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}
.th-hero-scroll::after {
	content: "";
	width: 1px; height: 28px;
	background: rgba(255,255,255,0.5);
	animation: th-scroll-pulse 1.8s infinite;
}
@keyframes th-scroll-pulse { 0%,100%{opacity:0.2;} 50%{opacity:1;} }

/* =========================================================================
   5b. BUSCADOR RÁPIDO (superpuesto al hero) Y TARJETAS DE ACCIÓN
   ========================================================================= */
.th-search-card {
	position: relative;
	z-index: 2;
	margin-top: -64px;
	background: var(--th-white);
	border-radius: var(--th-radius-lg);
	box-shadow: 0 24px 64px rgba(0,0,0,0.18);
	padding: 28px;
}
.th-search-form {
	display: grid;
	grid-template-columns: repeat(4, 1fr) auto;
	gap: 16px;
	align-items: end;
}
.th-search-field { display: flex; flex-direction: column; gap: 8px; text-align: left; min-width: 0; }
.th-search-field label { font-size: 13px; font-weight: 600; color: var(--th-gray-text); }
.th-search-field select, .th-search-field input {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--th-border);
	border-radius: var(--th-radius-sm);
	font-size: 16px;
	background-color: var(--th-white);
	color: var(--th-black);
}
.th-search-field select {
	appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 18px;
	text-overflow: ellipsis;
}
.th-search-field select:disabled { color: var(--th-gray-text); background-color: var(--th-gray-bg); cursor: not-allowed; }
.th-search-field select:focus, .th-search-field input:focus { outline: none; border-color: var(--th-accent); box-shadow: 0 0 0 3px rgba(21,154,124,0.15); }
.th-search-submit { height: 52px; white-space: nowrap; }
@media (max-width: 1080px) {
	.th-search-form { grid-template-columns: 1fr 1fr; }
	.th-search-submit { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
	.th-search-card { margin-top: -40px; padding: 20px; }
	.th-search-form { grid-template-columns: 1fr; }
	.th-search-submit { grid-column: auto; }
}

.th-action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.th-action-card {
	display: block;
	position: relative;
	overflow: hidden;
	padding: 36px 32px;
	border-radius: var(--th-radius-lg);
	background: var(--th-gray-bg);
	border: 1px solid transparent;
	transition: transform 0.3s var(--th-ease), box-shadow 0.3s var(--th-ease), background 0.3s var(--th-ease);
}
.th-action-card::before {
	content: "";
	position: absolute;
	top: -60px;
	right: -60px;
	width: 200px;
	height: 200px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(21,154,124,0.16) 0%, rgba(21,154,124,0) 70%);
	pointer-events: none;
}
.th-action-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 24px 48px rgba(0,0,0,0.12);
	background: var(--th-white);
}
.th-action-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	position: relative;
	z-index: 1;
}
.th-action-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--th-white);
	color: var(--th-accent);
	box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}
.th-action-icon svg { width: 26px; height: 26px; }
.th-action-arrow {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0,0,0,0.05);
	color: var(--th-black);
	transition: transform 0.3s var(--th-ease), background 0.3s var(--th-ease), color 0.3s var(--th-ease);
}
.th-action-arrow svg { width: 18px; height: 18px; }
.th-action-card:hover .th-action-arrow { background: var(--th-accent); color: var(--th-white); transform: translateX(4px); }
.th-action-card h3 { font-size: 21px; margin-bottom: 8px; position: relative; z-index: 1; }
.th-action-card p { color: var(--th-gray-text); font-size: 15px; position: relative; z-index: 1; }
@media (max-width: 900px) { .th-action-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   6. SECCIONES
   ========================================================================= */
.th-section { padding: 120px 0; }
.th-section-alt { background: var(--th-gray-bg); }
.th-section-dark { background: var(--th-black); color: var(--th-white); }
.th-section-dark .th-section-subtitle { color: rgba(255,255,255,0.7); }

.th-reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--th-ease), transform 0.7s var(--th-ease); }
.th-reveal.th-visible { opacity: 1; transform: translateY(0); }

/* Bloque a pantalla completa tipo "producto" (imagen + texto alternando) */
.th-feature {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 64px;
	align-items: center;
	padding: 80px 0;
}
.th-feature.th-feature-reverse { direction: rtl; }
.th-feature.th-feature-reverse > * { direction: ltr; }
.th-feature-media { aspect-ratio: 9 / 7; overflow: hidden; border-radius: var(--th-radius-lg); }
.th-feature-media img { width: 100%; height: 100%; object-fit: cover; }
.th-feature-text h3 { font-size: clamp(28px, 3.5vw, 42px); margin-bottom: 16px; }
.th-feature-text p { color: var(--th-gray-text); font-size: 19px; margin-bottom: 24px; }
@media (max-width: 900px) {
	.th-feature, .th-feature.th-feature-reverse { grid-template-columns: 1fr; direction: ltr; }
}

/* Estadísticas */
.th-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; text-align: center; }
.th-stat-number { font-size: clamp(36px, 5vw, 56px); font-weight: 700; color: var(--th-accent); font-variant-numeric: tabular-nums; }
.th-stat-label { color: var(--th-gray-text); font-size: 15px; margin-top: 8px; }
@media (max-width: 700px) { .th-stats { grid-template-columns: repeat(2, 1fr); } }

/* Testimonios */
.th-testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.th-testimonial-card {
	background: var(--th-white);
	border-radius: var(--th-radius-md);
	padding: 32px;
	border: 1px solid var(--th-border);
	transition: transform 0.3s var(--th-ease), box-shadow 0.3s var(--th-ease);
}
.th-testimonial-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,0,0,0.08); }
.th-testimonial-card blockquote { margin: 0 0 20px; font-size: 18px; line-height: 1.5; color: var(--th-black); }
.th-testimonial-card figcaption { display: flex; flex-direction: column; }
.th-testimonial-card strong { font-size: 15px; }
.th-testimonial-card span { font-size: 13px; color: var(--th-gray-text); }
@media (max-width: 900px) { .th-testimonial-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   7. TARJETAS DE PROPIEDADES
   ========================================================================= */
.th-property-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
}
@media (max-width: 1000px) { .th-property-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .th-property-grid { grid-template-columns: 1fr; } }

.th-property-card {
	position: relative;
	background: var(--th-white);
	border-radius: var(--th-radius-md);
	overflow: hidden;
	border: 1px solid rgba(0,0,0,0.06);
	box-shadow: 0 1px 2px rgba(0,0,0,0.04);
	transition: transform 0.35s var(--th-ease), box-shadow 0.35s var(--th-ease), border-color 0.35s var(--th-ease);
}
.th-property-card:hover { transform: translateY(-6px); box-shadow: 0 24px 48px rgba(0,0,0,0.14); border-color: rgba(0,0,0,0); }
.th-property-thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--th-gray-bg); }
.th-property-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--th-ease); }
.th-property-card:hover .th-property-thumb img { transform: scale(1.06); }
.th-property-badge {
	position: absolute; top: 16px; left: 16px;
	background: var(--th-accent); color: var(--th-white);
	font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
	text-transform: uppercase; letter-spacing: 0.04em;
}
.th-property-badge--vendida { background: #2b2b2b; }
.th-property-body { padding: 20px; }
.th-property-price { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.th-property-title { font-size: 17px; font-weight: 500; color: var(--th-black); margin-bottom: 10px; }
.th-property-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--th-gray-text); font-size: 14px; }
.th-property-meta span { display: inline-flex; align-items: center; gap: 6px; }

.th-location-filter {
	display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
	justify-content: center; margin-bottom: 24px;
}
.th-location-filter .th-search-field { width: 220px; }
.th-location-filter-clear {
	font-size: 14px; color: var(--th-gray-text); text-decoration: underline;
	text-underline-offset: 2px; padding-bottom: 15px;
}
.th-location-filter-clear:hover { color: var(--th-accent); }
@media (max-width: 700px) {
	.th-location-filter { flex-direction: column; align-items: stretch; }
	.th-location-filter .th-search-field { width: 100%; }
}

.th-filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 48px; }
.th-filter-link {
	padding: 10px 20px; border-radius: 999px; border: 1px solid var(--th-border);
	font-size: 14px; font-weight: 500; color: var(--th-black); transition: all 0.2s;
}
.th-filter-link:hover, .th-filter-link.is-active { background: var(--th-black); color: var(--th-white); border-color: var(--th-black); }

/* =========================================================================
   8. FICHA DE PROPIEDAD
   ========================================================================= */
.th-property-hero { position: relative; height: 70vh; min-height: 460px; }
.th-property-hero img { width: 100%; height: 100%; object-fit: cover; }
.th-property-hero-overlay {
	position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.65) 100%);
	display: flex; align-items: flex-end;
	padding: 48px 0;
}
.th-property-hero-overlay .th-container { color: var(--th-white); }
.th-property-hero-overlay h1 { font-size: clamp(32px, 5vw, 56px); margin-bottom: 8px; }
.th-property-hero-price { font-size: 22px; font-weight: 600; color: #ffffff; opacity: 0.95; }

.th-spec-table { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 56px 0; }
.th-spec-item { text-align: center; padding: 28px 16px; background: var(--th-gray-bg); border-radius: var(--th-radius-md); }
.th-spec-value { font-size: 28px; font-weight: 700; }
.th-spec-label { color: var(--th-gray-text); font-size: 14px; margin-top: 6px; }
@media (max-width: 700px) { .th-spec-table { grid-template-columns: repeat(2, 1fr); } }

.th-property-content,
.th-page-content {
	/* Contenedor ancho: da espacio real a bloques "ancho"/"completo" del
	   editor. El texto normal se recentra a una columna de lectura de
	   820px vía la regla "> *" de abajo, para que siga siendo cómodo de
	   leer aunque el contenedor sea más ancho. */
	max-width: 1100px;
	margin: 0 auto 64px;
	font-size: 18px;
	line-height: 1.7;
	color: #333;
}
.th-property-content > *,
.th-page-content > * {
	max-width: 820px;
	margin-left: auto;
	margin-right: auto;
}
.th-property-content h1, .th-page-content h1 { font-size: 36px; margin: 0 0 20px; }
.th-property-content h2, .th-page-content h2 { font-size: 30px; margin: 48px 0 18px; }
.th-property-content h3, .th-page-content h3 { font-size: 23px; margin: 36px 0 14px; }
.th-property-content h4, .th-page-content h4 { font-size: 19px; margin: 28px 0 12px; }
.th-property-content > *:first-child, .th-page-content > *:first-child { margin-top: 0; }
.th-property-content p, .th-page-content p { margin: 0 0 20px; }
.th-property-content ul, .th-property-content ol,
.th-page-content ul, .th-page-content ol {
	margin: 0 0 20px; padding-left: 24px; list-style: disc;
}
.th-property-content ol, .th-page-content ol { list-style: decimal; }
.th-property-content li, .th-page-content li { margin-bottom: 8px; }
.th-property-content a, .th-page-content a {
	color: var(--th-accent); text-decoration: underline; text-underline-offset: 2px;
}
.th-property-content strong, .th-page-content strong { font-weight: 600; }
.th-property-content blockquote, .th-page-content blockquote {
	margin: 32px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--th-accent);
	font-size: 21px; font-style: italic; color: var(--th-black);
}
.th-property-content img, .th-page-content img {
	border-radius: var(--th-radius-md); height: auto; margin: 8px 0;
}
.th-property-content figure, .th-page-content figure { margin: 32px 0; }
.th-property-content figcaption, .th-page-content figcaption {
	font-size: 14px; color: var(--th-gray-text); text-align: center; margin-top: 10px;
}
.th-property-content hr, .th-page-content hr {
	border: none; border-top: 1px solid var(--th-border); margin: 40px 0;
}

/* Alineaciones anchas del editor de bloques (Gutenberg).
   Usan el selector de hijo directo ">" para pesar más que la regla
   "> *" de arriba (misma especificidad por combinador, pero dos clases
   contra una), sin importar el orden en la hoja de estilos. */
.th-property-content > .alignwide, .th-page-content > .alignwide {
	max-width: 1100px; /* ocupa todo el ancho del contenedor */
}
.th-property-content > .alignfull, .th-page-content > .alignfull {
	max-width: 100vw;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}
.th-property-content > .alignfull img, .th-page-content > .alignfull img { border-radius: 0; }
.th-property-content > .alignleft, .th-page-content > .alignleft {
	float: left; margin: 6px 24px 16px 0; max-width: 45%;
}
.th-property-content > .alignright, .th-page-content > .alignright {
	float: right; margin: 6px 0 16px 24px; max-width: 45%;
}
.th-property-content > .aligncenter, .th-page-content > .aligncenter {
	margin-left: auto; margin-right: auto;
}

/* Columnas, botones y galerías del editor de bloques */
.th-property-content .wp-block-columns,
.th-page-content .wp-block-columns {
	display: flex; flex-wrap: wrap; gap: 32px; margin: 0 0 24px;
}
.th-property-content .wp-block-column,
.th-page-content .wp-block-column {
	flex: 1 1 240px; min-width: 0;
}
.th-property-content .wp-block-column h2,
.th-property-content .wp-block-column h3,
.th-page-content .wp-block-column h2,
.th-page-content .wp-block-column h3 { margin-top: 0; }
.th-property-content .wp-block-buttons,
.th-page-content .wp-block-buttons {
	display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0; list-style: none;
}
.th-property-content .wp-block-button__link,
.th-page-content .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 14px 28px; border-radius: 999px; background: var(--th-accent);
	color: #fff; font-weight: 600; font-size: 16px; text-decoration: none;
	transition: background 0.2s, transform 0.2s;
}
.th-property-content .wp-block-button__link:hover,
.th-page-content .wp-block-button__link:hover { background: var(--th-accent-dark); transform: translateY(-1px); }
.th-property-content .wp-block-button.is-style-outline .wp-block-button__link,
.th-page-content .wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent; color: var(--th-accent); border: 2px solid var(--th-accent);
}
.th-property-content .wp-block-gallery,
.th-page-content .wp-block-gallery {
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; padding: 0; list-style: none;
}
.th-property-content .wp-block-gallery img,
.th-page-content .wp-block-gallery img { width: 100%; height: 100%; object-fit: cover; margin: 0; }
@media (max-width: 700px) {
	.th-property-content .wp-block-gallery,
	.th-page-content .wp-block-gallery { grid-template-columns: repeat(2, 1fr); }
	.th-property-content .wp-block-columns,
	.th-page-content .wp-block-columns { flex-direction: column; }
}

/* ---------- Galería de fotos: slider ---------- */
.th-gallery-slider { position: relative; margin-bottom: 64px; }
.th-gallery-track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	gap: 12px;
	border-radius: var(--th-radius-sm);
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.th-gallery-track::-webkit-scrollbar { display: none; }
.th-gallery-slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	aspect-ratio: 16/10;
	border-radius: var(--th-radius-sm);
	overflow: hidden;
}
.th-gallery-slide img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--th-ease); }
.th-gallery-slide:hover img { transform: scale(1.03); }

.th-gallery-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255,255,255,0.92);
	border: 1px solid var(--th-border);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0,0,0,0.14);
	transition: background 0.2s, transform 0.2s;
}
.th-gallery-nav:hover { background: var(--th-white); transform: translateY(-50%) scale(1.06); }
.th-gallery-nav--prev { left: 12px; }
.th-gallery-nav--next { right: 12px; }

.th-gallery-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.th-gallery-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--th-border); border: 0; padding: 0; cursor: pointer; transition: background 0.2s, transform 0.2s; }
.th-gallery-dot.is-activo { background: var(--th-accent); transform: scale(1.35); }

@media (max-width: 700px) {
	.th-gallery-nav { width: 36px; height: 36px; font-size: 18px; }
}

/* ---------- Lightbox: vista ampliada de la galería ---------- */
.th-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(0,0,0,0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s;
}
.th-lightbox.is-abierto { opacity: 1; visibility: visible; }
.th-lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 8px; }
.th-lightbox-cerrar {
	position: absolute;
	top: 20px;
	right: 24px;
	background: none;
	border: 0;
	color: #fff;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
}
.th-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(255,255,255,0.12);
	border: 1px solid rgba(255,255,255,0.3);
	color: #fff;
	font-size: 26px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}
.th-lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.th-lightbox-nav--prev { left: 20px; }
.th-lightbox-nav--next { right: 20px; }
.th-lightbox-contador { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; opacity: 0.85; }
body.th-lightbox-abierto { overflow: hidden; }

@media (max-width: 700px) {
	.th-lightbox-nav { width: 40px; height: 40px; font-size: 20px; }
	.th-lightbox-cerrar { font-size: 30px; top: 12px; right: 12px; }
}

.th-property-cta { text-align: center; padding: 64px 0; background: var(--th-gray-bg); border-radius: var(--th-radius-lg); margin-bottom: 64px; }

/* =========================================================================
   9. FORMULARIOS
   ========================================================================= */
.th-contact-form-wrap { max-width: 600px; margin: 0 auto; }
.th-form-row { margin-bottom: 20px; text-align: left; }
.th-form-row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.th-form-row input, .th-form-row textarea, .th-form-row select {
	width: 100%; padding: 14px 16px; border: 1px solid var(--th-border);
	border-radius: var(--th-radius-sm); font-size: 16px; background: var(--th-white);
	transition: border-color 0.2s;
}
.th-form-row input:focus, .th-form-row textarea:focus, .th-form-row select:focus {
	outline: none; border-color: var(--th-accent); box-shadow: 0 0 0 3px rgba(21,154,124,0.15);
}
.th-honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.th-form-notice { padding: 14px 18px; border-radius: var(--th-radius-sm); margin-bottom: 20px; font-size: 15px; }
.th-form-success { background: #e6f7f1; color: var(--th-accent-dark); }
.th-form-error { background: #fdeceb; color: #b3261e; }

/* Tarjeta "punto de conexión" para chatbot / calculadora / conversor */
.th-integration-placeholder {
	border: 1px dashed var(--th-border);
	border-radius: var(--th-radius-md);
	padding: 40px;
	text-align: center;
	background: var(--th-gray-bg);
	max-width: 640px;
	margin: 0 auto;
}
.th-integration-badge {
	display: inline-block; background: var(--th-accent); color: #fff;
	font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
	padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
}
.th-integration-placeholder h3 { font-size: 20px; margin-bottom: 8px; }
.th-integration-placeholder p { color: var(--th-gray-text); margin-bottom: 14px; }
.th-integration-placeholder code { background: rgba(0,0,0,0.06); padding: 4px 10px; border-radius: 6px; font-size: 13px; }

/* =========================================================================
   10. WHATSAPP FAB
   ========================================================================= */
.th-whatsapp-fab {
	position: fixed; right: 24px; bottom: 24px; z-index: 90;
	background: #25D366; color: #fff; padding: 14px 22px; border-radius: 999px;
	font-weight: 600; font-size: 15px; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
	display: inline-flex; align-items: center; gap: 8px;
}

/* =========================================================================
   11. FOOTER
   ========================================================================= */
.th-footer {
	position: relative;
	background: var(--th-black); color: rgba(255,255,255,0.8); padding: 64px 0 24px; font-size: 14px;
}
.th-footer::before {
	content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
	background: linear-gradient(90deg, var(--th-accent) 0%, rgba(21,154,124,0) 70%);
}
.th-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; margin-bottom: 48px; }
.th-footer-grid--simple { grid-template-columns: 1.6fr 1fr; align-items: start; gap: 64px; }
@media (max-width: 560px) { .th-footer-grid--simple { grid-template-columns: 1fr; gap: 40px; } }
.th-footer-brand img { height: auto; max-height: 36px; width: auto; max-width: 200px; object-fit: contain; margin-bottom: 16px; }
.th-footer-brand p { color: rgba(255,255,255,0.55); max-width: 280px; line-height: 1.6; }
.footer-widget-title {
	color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 20px;
	text-transform: uppercase; letter-spacing: 0.06em;
}
.footer-widget ul li, .th-footer-links li { margin-bottom: 14px; }
.footer-widget a, .th-footer-links a { color: rgba(255,255,255,0.65); transition: color 0.2s; }
.footer-widget a:hover, .th-footer-links a:hover { color: #fff; }
.th-footer-links--iconos li { display: flex; align-items: center; gap: 12px; }
.th-footer-links--iconos svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--th-accent); }
.th-footer-links--iconos span { color: rgba(255,255,255,0.65); }
.th-footer-bottom {
	border-top: 1px solid rgba(255,255,255,0.12); padding-top: 24px;
	display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
	color: rgba(255,255,255,0.45); font-size: 13px;
}
.th-social { display: flex; gap: 12px; }
.th-social a {
	display: flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 50%;
	background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75);
	transition: background 0.2s, color 0.2s, transform 0.2s;
}
.th-social a svg { width: 17px; height: 17px; }
.th-social a:hover { background: var(--th-accent); color: #fff; transform: translateY(-2px); }
@media (max-width: 900px) { .th-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .th-footer-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   12. PÁGINAS GENÉRICAS / HERRAMIENTAS / NOSOTROS / SERVICIOS
   ========================================================================= */
.th-page-hero {
	position: relative;
	overflow: hidden;
	padding: 160px 0 80px;
	text-align: center;
	background:
		radial-gradient(circle at 14% 22%, rgba(21,154,124,0.16) 0%, rgba(21,154,124,0) 44%),
		radial-gradient(circle at 88% 78%, rgba(21,154,124,0.13) 0%, rgba(21,154,124,0) 48%),
		var(--th-gray-bg);
}
/* Formas suaves y decorativas para que la cabecera no se vea plana aun sin
   foto de portada. */
.th-page-hero::after {
	content: "";
	position: absolute;
	top: -120px;
	right: -80px;
	width: 320px;
	height: 320px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(21,154,124,0.14) 0%, rgba(21,154,124,0) 70%);
	pointer-events: none;
}
.th-page-hero--has-image {
	background-image: var(--th-page-hero-img);
	background-size: cover;
	background-position: center;
}
.th-page-hero--has-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0.82) 100%);
	backdrop-filter: blur(1.5px);
}
.th-page-hero--has-image::after { display: none; }
.th-page-hero > .th-container { position: relative; z-index: 1; }
.th-page-hero h1 { font-size: clamp(36px, 6vw, 64px); margin-bottom: 16px; }
.th-page-hero p { font-size: 20px; color: var(--th-gray-text); max-width: 640px; margin: 0 auto; }

.th-service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.th-service-card { padding: 40px 28px; border-radius: var(--th-radius-md); background: var(--th-gray-bg); text-align: left; }
.th-service-card .th-icon { font-size: 32px; margin-bottom: 16px; display: block; }
.th-service-card h3 { font-size: 21px; margin-bottom: 10px; }
.th-service-card p { color: var(--th-gray-text); }
@media (max-width: 900px) { .th-service-grid { grid-template-columns: 1fr; } }

.th-tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 900px) { .th-tools-grid { grid-template-columns: 1fr; } }
.th-tool-card { background: var(--th-white); border: 1px solid var(--th-border); border-radius: var(--th-radius-lg); padding: 40px; }
.th-tool-card h3 { font-size: 24px; margin-bottom: 8px; }
.th-tool-card p.th-tool-desc { color: var(--th-gray-text); margin-bottom: 24px; }

.th-team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.th-team-card { display: block; text-align: center; transition: transform 0.3s var(--th-ease); }
.th-team-card:hover { transform: translateY(-4px); }
.th-team-card img { border-radius: 50%; width: 160px; height: 160px; object-fit: cover; margin: 0 auto 16px; }
.th-team-card .th-asesor-perfil-foto-vacia { width: 160px; height: 160px; margin: 0 auto 16px; font-size: 48px; }
.th-team-card h4 { font-size: 18px; color: var(--th-black); }
.th-team-card span { color: var(--th-gray-text); font-size: 14px; }
@media (max-width: 900px) { .th-team-grid { grid-template-columns: 1fr; } }

.th-article { max-width: 1100px; margin: 160px auto 100px; padding: 0 24px; font-size: 18px; }
.th-article h1, .th-article > .th-eyebrow {
	max-width: 820px;
}
.th-article h1 { font-size: 42px; margin-bottom: 24px; }

/* =========================================================================
   13. UTILIDADES
   ========================================================================= */
.th-text-center { text-align: center; }
.th-mt-0 { margin-top: 0; }
.th-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* =========================================================================
   14. FAVORITOS (corazón guardar / quitar)
   ========================================================================= */
.th-favorito-btn {
	position: absolute; top: 16px; right: 16px; z-index: 2;
	width: 38px; height: 38px; border-radius: 50%; border: none;
	background: rgba(255,255,255,0.92); color: var(--th-black);
	display: flex; align-items: center; justify-content: center; cursor: pointer;
	box-shadow: 0 2px 8px rgba(0,0,0,0.12);
	transition: transform 0.2s var(--th-ease), background 0.2s, color 0.2s;
}
.th-favorito-btn svg { width: 19px; height: 19px; }
.th-favorito-btn:hover { transform: scale(1.08); }
.th-favorito-btn.is-activo { background: var(--th-accent); color: #fff; }
.th-favorito-btn.is-activo svg { fill: currentColor; }
.th-favorito-btn--hero { top: auto; bottom: 24px; right: 24px; width: 48px; height: 48px; }
.th-favorito-btn--hero svg { width: 24px; height: 24px; }

.th-favoritos-link {
	display: inline-flex; align-items: center; gap: 6px;
	height: 40px; padding: 0 16px 0 0; border-radius: 999px; color: var(--th-black);
	background: var(--th-gray-bg);
	font-size: 14px; font-weight: 600;
	transition: background 0.2s, color 0.2s, transform 0.2s;
}
.th-favoritos-link-icono { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; }
.th-favoritos-link svg { width: 19px; height: 19px; }
.th-favoritos-link:hover { color: var(--th-accent); background: rgba(21,154,124,0.12); transform: translateY(-1px); }
@media (max-width: 640px) {
	.th-favoritos-link { padding: 0; border-radius: 50%; }
	.th-favoritos-link-texto { display: none; }
}
.th-favoritos-contador {
	position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; padding: 0 4px;
	border-radius: 999px; background: var(--th-accent); color: #fff;
	font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
	display: none;
}
.th-favoritos-contador.is-visible { display: block; }

/* =========================================================================
   15. FILTROS AVANZADOS (precio, habitaciones, orden, ver en mapa)
   ========================================================================= */
.th-toggle-mapa {
	background: var(--th-white); cursor: pointer; font-family: inherit;
}

/* =========================================================================
   16. MAPAS (Leaflet / OpenStreetMap)
   ========================================================================= */
.th-mapa {
	width: 100%; border-radius: var(--th-radius-md); overflow: hidden;
	background: var(--th-gray-bg); z-index: 1;
}
.th-mapa--propiedad { height: 380px; margin-bottom: 64px; }
.th-mapa--listado { height: 560px; margin-bottom: 32px; }
@media (max-width: 700px) {
	.th-mapa--propiedad { height: 300px; }
	.th-mapa--listado { height: 420px; }
}

/* =========================================================================
   17. VIDEO / TOUR VIRTUAL
   ========================================================================= */
.th-property-video {
	position: relative; width: 100%; aspect-ratio: 16/9;
	border-radius: var(--th-radius-md); overflow: hidden; margin-bottom: 64px;
	background: var(--th-black);
}
.th-property-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* =========================================================================
   18. ASESORES (perfil, directorio, tarjeta en ficha de propiedad)
   ========================================================================= */
.th-asesor-perfil-foto-vacia {
	display: flex; align-items: center; justify-content: center;
	width: 100%; aspect-ratio: 1/1; border-radius: 50%;
	background: var(--th-accent); color: #fff; font-size: 36px; font-weight: 700;
}
.th-asesor-perfil {
	display: flex; align-items: center; gap: 32px; text-align: left; max-width: 720px; margin: 0 auto;
}
.th-asesor-perfil .th-asesor-perfil-foto { flex: 0 0 auto; }
.th-asesor-perfil-foto { width: 160px; }
.th-asesor-perfil-foto img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; }
.th-asesor-perfil-foto .th-asesor-perfil-foto-vacia { width: 160px; height: 160px; font-size: 48px; }
.th-asesor-cargo { color: var(--th-gray-text); font-size: 17px; margin-bottom: 16px; }
.th-asesor-contacto { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) {
	.th-asesor-perfil { flex-direction: column; text-align: center; }
	.th-asesor-contacto { justify-content: center; }
}

.th-asesor-card {
	display: flex; align-items: center; gap: 20px; margin-bottom: 64px;
	padding: 24px; border-radius: var(--th-radius-md); background: var(--th-gray-bg);
}
.th-asesor-card-foto { flex: 0 0 auto; display: block; width: 80px; }
.th-asesor-card-foto img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; display: block; }
.th-asesor-card-foto .th-asesor-perfil-foto-vacia { width: 80px; height: 80px; font-size: 26px; }
.th-asesor-card-nombre { color: var(--th-black); }
.th-asesor-card h3 { font-size: 19px; margin-bottom: 2px; }
.th-asesor-card .th-asesor-cargo { font-size: 15px; margin-bottom: 0; }
@media (max-width: 560px) {
	.th-asesor-card { flex-direction: column; text-align: center; }
}
