/**
 * Tarrallo Properties - Frontend Styles
 * Version: 1.0.0
 */

/* ===========================
   1. VARIABLES Y RESET
   =========================== */
:root {
	--tp-primary: #1F4E5F;
	--tp-secondary: #587C88;
	--tp-secondary-light: #80ADB4;
	--tp-secondary-bg: #f1f6f7;
	--tp-secondary-tint: #e6eef0;
	--tp-white: #FFFFFF;
	--tp-ink: #1a2e36;
	--tp-text: #4a5d65;
	--tp-text-soft: #6b7d84;
	--tp-border: #e1e7ea;
	--tp-border-soft: #f0f3f5;
	--tp-bg: #fafbfc;
	--tp-radius: 8px;
	--tp-radius-lg: 14px;
	--tp-radius-xl: 20px;
	--tp-shadow-sm: 0 2px 8px rgba(31, 78, 95, 0.06);
	--tp-shadow-md: 0 8px 24px rgba(31, 78, 95, 0.08);
	--tp-shadow-lg: 0 20px 50px rgba(31, 78, 95, 0.12);
	--tp-font-serif: "Cormorant Garamond", Georgia, serif;
	--tp-font-sans: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
	--tp-font-mono: "JetBrains Mono", "Courier New", monospace;
}

.tarrallo-page,
.tarrallo-archive-page,
.tarrallo-single-page,
.tarrallo-listing,
.property-detail {
	font-family: var(--tp-font-sans);
	color: var(--tp-text);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.tarrallo-listing *,
.property-detail * {
	box-sizing: border-box;
}

.tarrallo-listing .container,
.property-detail .container,
.tarrallo-archive-page .container,
.tarrallo-single-page .container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 28px;
}

/* ===========================
   2. ARCHIVE HEADER
   =========================== */
.tarrallo-archive-page {
	padding: 60px 0 80px;
}
.archive-header {
	text-align: center;
	margin-bottom: 48px;
}
.archive-title {
	font-family: var(--tp-font-serif);
	font-size: 64px;
	font-weight: 400;
	color: var(--tp-ink);
	letter-spacing: -0.02em;
	line-height: 1.05;
	margin: 0 0 14px;
}
.archive-subtitle {
	font-size: 16px;
	color: var(--tp-text-soft);
	margin: 0;
}

/* ===========================
   3. FILTROS (toggle, búsqueda, barra)
   =========================== */
.filters-wrap {
	background: var(--tp-white);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius-lg);
	padding: 24px;
	margin-bottom: 32px;
	box-shadow: var(--tp-shadow-sm);
}

/* Toggle Venta/Alquiler */
.op-toggle {
	display: inline-flex;
	background: var(--tp-secondary-bg);
	border-radius: var(--tp-radius);
	padding: 4px;
	margin-bottom: 18px;
}
.op-btn {
	padding: 9px 22px;
	background: transparent;
	border: 0;
	font-family: var(--tp-font-sans);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--tp-text-soft);
	cursor: pointer;
	border-radius: 6px;
	letter-spacing: 0.02em;
	transition: all 0.2s ease;
}
.op-btn:hover {
	color: var(--tp-primary);
}
.op-btn.is-active {
	background: var(--tp-primary);
	color: var(--tp-white);
	box-shadow: 0 2px 6px rgba(31, 78, 95, 0.18);
}

/* Búsqueda referencia */
.ref-search {
	position: relative;
	display: inline-flex;
	align-items: center;
	width: 100%;
	max-width: 360px;
	margin-bottom: 18px;
}
.ref-search svg {
	position: absolute;
	left: 14px;
	color: var(--tp-text-soft);
}
.ref-input {
	width: 100%;
	padding: 11px 14px 11px 38px;
	font-family: var(--tp-font-sans);
	font-size: 13.5px;
	color: var(--tp-ink);
	background: var(--tp-bg);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	outline: none;
	transition: border-color 0.15s ease;
}
.ref-input:focus {
	border-color: var(--tp-secondary-light);
	background: var(--tp-white);
}

/* Barra de filtros principales */
.filters-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}
.filter-group {
	position: relative;
}

/* Dropdown */
.filter-trigger {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	background: var(--tp-white);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	cursor: pointer;
	font-family: var(--tp-font-sans);
	transition: all 0.15s ease;
	min-height: 44px;
}
.filter-trigger:hover {
	border-color: var(--tp-secondary-light);
}
.filter-group.is-open .filter-trigger {
	border-color: var(--tp-primary);
}
.filter-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--tp-text-soft);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	display: block;
}
.filter-value {
	font-size: 13px;
	font-weight: 500;
	color: var(--tp-ink);
	display: block;
	margin-top: 2px;
}
.filter-trigger svg {
	color: var(--tp-text-soft);
	transition: transform 0.2s ease;
}
.filter-group.is-open .filter-trigger svg {
	transform: rotate(180deg);
}

