/**
 * Viviendax · archive.css
 *
 * Estilos del archive de propiedades (archive-vx_property.php).
 * Solo se carga si is_post_type_archive('vx_property') O cuando hay
 * vx_op_filter activo.
 *
 * Reusa nav/footer/cards de home.css (que también se encola en este contexto).
 */

/* ===========================================================================
 * Reset chrome GeneratePress (igual patrón que home/property).
 * =========================================================================== */
body.post-type-archive-vx_property .site-header,
body.post-type-archive-vx_property .site-footer,
body.post-type-archive-vx_property .generate-back-to-top,
body.post-type-archive-vx_property .widget-area,
body.post-type-archive-vx_property #right-sidebar,
body.post-type-archive-vx_property #left-sidebar {
	display: none !important;
}
body.post-type-archive-vx_property #page,
body.post-type-archive-vx_property #page.grid-container,
body.post-type-archive-vx_property #page.container,
body.post-type-archive-vx_property #page.site,
body.post-type-archive-vx_property .site-content,
body.post-type-archive-vx_property #primary,
body.post-type-archive-vx_property #main,
body.post-type-archive-vx_property .content-area {
	max-width: 100% !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
}
body.post-type-archive-vx_property,
body.post-type-archive-vx_property .site {
	background: var(--background, #fff) !important;
}

/* ===========================================================================
 * Container
 * =========================================================================== */
.vx-archive { color: var(--text); }
.vx-archive * { box-sizing: border-box; }
.vx-archive .wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ===========================================================================
 * Breadcrumbs (reusa estilo de la ficha)
 * =========================================================================== */
.vx-archive .breadcrumbs {
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
	font-size: 13px; color: var(--muted);
	padding: 16px 0;
}
.vx-archive .breadcrumbs a { color: var(--muted); text-decoration: none; }
.vx-archive .breadcrumbs a:hover { color: var(--primary-dark); }
.vx-archive .breadcrumbs .sep { color: var(--border); }
.vx-archive .breadcrumbs .current { color: var(--text); font-weight: 500; }

/* ===========================================================================
 * Header del archive
 * =========================================================================== */
.vx-arc-header {
	display: flex; justify-content: space-between; align-items: flex-end;
	gap: 24px; padding: 8px 0 20px; flex-wrap: wrap;
}
.vx-arc-header h1 {
	font-family: "Inter", system-ui, sans-serif;
	font-weight: 700; font-size: clamp(24px, 3.4vw, 32px);
	letter-spacing: -.025em; line-height: 1.1;
	margin: 0 0 8px;
}
.vx-arc-header .result-count {
	color: var(--muted); font-size: 14px; margin: 0;
}
.vx-arc-header .result-count strong {
	font-family: "Space Mono", monospace; color: var(--text);
}
.vx-arc-header .header-actions {
	display: flex; gap: 12px; align-items: center;
}

/* View toggle */
.view-toggle { display: flex; background: var(--background-soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.view-toggle .view-btn {
	background: transparent; border: 0; padding: 7px 14px;
	border-radius: 999px; cursor: pointer; color: var(--muted);
	display: inline-flex; align-items: center; justify-content: center;
	transition: .15s;
}
.view-toggle .view-btn:hover { color: var(--text); }
.view-toggle .view-btn.active { background: var(--navy); color: #fff; }
.view-toggle .view-btn .ico { width: 16px; height: 16px; }

/* Sort */
.sort-form select {
	padding: 8px 36px 8px 14px;
	background: var(--background);
	border: 1px solid var(--border); border-radius: 8px;
	font-family: "Inter", system-ui, sans-serif;
	font-size: 14px; color: var(--text);
	cursor: pointer;
}
.sort-form select:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.sr-only { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* ===========================================================================
 * Filtros activos chips
 * =========================================================================== */
.vx-arc-active-chips {
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
	padding: 12px 14px; margin-bottom: 16px;
	background: var(--background-soft);
	border-radius: 10px;
	font-size: 13px;
}
.vx-arc-active-chips .lab { color: var(--muted); font-weight: 500; margin-right: 4px; }
.vx-arc-active-chips .chip {
	display: inline-flex; align-items: center; gap: 6px;
	background: var(--background); border: 1px solid var(--border);
	border-radius: 999px; padding: 6px 10px;
	color: var(--text); text-decoration: none;
	font-size: 13px; transition: .15s;
}
.vx-arc-active-chips .chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.vx-arc-active-chips .chip .x { color: var(--muted); font-size: 14px; line-height: 1; }
.vx-arc-active-chips .clear { color: var(--primary-dark); text-decoration: none; font-weight: 500; margin-left: auto; }
.vx-arc-active-chips .clear:hover { text-decoration: underline; }

/* ===========================================================================
 * Layout: sidebar + results
 * =========================================================================== */
.vx-arc-layout {
	display: grid; grid-template-columns: 260px 1fr;
	gap: 32px;
	padding-bottom: 60px;
}
.vx-arc-sidebar {
	position: sticky; top: 88px;
	align-self: start;
	max-height: calc(100vh - 100px);
	overflow-y: auto;
	padding-right: 4px;
}
.vx-arc-sidebar::-webkit-scrollbar { width: 6px; }
.vx-arc-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.vx-arc-sidebar form { display: flex; flex-direction: column; gap: 20px; }

.filter-group h3 {
	font-family: "Inter", system-ui, sans-serif;
	font-weight: 700; font-size: 12px;
	text-transform: uppercase; letter-spacing: .06em;
	color: var(--muted); margin: 0 0 10px;
}

.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-filter {
	display: inline-flex; align-items: center;
	background: var(--background); border: 1px solid var(--border);
	border-radius: 999px; padding: 6px 12px;
	color: var(--text); text-decoration: none;
	font-size: 13px; font-weight: 500;
	cursor: pointer; transition: .15s;
}
.chip-filter:hover { border-color: var(--primary); }
.chip-filter.active {
	background: var(--primary); color: #fff; border-color: var(--primary);
}

.filter-group select {
	width: 100%; padding: 9px 32px 9px 12px;
	background: var(--background) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
	border: 1px solid var(--border); border-radius: 8px;
	font-family: "Inter", system-ui, sans-serif; font-size: 14px;
	appearance: none; cursor: pointer;
}

.range-row { display: flex; align-items: center; gap: 8px; }
.range-row input {
	flex: 1; min-width: 0;
	padding: 9px 12px;
	border: 1px solid var(--border); border-radius: 8px;
	font-family: "Space Mono", monospace; font-size: 13px;
	background: var(--background);
}
.range-row input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.filter-group .hint { font-size: 11px; color: var(--muted); margin: 4px 0 0; }

.apply-filters {
	width: 100%; justify-content: center;
	margin-top: 8px;
}

/* ===========================================================================
 * Results · 3 vistas en el mismo container
 * =========================================================================== */
.vx-arc-results { min-width: 0; }
.vx-arc-view[hidden] { display: none; }

/* Grid: usa .vx-cards de home.css */

/* List view: filas horizontales */
.vx-rows { display: flex; flex-direction: column; gap: 14px; }
.vx-row {
	display: grid; grid-template-columns: 240px 1fr auto;
	gap: 20px; align-items: stretch;
	background: var(--background); border: 1px solid var(--border);
	border-radius: 14px; overflow: hidden;
	color: inherit; text-decoration: none;
	transition: box-shadow .15s, border-color .15s;
}
.vx-row:hover { border-color: var(--primary); box-shadow: 0 12px 28px -18px rgba(15,23,42,.2); }
.vx-row-photo { position: relative; overflow: hidden; min-height: 160px; background: var(--background-soft); }
.vx-row-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vx-row-photo .op-chip {
	position: absolute; top: 10px; left: 10px;
	font-family: "Space Mono", monospace; font-size: 10px; font-weight: 700;
	letter-spacing: .05em; text-transform: uppercase;
	background: var(--primary-light); color: var(--primary-dark);
	border: 1px solid var(--primary-border);
	padding: 4px 9px; border-radius: 999px;
}
.vx-row-body { padding: 16px 8px 16px 0; min-width: 0; }
.vx-row-body h3 { font-family: "Inter", system-ui, sans-serif; font-weight: 700; font-size: 17px; margin: 0 0 6px; color: var(--text); letter-spacing: -.01em; }
.vx-row-body .addr { color: var(--muted); font-size: 13px; margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
.vx-row-body .addr .ico { color: var(--primary-dark); width: 14px; height: 14px; }
.vx-row-specs { display: flex; flex-wrap: wrap; gap: 14px; }
.vx-row-specs span { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text); font-family: "Inter", system-ui, sans-serif; }
.vx-row-specs span .ico { width: 14px; height: 14px; color: var(--primary-dark); }
.vx-row-price {
	display: flex; align-items: center; justify-content: flex-end;
	padding: 16px 20px;
	border-left: 1px solid var(--border);
}
.vx-row-price .price { font-family: "Space Mono", monospace; font-weight: 700; font-size: 18px; color: var(--primary-dark); white-space: nowrap; }
.vx-row-price .price .per { font-size: 11px; color: var(--muted); font-weight: 400; display: block; margin-top: 2px; }

@media (max-width: 780px) {
	.vx-row { grid-template-columns: 1fr; }
	.vx-row-photo { height: 200px; }
	.vx-row-price { border-left: 0; border-top: 1px solid var(--border); justify-content: flex-start; padding: 12px 16px; }
}

/* Map view */
.vx-arc-map {
	height: calc(100vh - 240px);
	min-height: 480px;
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid var(--border);
	background: var(--background-soft);
}
.vx-arc-map .leaflet-container { height: 100%; width: 100%; font-family: "Inter", system-ui, sans-serif; border-radius: 14px; }

/* Marker popup */
.vx-pop-card { width: 220px; padding: 0; }
.vx-pop-card img { width: 100%; height: 120px; object-fit: cover; display: block; border-top-left-radius: 4px; border-top-right-radius: 4px; }
.vx-pop-card .body { padding: 10px 12px 12px; }
.vx-pop-card h4 { font-family: "Inter", system-ui, sans-serif; font-size: 14px; font-weight: 600; margin: 0 0 6px; line-height: 1.25; }
.vx-pop-card .price { font-family: "Space Mono", monospace; font-weight: 700; color: var(--primary-dark); font-size: 14px; margin: 0; }
.vx-pop-card a { color: inherit; text-decoration: none; }

/* Marker custom (precio circular) */
.vx-price-marker {
	background: var(--primary);
	color: #fff;
	border: 2px solid #fff;
	border-radius: 999px;
	padding: 5px 12px;
	font-family: "Space Mono", monospace;
	font-size: 12px; font-weight: 700;
	white-space: nowrap;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
	cursor: pointer;
}
.vx-price-marker:hover { background: var(--primary-dark); }

/* Empty */
.vx-arc-empty {
	text-align: center; padding: 60px 24px;
	background: var(--background-soft); border-radius: 14px;
}
.vx-arc-empty h2 { font-family: "Inter", sans-serif; font-weight: 700; margin: 0 0 8px; font-size: 22px; }
.vx-arc-empty p { color: var(--muted); margin: 0; }

/* Paginación */
.vx-arc-pagination {
	display: flex; gap: 4px; justify-content: center;
	margin-top: 40px; flex-wrap: wrap;
}
.vx-arc-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 38px; height: 38px; padding: 0 12px;
	border: 1px solid var(--border); border-radius: 8px;
	font-family: "Inter", system-ui, sans-serif; font-size: 14px;
	color: var(--text); text-decoration: none;
	transition: .15s;
}
.vx-arc-pagination .page-numbers:hover { border-color: var(--primary); color: var(--primary-dark); }
.vx-arc-pagination .page-numbers.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.vx-arc-pagination .page-numbers.dots { border: 0; }

/* Responsive */
@media (max-width: 980px) {
	.vx-arc-layout { grid-template-columns: 1fr; }
	.vx-arc-sidebar { position: static; max-height: none; }
}