/* Panel desplegable */
.filter-panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	background: var(--tp-white);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	box-shadow: var(--tp-shadow-md);
	padding: 14px;
	min-width: 240px;
	max-height: 320px;
	overflow-y: auto;
	z-index: 50;
	display: none;
}
.filter-panel-narrow { min-width: 280px; }
.filter-group.is-open .filter-panel { display: block; }
.filter-check, .filter-radio {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 6px;
	cursor: pointer;
	font-size: 13.5px;
	color: var(--tp-text);
	border-radius: 4px;
	transition: background 0.12s;
}
.filter-check:hover, .filter-radio:hover {
	background: var(--tp-secondary-bg);
}
.filter-check input, .filter-radio input {
	accent-color: var(--tp-primary);
	margin: 0;
}
.filter-empty {
	font-size: 13px;
	color: var(--tp-text-soft);
	padding: 6px;
	margin: 0;
}

/* Range precio */
.price-range {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.range-input label {
	display: block;
	font-size: 11px;
	color: var(--tp-text-soft);
	margin-bottom: 5px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.range-input input {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--tp-border);
	border-radius: 6px;
	font-family: var(--tp-font-sans);
	font-size: 13.5px;
	color: var(--tp-ink);
	outline: none;
}
.range-input input:focus { border-color: var(--tp-secondary-light); }

/* Segment buttons (dormitorios, baños) */
.filter-segment {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 6px 14px 6px 14px;
	background: var(--tp-white);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	min-height: 44px;
}
.filter-label-inline {
	font-size: 11px;
	font-weight: 600;
	color: var(--tp-text-soft);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.segment-buttons {
	display: inline-flex;
	gap: 2px;
	background: var(--tp-secondary-bg);
	padding: 3px;
	border-radius: 6px;
}
.seg-btn {
	padding: 6px 12px;
	background: transparent;
	border: 0;
	font-family: var(--tp-font-sans);
	font-size: 13px;
	font-weight: 600;
	color: var(--tp-text-soft);
	cursor: pointer;
	border-radius: 4px;
	min-width: 40px;
	transition: all 0.15s;
}
.seg-btn:hover { color: var(--tp-primary); }
.seg-btn.is-active {
	background: var(--tp-white);
	color: var(--tp-primary);
	box-shadow: 0 1px 3px rgba(31, 78, 95, 0.15);
}

/* Más filtros */
.filter-more-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 16px;
	background: var(--tp-white);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
	cursor: pointer;
	font-family: var(--tp-font-sans);
	font-size: 13px;
	font-weight: 600;
	color: var(--tp-primary);
	transition: all 0.15s;
	min-height: 44px;
}
.filter-more-btn:hover {
	border-color: var(--tp-secondary-light);
	background: var(--tp-secondary-bg);
}

/* Aplicar */
.filter-apply-btn {
	margin-left: auto;
	padding: 11px 28px;
	background: var(--tp-primary);
	border: 0;
	border-radius: var(--tp-radius);
	color: var(--tp-white);
	font-family: var(--tp-font-sans);
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	letter-spacing: 0.02em;
	transition: all 0.18s;
	min-height: 44px;
}
.filter-apply-btn:hover {
	background: #15384a;
	box-shadow: 0 4px 12px rgba(31, 78, 95, 0.25);
}

/* Active chips */
.active-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
	min-height: 32px;
}
.active-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: var(--tp-secondary-bg);
	border: 1px solid var(--tp-secondary-tint);
	border-radius: 16px;
	font-size: 12px;
	font-weight: 500;
	color: var(--tp-primary);
}
.active-chip button {
	background: none;
	border: 0;
	color: var(--tp-text-soft);
	cursor: pointer;
	padding: 0;
	display: inline-flex;
	align-items: center;
}
.active-chip button:hover { color: var(--tp-primary); }
.clear-all-btn {
	background: none;
	border: 0;
	color: var(--tp-secondary);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	padding: 6px 4px;
	font-family: var(--tp-font-sans);
}
.clear-all-btn:hover { color: var(--tp-primary); }

/* ===========================
   4. RESULTS HEADER
   =========================== */
.results-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	gap: 16px;
	flex-wrap: wrap;
}
.results-count {
	font-size: 14px;
	color: var(--tp-text-soft);
}
.results-sort {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.results-sort label {
	font-size: 12px;
	color: var(--tp-text-soft);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.sort-select {
	padding: 8px 32px 8px 12px;
	border: 1px solid var(--tp-border);
	border-radius: 6px;
	background: var(--tp-white);
	font-family: var(--tp-font-sans);
	font-size: 13px;
	color: var(--tp-ink);
	cursor: pointer;
	outline: none;
}

/* ===========================
   5. PROPERTIES GRID + CARD
   =========================== */
.properties-grid,
.similar-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
	margin-bottom: 40px;
}
.similar-grid-4 {
	grid-template-columns: repeat(4, 1fr);
	gap: 22px;
}

.property-card {
	background: var(--tp-white);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius-lg);
	overflow: hidden;
	padding: 0;
	transition: all 0.25s ease;
	display: flex;
	flex-direction: column;
}
.property-card:hover {
	border-color: var(--tp-secondary-light);
	box-shadow: var(--tp-shadow-md);
	transform: translateY(-3px);
}

/* Card media (slider) */
.card-media {
	position: relative;
	aspect-ratio: 4/3;
	overflow: hidden;
	background: var(--tp-secondary-bg);
}
.card-link {
	position: absolute;
	inset: 0;
	z-index: 1;
}
.card-tag {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 3;
	padding: 5px 11px;
	background: var(--tp-white);
	border-radius: 4px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--tp-primary);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.card-tag.tag-alquiler { color: var(--tp-secondary); }

.card-slider {
	position: relative;
	width: 100%;
	height: 100%;
}
.card-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}
.card-slide.is-active {
	opacity: 1;
	pointer-events: auto;
}
.card-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.card-slide-more {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--tp-secondary) 0%, var(--tp-secondary-light) 100%);
	color: var(--tp-white);
}
.card-slide-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--tp-secondary-bg);
	color: var(--tp-secondary-light);
}
.more-photos-link {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	color: var(--tp-white);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	z-index: 2;
	position: relative;
}
.card-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.95);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	color: var(--tp-primary);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
	opacity: 0;
	transition: opacity 0.2s, background 0.15s;
}
.property-card:hover .card-arrow { opacity: 1; }
.card-arrow:hover { background: var(--tp-white); }
.card-arrow-prev { left: 12px; }
.card-arrow-next { right: 12px; }
.card-counter {
	position: absolute;
	bottom: 12px;
	left: 14px;
	z-index: 2;
	padding: 4px 10px;
	background: rgba(0, 0, 0, 0.55);
	border-radius: 12px;
	color: var(--tp-white);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
}

/* Card body */
.card-body {
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
}
.card-ref {
	font-family: var(--tp-font-mono);
	font-size: 11px;
	color: var(--tp-text-soft);
	letter-spacing: 0.04em;
}
.card-title {
	font-family: var(--tp-font-serif);
	font-size: 26px;
	font-weight: 500;
	color: var(--tp-ink);
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0;
}
.card-title a {
	color: inherit;
	text-decoration: none;
	position: relative;
	z-index: 2;
}
.card-title a:hover { color: var(--tp-primary); }
.card-location {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--tp-text-soft);
}
.card-location svg { color: var(--tp-secondary-light); flex-shrink: 0; }
.card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	padding: 12px 0;
	border-top: 1px solid var(--tp-border-soft);
	border-bottom: 1px solid var(--tp-border-soft);
}
.card-meta .meta-item {
	font-size: 13px;
	color: var(--tp-text);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.card-meta .meta-item .meta-icon {
	color: var(--tp-secondary-light);
	flex-shrink: 0;
}
.card-meta .meta-item strong {
	color: var(--tp-primary);
	font-weight: 700;
}
.card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
}
.card-price {
	font-family: var(--tp-font-serif);
	font-size: 26px;
	font-weight: 500;
	color: var(--tp-primary);
	letter-spacing: -0.01em;
}
.card-price .price-unit {
	font-family: var(--tp-font-sans);
	font-size: 12px;
	color: var(--tp-text-soft);
	font-weight: 500;
	margin-left: 2px;
}
.card-price .price-on-request {
	font-size: 16px;
	color: var(--tp-secondary);
}
.card-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	background: var(--tp-primary);
	color: var(--tp-white);
	border-radius: 6px;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-decoration: none;
	transition: all 0.18s;
	position: relative;
	z-index: 2;
}
.card-btn:hover {
	background: #15384a;
	color: var(--tp-white);
	transform: translateX(2px);
}

/* ===========================
   6. PAGINACIÓN
   =========================== */
.pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin: 32px 0 16px;
	flex-wrap: wrap;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	background: var(--tp-white);
	border: 1px solid var(--tp-border);
	border-radius: 6px;
	color: var(--tp-text);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.15s;
}
.pagination .page-numbers:hover {
	border-color: var(--tp-secondary-light);
	color: var(--tp-primary);
}
.pagination .page-numbers.current {
	background: var(--tp-primary);
	border-color: var(--tp-primary);
	color: var(--tp-white);
}
.pagination .dots {
	border: 0;
	background: transparent;
}

/* ===========================
   7. NO RESULTS + LOADING
   =========================== */
.no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 80px 20px;
	background: var(--tp-secondary-bg);
	border-radius: var(--tp-radius-lg);
	color: var(--tp-text-soft);
}
.listing-loading {
	display: none;
	text-align: center;
	padding: 60px 20px;
}
.listing-loading.is-active { display: block; }
.loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--tp-secondary-tint);
	border-top-color: var(--tp-primary);
	border-radius: 50%;
	animation: tp-spin 0.8s linear infinite;
	margin: 0 auto;
}
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* ===========================
   8. MODAL "MÁS FILTROS"
   =========================== */
.more-filters-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
}
.more-filters-modal.is-open { display: block; }
.modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 30, 36, 0.55);
	backdrop-filter: blur(2px);
	animation: tp-fadein 0.2s ease;
}
@keyframes tp-fadein { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 92%;
	max-width: 720px;
	max-height: 88vh;
	background: var(--tp-white);
	border-radius: var(--tp-radius-lg);
	display: flex;
	flex-direction: column;
	box-shadow: var(--tp-shadow-lg);
	animation: tp-slidein 0.3s ease;
}
@keyframes tp-slidein {
	from { transform: translate(-50%, -45%); opacity: 0; }
	to { transform: translate(-50%, -50%); opacity: 1; }
}
.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 28px;
	border-bottom: 1px solid var(--tp-border);
}
.modal-header h2 {
	font-family: var(--tp-font-serif);
	font-size: 28px;
	font-weight: 500;
	color: var(--tp-ink);
	margin: 0;
}
.modal-close {
	background: none;
	border: 0;
	color: var(--tp-text-soft);
	cursor: pointer;
	padding: 4px;
	display: inline-flex;
	border-radius: 4px;
}
.modal-close:hover { color: var(--tp-primary); background: var(--tp-secondary-bg); }
.modal-body {
	padding: 22px 28px;
	overflow-y: auto;
	flex: 1;
}
.more-section { margin-bottom: 28px; }
.more-section:last-child { margin-bottom: 0; }
.more-section h3 {
	font-family: var(--tp-font-sans);
	font-size: 12px;
	font-weight: 700;
	color: var(--tp-text-soft);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin: 0 0 12px;
}
.more-checks, .more-radios {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 4px 16px;
}
.more-check, .more-radio {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 6px;
	cursor: pointer;
	font-size: 13.5px;
	color: var(--tp-text);
	border-radius: 4px;
}
.more-check input, .more-radio input {
	accent-color: var(--tp-primary);
	margin: 0;
}
.more-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.more-input label {
	display: block;
	font-size: 11px;
	color: var(--tp-text-soft);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 5px;
}
.more-input input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--tp-border);
	border-radius: 6px;
	font-family: var(--tp-font-sans);
	font-size: 13.5px;
	color: var(--tp-ink);
	outline: none;
}
.more-input input:focus { border-color: var(--tp-secondary-light); }
.more-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: var(--tp-text);
	cursor: pointer;
}
.more-toggle input { accent-color: var(--tp-primary); }
.modal-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 18px 28px;
	border-top: 1px solid var(--tp-border);
	background: var(--tp-bg);
	border-radius: 0 0 var(--tp-radius-lg) var(--tp-radius-lg);
}
.modal-clear-btn {
	background: none;
	border: 0;
	color: var(--tp-text-soft);
	font-family: var(--tp-font-sans);
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
}
.modal-clear-btn:hover { color: var(--tp-primary); }
.modal-apply-btn {
	padding: 12px 32px;
	background: var(--tp-primary);
	border: 0;
	border-radius: var(--tp-radius);
	color: var(--tp-white);
	font-family: var(--tp-font-sans);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	letter-spacing: 0.02em;
}
.modal-apply-btn:hover { background: #15384a; }

/* ===========================
   9. PROPERTY DETAIL — Galería hero
   =========================== */
.property-detail {
	padding-bottom: 80px;
}
.hero-gallery {
	margin-bottom: 56px;
}
.gallery-grid {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 8px;
	height: 78vh;
	min-height: 540px;
	max-height: 800px;
}
.gallery-main, .gallery-side {
	position: relative;
	overflow: hidden;
}
.gallery-main {
	cursor: pointer;
}
.gallery-sides {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
	gap: 8px;
	min-height: 0;
}
.gallery-side {
	cursor: pointer;
	background: var(--tp-bg);
}
.gallery-grid img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}
.gallery-main:hover img,
.gallery-side:hover img { transform: scale(1.03); }
.gallery-tags {
	position: absolute;
	top: 18px;
	left: 18px;
	display: flex;
	gap: 8px;
	z-index: 2;
}
.gallery-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tp-primary);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.gallery-view-all {
	position: absolute;
	bottom: 16px;
	right: 16px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	background: rgba(255, 255, 255, 0.95);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	font-family: var(--tp-font-sans);
	font-size: 12.5px;
	font-weight: 600;
	color: var(--tp-primary);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	transition: all 0.18s;
}
.gallery-view-all:hover {
	background: var(--tp-white);
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

/* ===========================
   10. PROPERTY HEADER + LAYOUT
   =========================== */
.property-header {
	margin-bottom: 48px;
}

/* Fila superior: REF / ZONA */
.header-meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	font-family: var(--tp-font-mono);
	font-size: 12px;
	color: var(--tp-text-soft);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin-bottom: 24px;
}
.header-meta-row .hm-ref { color: var(--tp-secondary); font-weight: 600; }
.header-meta-row .hm-zone { color: var(--tp-text-soft); }
.header-meta-row .hm-sep { color: var(--tp-border); }

/* Fila principal: título a la izquierda, precio + tag + licencia a la derecha */
.header-main-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 48px;
	align-items: flex-start;
	margin-bottom: 36px;
}
.header-title-col { min-width: 0; }
.header-price-col {
	text-align: right;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
}
.header-tag {
	display: inline-block;
	padding: 6px 14px;
	background: var(--tp-secondary-bg);
	color: var(--tp-secondary);
	font-family: var(--tp-font-sans);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	border-radius: 4px;
}
.header-tag.tag-alquiler { background: rgba(46, 109, 91, 0.10); color: #2e6d5b; }
.header-price {
	font-family: var(--tp-font-serif);
	font-size: 48px;
	font-weight: 500;
	color: var(--tp-primary);
	letter-spacing: -0.02em;
	line-height: 1;
}
.header-price .price {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}
.header-price .price-unit {
	font-family: var(--tp-font-sans);
	font-size: 16px;
	color: var(--tp-text-soft);
	font-weight: 500;
	margin-left: 6px;
}
.header-price .price-on-request {
	font-size: 28px;
}
.header-license {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--tp-text-soft);
	letter-spacing: 0.02em;
}
.header-license svg { color: var(--tp-secondary); }
.header-license strong {
	color: var(--tp-secondary);
	font-weight: 600;
	margin-left: 2px;
}

.prop-title {
	font-family: var(--tp-font-serif);
	font-size: 56px;
	font-weight: 400;
	color: var(--tp-ink);
	line-height: 1.05;
	letter-spacing: -0.02em;
	margin: 0 0 12px;
}
.prop-location {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	color: var(--tp-text-soft);
}
.prop-location svg { color: var(--tp-secondary-light); }

.content-layout {
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: 56px;
}
.prop-content { min-width: 0; }
.sidebar { position: relative; }
.sidebar-inner {
	position: sticky;
	top: 24px;
}

/* ===========================
   11. KPIs (franja debajo del header)
   =========================== */
.kpis {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 0;
	padding: 26px 0;
	border-top: 1px solid var(--tp-border);
	border-bottom: 1px solid var(--tp-border);
}
.kpis-strip { margin-top: 8px; }
.kpi {
	text-align: left;
	padding: 0 22px;
	border-right: 1px solid var(--tp-border-soft);
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.kpi:first-child { padding-left: 0; }
.kpi:last-child { border-right: 0; padding-right: 0; }
.kpi-head {
	display: flex;
	align-items: center;
	gap: 8px;
}
.kpi-icon {
	color: var(--tp-secondary-light);
	flex-shrink: 0;
}
.kpi-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--tp-text-soft);
	text-transform: uppercase;
	letter-spacing: 0.1em;
}
.kpi-num {
	font-family: var(--tp-font-serif);
	font-size: 32px;
	font-weight: 500;
	color: var(--tp-ink);
	letter-spacing: -0.02em;
	line-height: 1;
}
.kpi-num span {
	font-size: 16px;
	color: var(--tp-text-soft);
	margin-left: 2px;
	font-weight: 400;
}

/* ===========================
   12. NARRATIVE BLOCKS
   =========================== */
.narrative-block {
	margin-bottom: 56px;
}
.narrative-heading {
	font-family: var(--tp-font-serif);
	font-size: 38px;
	font-weight: 500;
	color: var(--tp-ink);
	letter-spacing: -0.015em;
	line-height: 1.15;
	margin: 0 0 20px;
}
.narrative-image {
	margin-bottom: 24px;
	border-radius: var(--tp-radius-lg);
	overflow: hidden;
}
.narrative-image img {
	width: 100%;
	height: auto;
	display: block;
}
.narrative-content {
	font-size: 16px;
	line-height: 1.75;
	color: var(--tp-text);
}
.narrative-content p { margin: 0 0 16px; }
.narrative-content p:last-child { margin: 0; }

.section-title {
	font-family: var(--tp-font-serif);
	font-size: 36px;
	font-weight: 500;
	color: var(--tp-ink);
	letter-spacing: -0.015em;
	margin: 0 0 28px;
}

/* ===========================
   13. FEATURES
   =========================== */
.features-section {
	padding: 64px 0;
	border-top: 1px solid var(--tp-border-soft);
}
.features-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 36px 48px;
}
.features-cat h3 {
	font-family: var(--tp-font-sans);
	font-size: 12px;
	font-weight: 700;
	color: var(--tp-secondary);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	margin: 0 0 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--tp-border-soft);
}
.features-cat ul {
	list-style: none;
	padding: 0;
	margin: 0;
}
.features-cat li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 6px 0;
	font-size: 14px;
	color: var(--tp-text);
}
.features-cat li svg {
	color: var(--tp-secondary-light);
	flex-shrink: 0;
	margin-top: 4px;
}

/* ===========================
   14. TECH DATA
   =========================== */
.tech-section {
	padding: 64px 0;
	border-top: 1px solid var(--tp-border-soft);
}
.tech-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px 32px;
}
.tech-item {
	padding: 16px 0;
	border-bottom: 1px solid var(--tp-border-soft);
}
.tech-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--tp-text-soft);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 6px;
}
.tech-value {
	font-family: var(--tp-font-serif);
	font-size: 22px;
	font-weight: 500;
	color: var(--tp-ink);
	letter-spacing: -0.01em;
}

/* ===========================
   15. DISTANCES
   =========================== */
.distances-section {
	padding: 64px 0;
	border-top: 1px solid var(--tp-border-soft);
}
.distances-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
	max-width: 920px;
	margin: 0 auto;
}
.distance-item {
	display: grid;
	grid-template-columns: 380px 1fr;
	background: var(--tp-white);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius-lg);
	overflow: hidden;
	transition: all 0.25s ease;
	min-height: 220px;
}
.distance-item:hover {
	border-color: var(--tp-secondary-light);
	box-shadow: var(--tp-shadow-md);
	transform: translateY(-2px);
}
.distance-item:hover .distance-img img { transform: scale(1.05); }
.distance-img {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: var(--tp-secondary-bg);
}
.distance-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
	display: block;
}
.distance-img.no-image {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--tp-secondary-light);
	background: linear-gradient(135deg, var(--tp-secondary-bg) 0%, var(--tp-secondary-tint) 100%);
}
.distance-img.no-image svg { width: 56px; height: 56px; }
.distance-content {
	padding: 32px 36px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 18px;
	min-width: 0;
}
.distance-info { min-width: 0; }
.distance-info .cat {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--tp-secondary);
	margin-bottom: 10px;
}
.distance-info .name {
	font-family: var(--tp-font-serif);
	font-size: 30px;
	font-weight: 500;
	color: var(--tp-ink);
	letter-spacing: -0.01em;
	line-height: 1.15;
	word-wrap: break-word;
	overflow-wrap: break-word;
}
.distance-stats {
	display: flex;
	align-items: center;
	gap: 20px;
	padding-top: 18px;
	border-top: 1px solid var(--tp-border-soft);
	flex-wrap: wrap;
}
.distance-stats .stat {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
	color: var(--tp-text);
}
.distance-stats .stat svg { color: var(--tp-secondary-light); flex-shrink: 0; }
.distance-stats .stat .num {
	font-family: var(--tp-font-serif);
	font-size: 26px;
	font-weight: 500;
	color: var(--tp-primary);
	letter-spacing: -0.01em;
	line-height: 1;
}
.distance-stats .sep-vert {
	width: 1px;
	height: 22px;
	background: var(--tp-border);
}

/* ===========================
   16. DOCS
   =========================== */
.docs-section {
	padding: 64px 0;
	border-top: 1px solid var(--tp-border-soft);
}
.docs-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px 24px;
}
.doc-item {
	padding: 18px 20px;
	background: var(--tp-bg);
	border: 1px solid var(--tp-border-soft);
	border-radius: var(--tp-radius);
}
.doc-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--tp-text-soft);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 6px;
}
.doc-value {
	font-size: 14px;
	font-weight: 600;
	color: var(--tp-ink);
}

/* ===========================
   17. SIDEBAR (AGENTE + FORM)
   =========================== */

/* Agent card */
.agent-card {
	padding: 22px;
	background: var(--tp-bg);
	border: 1px solid var(--tp-border-soft);
	border-radius: var(--tp-radius);
	margin-bottom: 24px;
}
.agent-head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
}
.agent-photo {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--tp-secondary-bg);
	flex-shrink: 0;
}
.agent-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.agent-name {
	font-family: var(--tp-font-serif);
	font-size: 22px;
	font-weight: 500;
	color: var(--tp-ink);
	letter-spacing: -0.01em;
	line-height: 1.1;
}
.agent-role {
	font-size: 12px;
	color: var(--tp-text-soft);
	margin-top: 3px;
	letter-spacing: 0.02em;
}
.agent-langs {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: var(--tp-white);
	border-radius: 4px;
	font-size: 12px;
	color: var(--tp-text);
	margin-bottom: 14px;
}
.agent-langs svg { color: var(--tp-secondary-light); }
.agent-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.btn-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 14px;
	background: var(--tp-white);
	border: 1px solid var(--tp-border);
	border-radius: 6px;
	color: var(--tp-primary);
	text-decoration: none;
	font-size: 12.5px;
	font-weight: 600;
	transition: all 0.18s;
}
.btn-action:hover {
	border-color: var(--tp-secondary-light);
	background: var(--tp-secondary-bg);
}
.btn-action.btn-whatsapp {
	background: #25D366;
	border-color: #25D366;
	color: var(--tp-white);
}
.btn-action.btn-whatsapp:hover { background: #1ebe5d; }

/* Contact form */
.contact-form {
	padding: 24px;
	background: var(--tp-white);
	border: 1px solid var(--tp-border);
	border-radius: var(--tp-radius);
}
.form-title {
	font-family: var(--tp-font-serif);
	font-size: 22px;
	font-weight: 500;
	color: var(--tp-ink);
	margin: 0 0 18px;
}
.contact-form .form-row { margin-bottom: 12px; }
.contact-form .form-row input,
.contact-form .form-row textarea {
	width: 100% !important;
	padding: 13px 14px !important;
	background: var(--tp-bg) !important;
	border: 1px solid var(--tp-border) !important;
	border-radius: 6px !important;
	font-family: var(--tp-font-sans) !important;
	font-size: 14px !important;
	line-height: 1.4 !important;
	color: var(--tp-ink) !important;
	outline: none !important;
	box-shadow: none !important;
	transition: border-color 0.15s, background 0.15s;
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
}
.contact-form .form-row input::placeholder,
.contact-form .form-row textarea::placeholder {
	color: var(--tp-text-soft) !important;
	opacity: 1;
}
.contact-form .form-row input:focus,
.contact-form .form-row textarea:focus {
	border-color: var(--tp-secondary-light) !important;
	background: var(--tp-white) !important;
}
.contact-form .form-row textarea {
	resize: vertical;
	min-height: 90px !important;
	display: block;
}
.form-honeypot {
	position: absolute !important;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.form-privacy {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 12px 0 14px;
	font-size: 12px;
	color: var(--tp-text-soft);
	line-height: 1.5;
}
.form-privacy input { accent-color: var(--tp-primary); margin-top: 2px; }
.form-privacy a { color: var(--tp-primary); }
.form-submit {
	width: 100%;
	padding: 13px;
	background: var(--tp-primary);
	border: 0;
	border-radius: 6px;
	color: var(--tp-white);
	font-family: var(--tp-font-sans);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: all 0.18s;
}
.form-submit:hover { background: #15384a; }
.form-submit:disabled { opacity: 0.6; cursor: wait; }
.form-feedback {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	display: none;
}
.form-feedback.is-success {
	display: block;
	background: #e6f4ec;
	color: #1e7d3f;
}
.form-feedback.is-error {
	display: block;
	background: #fdecec;
	color: #b53030;
}

/* ===========================
   18. SIMILAR PROPERTIES
   =========================== */
.similar-section {
	padding: 80px 0 0;
	border-top: 1px solid var(--tp-border-soft);
	margin-top: 64px;
}

/* ===========================
   19. LIGHTBOX
   =========================== */
.lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
}
.lightbox.is-open { display: block; }
/* Cuando el lightbox o el modal de filtros está abierto, ocultamos el
   header de Divi/tema para que no tape el botón de cerrar ni la cabecera. */
body.tarrallo-overlay-open #main-header,
body.tarrallo-overlay-open #top-header,
body.tarrallo-overlay-open .et-l--header { display: none !important; }
.lightbox-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
}
.lightbox-content {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 60px 80px;
}
.lightbox-image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}
.lightbox-close {
	position: fixed;
	top: 24px;
	right: 24px;
	z-index: 5;
	background: rgba(255, 255, 255, 0.15);
	border: 0;
	color: var(--tp-white);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-prev,
.lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	background: rgba(255, 255, 255, 0.1);
	border: 0;
	color: var(--tp-white);
	width: 50px;
	height: 50px;
	border-radius: 50%;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-counter {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	color: var(--tp-white);
	font-size: 14px;
	letter-spacing: 0.05em;
	font-family: var(--tp-font-mono);
}

/* ===========================
   20. RESPONSIVE
   =========================== */
@media (max-width: 1100px) {
	.content-layout { grid-template-columns: 1fr; gap: 48px; }
	.sidebar-inner { position: static; }
	.gallery-grid { height: 60vh; min-height: 480px; }
	.kpis { grid-template-columns: repeat(3, 1fr); gap: 24px 16px; padding: 24px 0; }
	.kpi { padding: 0 12px; border-right: none; border-bottom: 1px solid var(--tp-border-soft); padding-bottom: 16px; }
	.kpi:first-child { padding-left: 12px; }
	.kpi:last-child { padding-right: 12px; }
	.kpi:nth-last-child(-n+3) { border-bottom: none; padding-bottom: 0; }
	.features-grid { grid-template-columns: 1fr; }
	.tech-grid { grid-template-columns: repeat(2, 1fr); }
	.docs-grid { grid-template-columns: repeat(2, 1fr); }
	.similar-grid,
	.similar-grid-4 { grid-template-columns: repeat(2, 1fr); }
	.distance-item { grid-template-columns: 320px 1fr; min-height: 200px; }
	.distance-content { padding: 26px 28px; }
	.distance-info .name { font-size: 26px; }
	.properties-grid { grid-template-columns: repeat(2, 1fr); }
	.prop-title { font-size: 44px; }
}

@media (max-width: 820px) {
	.tarrallo-listing .container,
	.property-detail .container,
	.tarrallo-archive-page .container,
	.tarrallo-single-page .container { padding: 0 18px; }

	.archive-title { font-size: 44px; }
	.prop-title { font-size: 36px; }
	.section-title { font-size: 28px; }
	.narrative-heading { font-size: 28px; }

	/* Header en una columna: título arriba, precio debajo, KPIs después */
	.header-main-row {
		grid-template-columns: 1fr;
		gap: 22px;
		margin-bottom: 28px;
	}
	.header-price-col {
		text-align: left;
		align-items: flex-start;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 10px 14px;
	}
	.header-tag { order: 1; }
	.header-price { order: 2; font-size: 38px; flex-basis: 100%; }
	.header-license { order: 3; flex-basis: 100%; }

	.gallery-grid {
		grid-template-columns: 1fr;
		gap: 6px;
		height: auto;
		min-height: 0;
		max-height: none;
	}
	.gallery-main { height: 60vh; min-height: 320px; }
	.gallery-sides {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 100px 100px;
		gap: 6px;
	}

	.filters-bar { flex-direction: column; align-items: stretch; gap: 8px; }
	.filter-group { width: 100%; }
	.filter-trigger { width: 100%; justify-content: space-between; }
	.filter-segment { flex-direction: column; align-items: flex-start; gap: 8px; }
	.segment-buttons { width: 100%; }
	.seg-btn { flex: 1; }
	.filter-apply-btn { margin-left: 0; width: 100%; }
	.filter-more-btn { width: 100%; justify-content: center; }
	.filter-panel { position: static; min-width: 0; box-shadow: none; border: 0; padding: 6px 0; }

	.results-header { flex-direction: column; align-items: flex-start; }

	.properties-grid,
	.similar-grid,
	.similar-grid-4 { grid-template-columns: 1fr; }

	.kpis { grid-template-columns: repeat(2, 1fr); }
	.kpi:nth-last-child(-n+3) { border-bottom: 1px solid var(--tp-border-soft); padding-bottom: 16px; }
	.kpi:nth-last-child(-n+2) { border-bottom: none; padding-bottom: 0; }

	.tech-grid { grid-template-columns: 1fr; }
	.docs-grid { grid-template-columns: 1fr; }

	.distance-item {
		grid-template-columns: 1fr;
		min-height: 0;
	}
	.distance-img {
		width: 100%;
		height: 220px;
		min-height: 220px;
	}
	.distance-content { padding: 22px 24px; gap: 14px; }
	.distance-info .name { font-size: 24px; }

	.more-checks, .more-radios { grid-template-columns: 1fr; }

	.modal-panel { width: 96%; max-height: 92vh; }
	.modal-header { padding: 18px 22px; }
	.modal-body { padding: 18px 22px; }
	.modal-footer { padding: 14px 22px; }
	.modal-header h2 { font-size: 24px; }
}

@media (max-width: 480px) {
	.archive-title { font-size: 36px; }
	.prop-title { font-size: 30px; }
	.distance-img { height: 180px; min-height: 180px; }
	.distance-content { padding: 18px 20px; }
	.distance-info .name { font-size: 22px; }
	.distance-stats { gap: 14px; }
	.distance-stats .sep-vert { display: none; }
	.gallery-main { height: 50vh; min-height: 280px; }
	.gallery-sides { grid-template-rows: 80px 80px; }
	.header-price { font-size: 32px; }
	.agent-actions { grid-template-columns: 1fr; }
	.lightbox-content { padding: 40px 20px; }
	.lightbox-prev { left: 8px; }
	.lightbox-next { right: 8px; }
}